remainder, remainderf, remquo and remquof returned the host's functions.
The titles' copies are FreeBSD's amd64 e_remainder.S and s_remquo.S: an
x87 fprem1 loop whose remquo quotient is the sign and the three low bits
from C0, C3 and C1, and whose NaN results follow x87 NaN selection. Sony's
wrapper sets EDOM for a zero divisor or an infinite dividend when neither
argument is a NaN. All four now run that loop and set that errno.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve the nearbyint implementation and regression coverage while incorporating current main. The write-watch registration prerequisite is now part of main.
Validation: freshly compiled production MathExact.cpp regression passes; ASan/UBSan passes with detect_leaks=0. The same fixture compiles against main Math.cpp and fails at the FE_INEXACT assertion (exit 134). Conventions, whitespace and 235 script registrations pass. Full product build and full CTest were not rerun for this synchronization.
exp returned the host's exp, whose last bit differs from the titles' copy on
Windows on 9,892,285 of 320 million random arguments. The titles' copy is
FreeBSD msun's e_exp.c, except that exp(1) returns the correctly rounded e,
and it sets ERANGE only in msun's overflow and underflow branches. exp now
computes that and sets ERANGE there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cosh checks had no argument below 2^-55, where cosh returns 1, or
between 22 and log(DBL_MAX), where it returns exp(|x|)/2. Both now have
titles' bits from the libc.prx of PPSA07923 and PPSA05916: 2^-56, 22.5
and -100.25.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
cosh returned the host's std::cosh, one unit in the last place away from
the libc.prx that titles ship on about 7% of arguments. It now follows
fdlibm's e_cosh.c through this file's expm1 and exp: expm1 below
0.5*ln2, (exp + 1/exp)/2 below 22, exp/2 below log(DBL_MAX), and the
exp(|x|/2) product up to the overflow threshold, which the titles use in
place of msun's __ldexp_exp. A finite argument that overflows sets
ERANGE, as on the titles.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wcstod parsed through the host strtod directly, so a decimal input with
a nonzero subnormal result left errno alone, where strtod sets ERANGE.
The wcstod of the libc.prx bundled with eleven titles sets it in the
same cases as their strtod: 1e-310, the smallest subnormal and 1e-330
set it, 2.2250738585072014e-308 and 0x1p-1074 do not, and 0x1.8p-1075
does. wcstod now parses through strtod.
Co-Authored-By: Claude Opus 5.5 <[email protected]>