# [Bug 218514] [LIBM] implementations of sinpi[fl], cospi[fl], and tanpi[fl]

[ bottom of page ] [ top of archives ] [ this month ]*Go to:*

**<bugzilla-noreply_at_freebsd.org>**

*From:***Sun, 31 Oct 2021 22:09:41 UTC**

*Date:*https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218514 --- Comment #30 from Steve Kargl <kargl@FreeBSD.org> --- Created attachment 229180 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=229180&action=edit Fix the ld128 implementations Mark Murray graciously provided access to an aarch64 system to test the ld128 implementations. This patch address * Misuses of copysignl() in sinpil() and tanpil(). * Redo the splitting of argument 'x' into an integer part and remainder. The remainder must satify 0 <= r < 1. * Update the reduction of the integer part to something that can easily be seen as even or odd, e.g., sin(pi*x) = (-1)^n*sin(pi*r) with n <= 2^112 and we an reduce n by subtracting integer powers of 2. * In s_cospil.c, fix typos where 'x' is used where 'ax', the remainder, is required. * In tanpil(), fix the use of an uninitialized variable, ax = fabsl(ax), ax should be x in fabsl(). One item of note, in the limited tested on aarch64, the max ULP for sinpil() and cospil() were less than 1.1 ULP, which is higher that the desired max ULP less than 1. This was traced to the kernel for cosl() in the fundamental interval [0,pi/4]. The coefficients in the minmax polynomial likely need refinement. -- You are receiving this mail because: You are the assignee for the bug.