Complex Division Patch (reprise)
Stephen L Moshier
moshier@mediaone.net
Mon Apr 26 06:00:00 GMT 1999
> With that change I believe this patch is probably OK
> for inclusion in egcs-1.2.
Please do not use the -ffast-math switch in this change. Following is
the relevant excerpt from C9X. The name of the switch in C9X is
"CX_LIMITED_RANGE on-off-switch." It should not be mixed up with what
fast-math does. In addition to violating IEEE, the fast-math switch
enables inaccurate trigonometry functions and it performs
transformations that can change the value of an expression.
The source code for some diagnostic tests that show the errors caused
by fast-math can be obtained from this location:
http://www.netlib.org/cephes/c9x-complex.shar
7.3.4 The CX_LIMITED_RANGE pragma
Synopsis
[#1]
#include <complex.h>
#pragma STDC CX_LIMITED_RANGE on-off-switch
Description
[#2] The usual mathematical formula for complex multiply, |
divide, and absolute value are problematic because of their |
treatment of infinities and because of undue overflow and
underflow. The CX_LIMITED_RANGE pragma can be used to
inform the implementation that (where the state is on) the |
usual mathematical formulas are acceptable.151) The pragma
can occur either outside external declarations or preceding
all explicit declarations and statements inside a compound
statement. When outside external declarations, the pragma
takes effect from its occurrence until another
CX_LIMITED_RANGE pragma is encountered, or until the end of
the translation unit. When inside a compound statement, the
pragma takes effect from its occurrence until another
CX_LIMITED_RANGE pragma is encountered (within a nested
compound statement), or until the end of the compound
statement; at the end of a compound statement the state for
the pragma is restored to its condition just before the
compound statement. If this pragma is used in any other
context, the behavior is undefined. The default state for
the pragma is off.
More information about the Gcc-patches
mailing list