This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] ldbl-128: Fix y0 and y1 for -Inf input
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 8 Feb 2017 18:34:10 +0000
- Subject: Re: [PATCH] ldbl-128: Fix y0 and y1 for -Inf input
- Authentication-results: sourceware.org; auth=none
- References: <1486578375-14341-1-git-send-email-gftg@linux.vnet.ibm.com>
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