While oil prices have improved dramatically over the past few years, the average energy stock has failed to keep up. Overall, a barrel of oil produced in the U.S. is up more than 50% over the last three years, while the average energy stock in the S&P 500 has only risen about 12% over that time frame, as measured by the Energy Select Sector SPDR ETF. As a result, most energy stocks are still very cheap compared to the rest of the market.

However, while the entire sector looks undervalued, two stocks stand out as being insanely cheap versus their peers: EQT Corp. (NYSE:EQT) and Newfield Exploration (NYSE:NFX). Value investors will want to take a closer look at these two energy companies.

A sale sign on a yellow paper price tag against rustic wood.

Image source: Getty Images.

Oil stock valuations 101

There are many ways to value an oil and gas producer. However, one of the best, in my opinion, is by looking at how its price to cash flow from operations per share compares to its peers. It's a better way to value oil stocks than a price-to-earnings ratio, for example, since it more accurately reflects an energy company's underlying profitability than reported earnings, because depreciation charges or gains and losses on oil and gas hedges can distort that number.

Using this method, we can find that the average oil and gas producer in the S&P 500 sells for around 10 times its cash flow from operations. EQT Corp. and Newfield Exploration, on the other hand, trade at a mere 4.6 times cash flow from operations. That's at the bottom of the barrel in their peer group. The next cheapest oil stock sells for more than six times cash flow.

Drilling down into EQT Corp

One reason EQT Corp. sells for an insanely low valuation is that it has significantly underperformed its rivals in recent years. Overall, shares of the nation's leading natural gas producer have lost nearly 38% of their value in the last three years.

That decline, however, doesn't make any sense. For starters, the price of natural gas, -- which is EQT Corp.'s main revenue generator -- has risen 33% over that time frame. In addition, the company made several moves designed to grow value, including buying rival Rice Energy and working to separate its midstream business to unlock the value it created in building that entity.

The company has also improved its drilling operations to increase its efficiency and profitability. As a result, its wells are now producing 26% more gas than they were five years ago, while its drilling costs have fallen 44% over that time frame. In addition, EQT has improved its cost structure and balance sheet. These factors position the company to grow its cash flow at a fast pace over the next few years. If that growth doesn't jump-start EQT's stock, there will likely come a point when the company could start using some of its cash flow to buy back its dirt cheap stock.

A drilling rig near some oil pumps with a nice sunset in the background.

Image source: Getty Images.

Drilling down into Newfield Exploration

Newfield Exploration has also lost ground over the last three years, falling about 26% in that time. Again, it's hard to find a logical reason for that decline since the company is in a better position today than it was three years ago.

First of all, Newfield Exploration has done nothing but outperform its drilling plan in recent years. That has been the case again this year as its strong production results in the first half enabled it to increase its full-year outlook, and now the company is aiming to boost output 18% to 25% compared with last year's average. Even better, Newfield Exploration is delivering that fast growth rate while generating excess cash flow. That's giving it the funds to accelerate its development activities while also reducing debt at a faster-than-expected pace.

Given how fast Newfield is growing, it should trade at a much higher valuation. However, because it's not, the company could start diverting some of its free cash toward gobbling up its cheap stock to help narrow the discount between its valuation and the peer group average.

Deep value in the oil patch

While several oil and gas producers look undervalued these days, Newfield and EQT Corp. are by far the cheapest in the sector. Their deep discount doesn't make sense, because both companies have strong balance sheets and excellent growth prospects. Investors who are seeking value should take a closer look at these two producers since the market seems to have mistakenly mispriced them, which suggests they could have the most upside when it realizes that error.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.