The stock market rebounded somewhat on Tuesday, although major benchmarks finished with gains that were far smaller than what they'd been earlier in the session. Investors are trying to get past the ominous warning that an inverted yield curve has made regarding a possible future slowdown of the U.S. economy, but early gains of more than 1% eroded as market participants considered some of the macroeconomic and geopolitical risks affecting the financial markets more broadly. Even with the up-and-down motion of the broader indexes, some stocks enjoyed significant advances. Viacom (NASDAQ: VIA) (VIAB), Ferroglobe (GSM 0.80%), and Biogen (BIIB -0.85%) were among the top performers. Here's why they did so well.

Could Viacom and CBS merge after all?

Shares of Viacom rose over 7% after reports that the media giant is apparently back in talks with network company CBS (PARA 1.48%) to merge. Viacom made news yesterday when it negotiated a renewed agreement with AT&T that resolved what could have become a sticky situation with video subscribers, and some believe that the agreement might have made it possible for CBS and Viacom to consider a combination more seriously. The two companies have been no strangers to past merger speculation, but even without guarantees that any deal will eventually get done, Viacom shareholders seem pleased at the idea.

Viacom international studio building with five movie posters and a partly cloudy sky above.

Image source: Viacom.

Ferroglobe could get an offer

Ferroglobe saw its shares rise 8.5% following news reports from Reuters that a buyer might emerge for some of its hydroelectric power assets. Spanish infrastructure and construction company Ferrovial is reportedly looking at boosting its investment in renewable energy projects in its home country, which has made a commitment to move all of its electricity generation to renewable sources over the next 30 years. Ferroglobe apparently wasn't actively looking to sell the hydroelectric assets, but it has gotten expressions of interest from other parties even after regional regulators failed to approve a past offer for their sale. With its core markets under pressure, Ferroglobe might benefit from having a buyer take these noncore operations off its hands.

Check out the latest earnings call transcripts for Viacom, Ferroglobe, and Biogen.

Biogen gets a vote of confidence

Finally, shares of Biogen picked up 6%. The biotech giant came into the session having seen huge declines recently following bad news about its candidate treatment for Alzheimer's disease. Yet today, the stock climbed after Biogen got favorable comments from analysts at Piper Jaffray, who believe that the company is still worth a look from investors. In particular, the analysts thank that an experimental treatment for a form of lateral sclerosis could hold promise for future earnings. Even so, Piper has been in the minority, with many of its analyst peers downgrading the stock following the Alzheimer's-related setback.