[Patch,Fortran] PR 33197 Add NORM2 and PARITY
Toon Moene
toon@moene.org
Thu Aug 26 18:07:00 GMT 2010
Tobias Schlüter wrote:
> On 2010-08-26 15:39, Tobias Burnus wrote:
>
>> For norm2 (L2 norm), one essentially does:
>> tmp = max(array) ! = L_infinity norm
>> norm2 = tmp * sqrt( (array/tmp)**2)
>> to avoid an overflow.
> Just a random idea: the maximum precision that such a single pass
> algorithm can achieve is probably obtained by using and modifying the
> binary exponent instead of multiplying with a scale factor as this
> renders the scale transformations exact.
That's what people told me to do for quick complex divide in the '90s -
however, at that time there were multiple supported floating point
formats, so it was not *that* simple.
If IEEE-754 format is the only one supported now, that might be doable.
Cheers,
--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran
More information about the Fortran
mailing list