1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-09 09:40:42 +00:00
freebsd/lib/msun
Steve Kargl 6d04e1422e cosl(): fix polynomial approximation coefficients for ld128 version
As mention previously, the minmax polynomial approximation
in the kernel for cosl() seem to have a bad set of coefficients.

In testing, cosl() in the interval [0.785, pi/4] for 1 million
values and pi/4 written to 37 decimal digits.  The old version
on an aarch64 system gave

% tlibm/tlibm_lmath -l -x 0.78 -X
7.85398163397448309615660845819875721e-1L cos
Interval tested for cosl: [0.78,0.785398]
count: 1000000
  xm =  7.80213913234863919029058821396125599e-01L
  libm =  7.10763080972549562455058499280609083e-01L
  mpfr =  7.10763080972549562455058499280608983e-01L
  ULP = 1.04431

The max ULP exceeds 1, which is not good.  So, I rinsed off a 10
year code and recomputed coefficients.  The new minmax polynomial
now yields

% tlibm/tlibm_lmath -l -x 0.78 -X
7.85398163397448309615660845819875721e-1L cos
Interval tested for cosl: [0.78,0.785398]
count: 1000000
  xm =  7.82916198746768272588844890973704219e-01L
  libm =  7.08859615479571058183956453286628396e-01L
  mpfr =  7.08859615479571058183956453286628469e-01L
  ULP = 0.75407

which is very good.

PR:	218514
MFC after:	1 week
2021-11-02 10:54:10 +02:00
..
aarch64 Save all fpcr/fpsr bits in the AArch64 fenv_t 2021-03-12 17:01:41 +00:00
amd64 libm: Add missing END() directives for amd64 routines 2019-10-23 16:05:52 +00:00
arm
bsdsrc msun: drop clause 3 from the Berkeley license. 2019-12-27 01:11:26 +00:00
i387 Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
ld80 [LIBM] implementations of sinpi[fl], cospi[fl], and tanpi[fl] 2021-10-26 02:50:20 +03:00
ld128 cosl(): fix polynomial approximation coefficients for ld128 version 2021-11-02 10:54:10 +02:00
man [LIBM] implementations of sinpi[fl], cospi[fl], and tanpi[fl] 2021-10-26 02:50:20 +03:00
mips
powerpc Set default SPE FP environment 2021-05-29 21:53:35 -05:00
riscv RISC-V: Fix feenableexcept return value 2021-03-25 11:16:20 +00:00
src sinpi,cospi,tanpi: float.h needed for week reference 2021-10-29 03:15:19 +03:00
tests Fix failures in libm's lround_test after clang 12 import 2021-06-22 18:38:45 +02:00
x86
Makefile lib/msun: Move the files to appropriate locations in the Makefile 2021-10-27 01:34:12 +03:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Symbol.map [LIBM] implementations of sinpi[fl], cospi[fl], and tanpi[fl] 2021-10-26 02:50:20 +03:00