[PATCH v2 11/12] math: Consolidate erf/erfc definitions

DJ Delorie dj@redhat.com
Thu Oct 23 23:10:48 GMT 2025


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> The common code definitions are consolidate in s_erf_common.h.

s/consolidate/consolidated/

> diff --git a/sysdeps/ieee754/dbl-64/s_erf_common.h b/sysdeps/ieee754/dbl-64/s_erf_common.h

> +/* Assuming 0 <= z <= 0x1.7afb48dc96626p+2, put in h+l an approximation
> +   of erf(z). Return err the maximal relative error:
> +   |(h + l)/erf(z) - 1| < err*|h+l| */
> +static double
> +cr_erf_fast (double *h, double *l, double z)
> +{

> +/* for |z| < 1/8, assuming z >= 2^-61, thus no underflow can occur */
> +static void
> +cr_erf_accurate_tiny (double *h, double *l, double z, bool exceptions)
> +{

On 11 Sep 2025, DJ Delorie wrote
> > +static double
> > +cr_erf_fast (double *h, double *l, double z)
> > +{
> 
> If this isn't going to be inlined, it should be in its own *.c file and
> extern'd, so there aren't two copies of it.
> 
> > +/* for |z| < 1/8, assuming z >= 2^-61, thus no underflow can occur */
> > +static void
> > +cr_erf_accurate_tiny (double *h, double *l, double z, bool exceptions)
> > +{
> 
> Likewise.

Did you miss my previous comments, or were there reasons to leave it?  I
didn't see anything in the archives but that's not always a true
indicator ;-)



More information about the Libc-alpha mailing list