This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Complex Division Patch (reprise)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]