This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Complex Division Patch (reprise)
- To: toon at moene dot indiv dot nluug dot nl, moshier at mediaone dot net, egcs-patches at egcs dot cygnus dot com
- Subject: Re: Complex Division Patch (reprise)
- From: N8TM at aol dot com
- Date: Sun, 2 May 1999 22:43:31 EDT
In a message dated 5/2/99 12:01:41 PM Pacific Daylight Time,
toon@moene.indiv.nluug.nl writes:
> Scaling with
> > the scalbn function, instead of with division, provides
> > better roundoff characteristics.
>
> Sure, you win on average 1/4 ULP by using scaling for which the result
> is representable (the result of d/c or c/d is not representable
> necessarily, which would cost you at most 1/2 ULP, assuming exact
> floating point arithmetic).
>
FWIW, it should be possible to obtain the same effect as with scalbn, by
choosing 1 of 3 scale factors, e.g. FLT_MIN, 1.f, 1.f/FLT_MIN so that the
intermediate results don't over/underflow. I think this is faster than
scalbn when there isn't appropriate hardware support.
The constants in <float.h> ought to tell when promoting to a wider precision
gives the wider range sufficient to avoid the intermediate over/underflow
without taking any additional precautions. If there were any double extended
or quad precision functions in libf2c, those would never have this
possibility.