Split your original NRGY cost basis into two parts, proportional to the valuation of your NRGY and NRGM shares as of the open the day of the issue.
Say your pre-issue cost basis was C. You want to find C = CY + CM.
In ratios, CY is to C, as the value of NRGY is to the value of NRGY + NRGM.
On the issue day, NRGY opened at around 14.71, and NRGM opened around $22.65. Multiplying by the shares of each, to get the valuations of each, and I found that around 39.7% original cost went to the new NRGM shares, and NRGY cost was reduced to 60.3% of the original cost.
Your brokerage will do a sloppy job tracking cost for you; they report numbers, but everyone involved (you, your broker, the IRS) expects the numbers reported to be junk because there don't seem to be any requirements/rule for them to adhere to. (My brokerage routinely reports $0 cost for things, as if I routinely received gifts from God). Do your taxes with *your* numbers, which should be sane and rationally justifyable, and it works out.
In my account it shows NRGM at $0 cost basis. NRGY is showing a loss of about $10. If you sell them at the same time it is a wash. Individually it is another story one is a gain and one is a loss. A couple more deals and I will have a 100% loss in NRGY and a one cent distribution