Searched hist:c01611e4370dad4e4e53afe47364019fe569cc46 (Results 1 – 1 of 1) sorted by relevance
/freebsd/lib/msun/src/ |
H A D | k_tanf.c | diff c01611e4370dad4e4e53afe47364019fe569cc46 Thu Nov 10 18:43:49 CET 2005 Bruce Evans <bde@FreeBSD.org> As for __kernel_cosf() and __kernel_sinf(), use a fairly optimal minimax polynomial for __kernel_tanf(). The old one was the double-precision polynomial with coefficients truncated to float. Truncation is not a good way to convert minimax polynomials to lower precision. Optimize for efficiency and use the lowest-degree polynomial that gives a relative error of less than 1 ulp. It has degree 13 instead of 27, and happens to be 2.5 times more accurate (in infinite precision) than the old polynomial (the maximum error is 0.017 ulps instead of 0.041 ulps).
Unlike for cosf and sinf, the old accuracy was close to being inadequate -- the polynomial for double precision has a max error of 0.014 ulps and nearly this small an error is needed. The new accuracy is also a bit small, but exhaustive checking shows that even the old accuracy was enough. The increased accuracy reduces the maximum relative error in the final result on amd64 -O1 from 0.9588 ulps to 0.9044 ulps. diff c01611e4370dad4e4e53afe47364019fe569cc46 Thu Nov 10 18:43:49 CET 2005 Bruce Evans <bde@FreeBSD.org> As for __kernel_cosf() and __kernel_sinf(), use a fairly optimal minimax polynomial for __kernel_tanf(). The old one was the double-precision polynomial with coefficients truncated to float. Truncation is not a good way to convert minimax polynomials to lower precision. Optimize for efficiency and use the lowest-degree polynomial that gives a relative error of less than 1 ulp. It has degree 13 instead of 27, and happens to be 2.5 times more accurate (in infinite precision) than the old polynomial (the maximum error is 0.017 ulps instead of 0.041 ulps).
Unlike for cosf and sinf, the old accuracy was close to being inadequate -- the polynomial for double precision has a max error of 0.014 ulps and nearly this small an error is needed. The new accuracy is also a bit small, but exhaustive checking shows that even the old accuracy was enough. The increased accuracy reduces the maximum relative error in the final result on amd64 -O1 from 0.9588 ulps to 0.9044 ulps.
|