You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5d973db
Browse filesBrowse the repository at this point in the historyBrowse files
A factor a numerator's terms hold to a power cancels (#2306)
tanh and coth are spelled (e^(2x) - 1) / (e^(2x) + 1) and its
reciprocal. Past the range of the decimals both sides are infinite, so
tanh(5568) and coth(332640) evaluated to NaN, where they are 1; past a
double's, tanh(400) compiled to NaN in all three compilers. The
negative side was right only because e^(-11136) is 0.
A quotient of one power plus two constants, (b^v + c1) / (b^v + c2),
is the same value as 1 + (c1 - c2) / (b^v + c2) wherever it has one,
and the second does not divide an overflow by an overflow.
ExponentialQuotients writes it so. Evaluation asks for it where both
sides of a quotient come out infinite, and the compilers' pre-pass
writes every such quotient so, since a double cannot tell an overflow
from an infinity. At +oo it is the limit, 1, as tanh(-oo) was already
-1 and arctan(+oo) is pi/2.
Respelling tanh itself as 1 - 2/(e^(2x) + 1) was measured and not
taken: 21 tests change, nearly all integrals of hyperbolic functions
the integrator reads in the quotient form.
HyperbolicTangentPastTheRangeTest takes both sides evaluated and
compiled, the infinities, and the compiled values inside the range,
near 0 as well, against Math.Tanh. Seven of its cases fail on master.
compilesweep's 112 findings are the same list on master and here. The
suite, the trio, F#, AOT and the eight harnesses pass.
Fixes#2254.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments