[Cfp-interest 3268] Re: Specification of complex operators

Damian McGuckin damianm at esi.com.au
Wed Sep 11 22:36:11 PDT 2024


On Mon, 9 Sep 2024, Paul Zimmermann wrote:

> with Paul Caprioli, Vincenzo Innocente and John Mather, we are currently 
> testing the accuracy of complex operators and functions in the current 
> compilers and math libraries.
>
> Avoidance of intermediate overflows is not so easy. For cmulf all 3 compilers gcc, icx and
> clang give the wrong result for the following example (x1, y1, x2, y2):
>
>    {-0x1.80a55ep+0,-0x1.1bfep+80,0x1.ap+64,-0x1.54c296p+127}, /* gcc Inf */
>    {-0x1.80a55ep+0,-0x1.1bfep+80,0x1.ap+64,-0x1.54c296p+127}, /* icx Inf */
>    {-0x1.80a55ep+0,-0x1.1bfep+80,0x1.ap+64,-0x1.54c296p+127}, /* clang Inf */

Shouldn't these yield a number whose real and imaginary components are 
both an infinity?

My quick C version yields a real component which is infinity but an 
imaginary component which is a NaN.

Thanks - Damian


More information about the Cfp-interest mailing list