For this example, Sleef_tan_u10 returns a result that is rounded down from the input, whereas the infinitely-precise result is very slightly above x, representing an error very slightly greater than 1.0 ulp.
For small values the algorithm employed by Sleef_tan_u10 reduces to return 2 * (0.5 * x);, which will produce an unfaithful result for any |x| < 0x1p-1021 whose least-significant mantissa bit is set.
The current
Sleef_tan_u10
function has maximum error slightly above 1.0 ulp for some inputs|x| < 0x1p-1021
.The entry-points for which the error has been reproduced are:
The attached tan-test.zip contains a reproducer.
Output of the reproducer:
For this example,
Sleef_tan_u10
returns a result that is rounded down from the input, whereas the infinitely-precise result is very slightly abovex
, representing an error very slightly greater than 1.0 ulp.For small values the algorithm employed by
Sleef_tan_u10
reduces toreturn 2 * (0.5 * x);
, which will produce an unfaithful result for any|x| < 0x1p-1021
whose least-significant mantissa bit is set.