<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88819>88819</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc][math] ensure math functions have tests for proper exception, errno, and special case handling
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Flandini
</td>
</tr>
</table>
<pre>
This is in response to #61092.
We should make sure we have tests for all the special cases for all math functions. Tests should use the newly added FPMatchers in `libc/test/UnitTest/FPMatcher.h` after #88816.
I think many of these are fine, but some like the nearest integer functions will need to have their tests broken up or have conditional handling added to the test (e.g., `lrint` vs `lround`).
There are a lot of these, maybe we could good-first-issue each function?
- [ ] ceil
- [ ] canonicalize
- [ ] copysign
- [ ] dadd
- [ ] ddiv
- [ ] dfma
- [ ] dmul
- [ ] dsub
- [ ] fabs
- [ ] fadd
- [ ] fdim
- [ ] fdiv
- [ ] ffma
- [ ] floor
- [ ] fmax
- [ ] fmaximum
- [ ] fmaximum_mag
- [ ] fmaximum_mag_num
- [ ] fmaximum_num
- [ ] fmin
- [ ] fminimum
- [ ] fminimum_mag
- [ ] fminimum_mag_num
- [ ] fminimum_num
- [ ] fmod
- [ ] fmul
- [ ] frexp
- [ ] fromfp
- [ ] fromfpx
- [ ] fsub
- [ ] ilogb
- [ ] ldexp
- [ ] llrint
- [ ] llround
- [ ] logb
- [ ] lrint
- [ ] lround
- [ ] modf
- [ ] nan
- [ ] nearbyint
- [ ] nextafter
- [ ] nextdown
- [ ] nexttoward
- [ ] nextup
- [ ] remainder
- [ ] remquo
- [ ] rint
- [ ] round
- [ ] roundeven
- [ ] scalbn
- [ ] trunc
- [ ] ufromfp
- [ ] ufromfpx
- [ ] acos
- [ ] acosh
- [ ] acospi
- [ ] asin
- [ ] asinh
- [ ] asinpi
- [ ] atan
- [ ] atan2
- [ ] atan2pi
- [ ] atanh
- [ ] atanpi
- [ ] cbrt
- [ ] compoundn
- [ ] cos
- [ ] cosh
- [ ] cospi
- [ ] dsqrt
- [ ] erf
- [ ] erfc
- [ ] exp
- [ ] exp10
- [ ] exp10m1
- [ ] exp2
- [ ] exp2m1
- [ ] expm1
- [ ] fma
- [ ] fsqrt
- [ ] hypot
- [ ] lgamma
- [ ] log
- [ ] log10
- [ ] log10p1
- [ ] log1p
- [ ] log2
- [ ] log2p1
- [ ] logp1
- [ ] pow
- [ ] pown
- [ ] powr
- [ ] rootn
- [ ] rsqrt
- [ ] sin
- [ ] sincos
- [ ] sinh
- [ ] sinpi
- [ ] sqrt
- [ ] tan
- [ ] tanh
- [ ] tanpi
- [ ] tgamma
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lsFu4zgPx59GuRANbCVOk0MOM1ME-A4fsIcu9jiQJdrWVpY8ktwk-_QLOd3pNGQHKFr3J1HknxQFqpRs7xGPovkqmqeVmvMQ4vHklDfW21UbzPX4PNgE5cdDxDQFnxByACE3u7o6yDWI6klUX26__0JIQ5idgVG9IKQ5IpwRBvWKkDHlBF2IoJyDPCCkCbVVDrRK-L4yqjxAN3udbfBpDc-L3duxc_E-IHg8uysoY9DA6Y__q6wHjEuQYlc522ohT8WhkKc_vc3Pt8-fO9eD2FWguoyxKNnv9_Xuo5L_QR6sf4FR-SuErjhNCCoidNajkN-gnTOkMCI4-_JfUCpiymB9xh7juwg4W-fAI5qSuls2BrTxLSdtDC_oYZ4gxNuqDt7YYqocDMobZ33_pjaHxVexBCH3uO7XJZoiO1qfi67XdPs3zN6IXSXkYf2rtOcB402KAhfyT3XlmFFd26Vkekl3H4J56GxM-cGmNCOg0u_FEZvTr-c-gGi-gmieQKN1hCkfvNXK2X-QrIXpWq7iPTfKGMKMfSWsGxVh40xiMGlu71mn2kQZ9dsZOzKMxNIxsXQuhEjgqC4cs-NMHb3x76Pqf7f23f_Gll2zJOmF8THcOB_D-9pnfj6PIdBkM8XrIl4mCsPYfUJpdpnyWx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