This is the mail archive of the gsl-discuss@sourceware.cygnus.com mailing list for the GSL project.


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

HAVE_HYPOT


As hypot(x,y) is not part of ANSI C we might want to provide a
replacement gsl_hypot that could also be used internally. Something like 

a=fabs(x); b=fabs(y) ; 
if (a > b) { u = b / a ; return a * sqrt(1 + u * u) ; }
else if (b > a) { v = a / b ; return b * sqrt(1 + v * v) ; }
else { return a * sqrt(2.0) ; }

takes care of large arguments. There is probably a nice implementation
in one of the existing libraries.


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