Copy cos(3) software implementation from FreeBSD-13
authorgnezdo <gnezdo@openbsd.org>
Fri, 21 Jan 2022 03:12:43 +0000 (03:12 +0000)
committergnezdo <gnezdo@openbsd.org>
Fri, 21 Jan 2022 03:12:43 +0000 (03:12 +0000)
commit63cbb9862bbaedf428ca2701f60ddf7e65f21787
treeda87c5e518a46da5650a98310b13190f99bc0c8c
parenta2347b6efa99128c1302e9ce2c69fe70501c3a16
Copy cos(3) software implementation from FreeBSD-13

The result passes more tests from msun suite. In particular,
testacc(cos, -0.34061437849088045332L, 0.94254960031831729956L,
ALL_STD_EXCEPT, FE_INEXACT);
matches instead of being 1e-16 off.

OK mbuhl@, tested by mbuhl@ and phessler@
lib/libm/src/k_cos.c
lib/libm/src/s_cos.c