std: Fix tanh for negative inputs

It turns out the code was not ported correctly from C and produced wrong
results for negative input values. As a bonus fix the NaN codepath by
adding yet another missing piece of code.

Spotted in #9047
a913311f3cLemonBoy committed on 6/11/2021, 5:30:07 PM· committed by Andrew Kelleyparentec4c60c
1 file changedLine totals unavailable