[PATCH] ldbl-128: Fix y0 and y1 for -Inf input
Joseph Myers
joseph@codesourcery.com
Wed Feb 8 18:34:00 GMT 2017
On Wed, 8 Feb 2017, Gabriel F. T. Gomes wrote:
> The code that this patch changes is not executed, because the wrappers
> (in math/w_j0_compat.c and math/w_j1_compat.c) call __kernel_standard
> and return.
It's executed with -lieee (meaning this is user-visible and should have a
bug filed in Bugzilla accordingly).
> The Bessel functions of the second type (Yn) are not defined for
> negative x and should return NAN in these cases. However, current
Not just NaN, NaN with the "invalid" exception raised. (The logical
design is that the main function implementations should get both return
value and exceptions right, with the wrappers only needing to deal with
setting errno and returning the return value from the main implementation
unchanged.)
I think the appropriate fix is for these functions to return 1 / (x + x *
x) for all non-finite input, like those for other floating-point types do.
That achieves the desired results: propagation of NaN payloads for NaN
inputs, with sNaN converted to qNaN, +Inf returning 0 quietly and -Inf
returning a default NaN with "invalid" raised.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list