This is the mail archive of the
mailing list for the GCC project.
Re: Change definition of complex::norm
- To: Brad Lucier <lucier at math dot purdue dot edu>
- Subject: Re: Change definition of complex::norm
- From: HJSTEIN at bloomberg dot com (Harvey J. Stein)
- Date: 01 Nov 2001 14:39:13 -0500
- Cc: gdr at codesourcery dot com (Gabriel Dos Reis), gcc at gcc dot gnu dot org, nbecker at fred dot net, bkoz at redhat dot com
- References: <200111011924.fA1JOPO19214@banach.math.purdue.edu>
Brad Lucier <email@example.com> writes:
> Sorry, I forgot that the exponent range is not symmetric, the formula I
> gave for the absolute error tolerance is incorrect. The smallest
> nonzero denormal in double precision IEEE is 4.940656e-324. And in the
> example I gave, the answer in exact arithmetic is exactly halfway between
> 4.940656e-324 and 0.0, so there is little to choose between them.
But, when using (1.5e-162, 1.5e-162) as Z instead of
(sqrt(4.94e-324)/2,sqrt(4.94e-324)/2), the abs()^2 code still returns
4.94e-324, and the x^2+y^2 code still returns 0, but now the abs()^2
code is closer. BTW, a normalized abs()^2 version also returns
4.94e-324, so maybe that's preferrable.