Although the stock market is flirting with all-time highs, there are still some good bargain stocks that can be bought on sale. While no one knows where these stocks could be heading in the future, I think that low valuations make International Business Machines (IBM -0.35%), Briggs & Stratton (BGGS.Q), and Gilead Sciences (GILD -0.56%) compelling buys right now. Read on to find out if they're right for your portfolio.

Image source: Getty Images.

Big Blue's profit makes progress, but its shares can still be bought cheap

Sales of IBM's legacy technology products may be slowing, but its "strategic imperatives" products and services are enjoying rapid growth, and despite a rally in shares last year, IBM can still be bought at a reasonable valuation. 

Strategic imperative revenue eclipsed an annualized $32 billion in the third quarter, and sales of cloud products could continue to grow given IBM's competing in a $208 billion market. In Q3, cloud sales clocked in at an annualized clip of $13.5 billion. 

While IBM's top line could still face some struggles as demand for older solutions wanes, the headwinds should ease over time. The stock's rally last year makes it less of a bargain than it was at the start of 2016, but its forward price-to-earnings ratio of 12.1 arguably has more room to climb.

Industry watchers predict that IBM will report earnings per share of $13.50 for the full year 2016, and that EPS could improve to $13.84 in 2017. Since IBM's increased its dividend payout 21 years in a row (shares yield 3.4%), and business conditions could improve, I think IBM could be a top stock. 

Delivering financial horsepower

Briggs & Stratton's small engines are widely used in lawn and garden equipment and generators, and sales and profitability typically peak in the first half of the year. . 

Over the past year, the company's management has successfully increased operating margin from 1.38% to 2.77%, and if seasonal lawn and garden ordering patterns by original equipment manufacturers repeat again this year, then a pickup in housing markets could make 2017 a banner year for this arguably inexpensive industrial stock.

Briggs & Stratton gets roughly 87% of its engine sales from lawn and garden equipment, and demand for that equipment has historically been highly correlated to housing activity. Since new and existing home sales are at their best levels since the Great Recession, there's reason for optimism. 

Image source: St. Louis Federal Reserve.

Currently, investors can buy Briggs & Stratton's stock for 13.7 times forward earnings estimates, and given the uptick in housing, I think that's a more than reasonable price for this company's shares. 

A big bargain in beaten-up biotech

Gilead Sciences shares are trading at an anemic 6.8 times next year's EPS estimates because investors have largely priced in a deceleration in sales of its highly successful hepatitis C drugs. However, while competition and a maturing market are undeniably weighing down Gilead Sciences' hepatitis C revenue, sales comparisons will be easier this year, and the company retains the market share lead in these drugs.

Gilead Sciences also remains the dominant drugmaker of HIV medicine, and a refresh of its HIV product lineup is reinvigorating sales. In Q3, HIV revenue grew over 20% from the same quarter in 2015.

Altogether, Gilead Sciences' $23.1 billion in sales during the first nine months of 2016 makes it one of the biggest biotech companies on the planet. The company's also a cash flow behemoth, with a whopping $31 billion in cash and equivalents on its books. Its finances give it plenty of flexibility to invest in its pipeline projects, including a promising collaboration with Galapagos on the rheumatoid arthritis drug filgotinib. Gilead also has the firepower to acquire innovation from its peers, either through collaborations or outright purchases.

Because Gilead Sciences stock is out of favor, long-term investors can pick it up at its lowest valuation in years, and in my opinion, it won't take much to make that kind of bargain-basement price profit-friendly.