[aarch64-port-dev ] 8210461: AArch64: Math.cos intrinsic gives incorrect results

Dmitrij Pochepko dmitrij.pochepko at bell-sw.com
Thu Sep 6 13:21:08 UTC 2018


Looking into it


On 06/09/18 16:18, Andrew Haley wrote:
> Please confirm this bug:
>
> Range reduction for trig functions on AArch64 is broken. The smallest
> broken case is
>
> Math.cos(1647100)
>
> which should return 0.7833030468809974 but returns
> -0.2745634094819721.
>
> The problem is that __kernel_rem_pio2 is supposed to reduce its
> argument to the range [-pi/4, pi/4], pi/4 ~ 0.785398164 but it does
> not: it returns 1.8489319595787654, which is outside the range of the
> polynomial cosine approximation.
>



More information about the aarch64-port-dev mailing list