(j3.2006) J3/09-292 - J3 Fortran interp letter ballot #19 - due19-Oct-2009

Van Snyder Van.Snyder
Mon Oct 19 18:29:10 EDT 2009

On Mon, 2009-10-19 at 14:36 -0700, Bill Long wrote:
> I believe that HYPOT was added as part of the "lets support C's libm 
> functions".

I couldn't figure out why it was important to provide support, sometimes
in the form of syntactic sugar, for everything in libm.

> The added feature of HYPOT is the suppression of typical 
> optimizations so as to avoid overflow or underflow.  I suspect few
> will use it, but those who do really want this behavior.

I don't know what "suppression of optimizations" has to do with "without
undue overflow or underflow."

This behavior is required for ABS [327:19-20] and HYPOT [353:26] but
only recommended for NORM2 [377:1].  It is a bit harder to avoid
overflow or underflow in the general case for NORM2, but if the Blue
(for Jim Blue, not the color Blue) algorithm is used (i.e., the one in
the reference level-1 BLAS), no overflow occurs in the computation of
the 2 norm of a 2-vector, and underflow occurs only in computing
(MIN(A,B)/MAX(A,B))**2, which would disappear much earlier than
underflow when it's added to 1.0.

So those who really want this behavior can get it from ABS or NORM2.

Van Snyder                    |  What fraction of Americans believe 
Van.Snyder at jpl.nasa.gov       |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.

More information about the J3 mailing list