Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Nov 2021 05:05:52 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 218514] [LIBM] implementations of sinpi[fl], cospi[fl],  and tanpi[fl]
Message-ID:  <bug-218514-99-7ADyt4r8Ra@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-218514-99@https.bugs.freebsd.org/bugzilla/>
References:  <bug-218514-99@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218514

--- Comment #35 from Steve Kargl <kargl@FreeBSD.org> ---
Created attachment 229215
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229215&action=
=3Dedit
Final diff and this PR can be closed

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 =3D  7.80213913234863919029058821396125599e-01L
libm =3D  7.10763080972549562455058499280609083e-01L
mpfr =3D  7.10763080972549562455058499280608983e-01L
 ULP =3D 1.04431

The max ULP exceeds 1, which is not good.  So, I rinsed off a 10=20
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 =3D  7.82916198746768272588844890973704219e-01L
libm =3D  7.08859615479571058183956453286628396e-01L
mpfr =3D  7.08859615479571058183956453286628469e-01L
 ULP =3D 0.75407

which is very good.  The attach fixes the coefficients.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-218514-99-7ADyt4r8Ra>