[rfc] enable non-trivial complex division
Erik Schnetter
schnetter@aei.mpg.de
Sat Feb 19 20:29:00 GMT 2005
On Saturday 19 February 2005 21:11, Joseph S. Myers wrote:
> If we are to have three different implementations then long-term I
> think they should be (a) trivial, (b) logarithmic reduction to avoid
> undue overflow for both multiplication and division, (c) (b) plus
> special nan and infinity handling. With -fcx-limited-range being a
> language-independent switch to change from (b) to (a). We don't have
> (b) at present, though flag_complex_method == 1 substitutes for it.
> That suggests for now having -fcx-limited-range as a
> language-independent flag, included in -ffast-math for all languages,
> which switches from the default of 1 (2 for C99) to 0 (and
> -ffast-math -fno-cx-limited-range keeping the default of 1 or 2) with
> C99 only changing the default from 1 to 2; and in future adding
> logarithmic reduction for both 1 and 2.
What is logarithmic reduction?
There is a way of avoiding overflow by factoring out the maximum or sum
of the absolute values of a and b in a complex number a+ib. This is
done e.g. in the complex absolute value function. Wouldn't the same be
both sufficient and efficient for complex division as well? Or is this
what you mean by logarithmic reduction?
-erik
--
Erik Schnetter <schnetter@aei.mpg.de> http://www.aei.mpg.de/~eschnett/
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050219/3b724f94/attachment.sig>
More information about the Fortran
mailing list