[PATCH 0/9] Improve hypot()

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Oct 7 12:39:00 GMT 2021



On 07/10/2021 08:03, Paul Zimmermann wrote:
>>  With a random 1e9 inputs for different float format I see:
>>
>>   - An improvement from 3427362 to 18457 results with 1 ulp of
>>     error for Binary64.
>>   - An improvement from 233442 to 1274 results with 1 ulp of
>>     error for Binary96 (x86_64).
>>   - An improvement from 453045 to 1294 results with 1 ulp of
>>     error for Binary96 (x86_64).
> 
> I guess the last one should read Binary128.

Yeap.

> 
> Another comparison is to check for the maximal known error.
> For glibc-2.34 the maximal known errors are as follows (in ulps, with
> corresponding inputs), determined with [1]:
> 
> binary32  0.500 0x1.3ac98p+67,-0x1.ba5ec2p+77
> binary64  0.987 -0x0.5a934b7eac967p-1022,-0x0.b5265a7e06b82p-1022
> binary96  0.981 0x1.73f339f61eda21dp-16384l,0x2.e45f9f9500877e2p-16384l
> binary128 0.985 -0x2.d8311789103b76133ea1d5bc38c4p-16384,-0x1.6d85492006d7dcc6cc52938684p-16384
> 
> With the new code I get (with threshold 1000000, except for binary128 where I
> used 200000):
> 
> binary32  0.500 0x1.3ac98p+67,-0x1.ba5ec2p+77 [same]
> binary64  0.792 0x0.603e52daf0bfdp-1022,-0x0.a622d0a9a433bp-1022
> binary96  0.584 -0x2.97b86706043d619p+7240l,0x1.8256bdd12d2e163ep+7240l
> binary128 0.749 0x2.2d5faf4036d6e68566f01054612p-8192,0x3.5738e8e2505f5d1fc2973716f05p-8192

Thanks to double check that precision does improve in all cases.

> 
> Paul
> 
> [1] https://gitlab.inria.fr/zimmerma/math_accuracy/-/blob/master/binary64/check_sample2.c
> 


More information about the Libc-alpha mailing list