[PATCH v2 23/25] math: Use coshf from CORE-MATH
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Dec 18 14:41:25 GMT 2024
On 12/12/24 05:07, Paul Zimmermann wrote:
> Hi DJ,
>
>>> + static const double cp[] =
>>> + {
>>> + 0x1.fffffffffffe3p-2, 0x1.55555555723cfp-5,
>>> + 0x1.6c16bee4a5986p-10, 0x1.a0483fc0328f7p-16
>>> + };
>>> + double z2 = z * z;
>>> + double z4 = z2 * z2;
>>> + return 1 + z2 * ((cp[0] + z2 * cp[1]) + z4 * (cp[2] + z2 * (cp[3])));
>>> + }
>>
>> Ok. The "1" instead of "1.0f" is inconsistent, but doesn't matter...
>
> I guess it should be 1.0 instead. The whole expression should be evaluated
> in double precision (z2 and the cp[] are doubles), and then only rounded to
> float.
>
> Paul
Ack, I will add this fix.
More information about the Libc-alpha
mailing list