This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ldbl-128: Fix y0 and y1 for -Inf input


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]