[PATCH 07/11] math: Split s_erfF in erff and erfc

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Nov 21 18:28:44 GMT 2024



On 20/11/24 19:40, DJ Delorie wrote:
> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>> So we can eventually replace each implementation.
> 
>> diff --git a/math/Makefile b/math/Makefile
>>    s_ceilF \
>>    s_cosF \
>>    s_erfF \
>> +  s_erfcF \
>>    s_expm1F \
> 
> Ok, although 'c' sorts after 'F' in ascii, it sorts before in the
> dictionary.  I suspect in this case it's clearer to ignore the F suffix
> as "not part of the name" wrt sorting, so s_erfc after s_erf.

Right, I am relying to lint-makefile test to get this right; but I 
am not if this handles it fully correct.

> 
>> diff --git a/sysdeps/ieee754/dbl-64/s_erfc.c b/sysdeps/ieee754/dbl-64/s_erfc.c
>> new file mode 100644
>> +/* Not required.  */
> 
> Ok.
> 
>> diff --git a/sysdeps/ieee754/float128/s_erfcf128.c b/sysdeps/ieee754/float128/s_erfcf128.c
>> new file mode 100644
>> +/* Not required.  */
> 
> Ok.
> 
>> diff --git a/sysdeps/ieee754/flt-32/s_erfcf.c b/sysdeps/ieee754/flt-32/s_erfcf.c
>> new file mode 100644
>> index 0000000000..fdba278eff
>> --- /dev/null
>> +++ b/sysdeps/ieee754/flt-32/s_erfcf.c
>> @@ -0,0 +1,173 @@
>> +/* s_erfcf.c -- float version of s_erfc.c.
>> + */
>> . . .
>> +}
>> +libm_alias_float (__erfc, erfc)
> 
> Ok.  This is just a copy of what's deleted below...
> 
>> diff --git a/sysdeps/ieee754/flt-32/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c
>>  
>>  static const float
>>  tiny	    = 1e-30,
>> -half=  5.0000000000e-01, /* 0x3F000000 */
>>  one =  1.0000000000e+00, /* 0x3F800000 */
>> -two =  2.0000000000e+00, /* 0x40000000 */
>> -	/* c = (subfloat)0.84506291151 */
>>  erx =  8.4506291151e-01, /* 0x3f58560b */
>>  /*
>>   * Coefficients for approximation to  erf on [0,0.84375]
>> @@ -156,77 +153,3 @@ float __erff(float x)
>>  }
>>  libm_alias_float (__erf, erf)
>>  
>> -float __erfcf(float x)
>> -{
>> . . .
>> -}
>> -libm_alias_float (__erfc, erfc)
> 
> Ok.
> 
>> diff --git a/sysdeps/ieee754/ldbl-128/s_erfcl.c b/sysdeps/ieee754/ldbl-128/s_erfcl.c
>> new file mode 100644
>> index 0000000000..95d17c8c28
>> --- /dev/null
>> +++ b/sysdeps/ieee754/ldbl-128/s_erfcl.c
>> @@ -0,0 +1 @@
>> +/* Not required.  */
> 
> Ok
> 
>> diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfcl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfcl.c
>> new file mode 100644
>> index 0000000000..95d17c8c28
>> --- /dev/null
>> +++ b/sysdeps/ieee754/ldbl-128ibm/s_erfcl.c
>> @@ -0,0 +1 @@
>> +/* Not required.  */
> 
> Ok
> 
>> diff --git a/sysdeps/ieee754/ldbl-96/s_erfcl.c b/sysdeps/ieee754/ldbl-96/s_erfcl.c
>> new file mode 100644
>> index 0000000000..95d17c8c28
>> --- /dev/null
>> +++ b/sysdeps/ieee754/ldbl-96/s_erfcl.c
>> @@ -0,0 +1 @@
>> +/* Not required.  */
> 
> Ok.
> 
> LGTM
> Reviewed-by: DJ Delorie <dj@redhat.com>
> 



More information about the Libc-alpha mailing list