Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

eis_pythag.c

Go to the documentation of this file.
00001 /* pythag.f -- translated by f2c (version 19961017).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 
00008 doublereal pythag_(doublereal *a, doublereal *b)
00009 {
00010     /* System generated locals */
00011     doublereal ret_val, d__1, d__2, d__3;
00012 
00013     /* Local variables */
00014     static doublereal p, r__, s, t, u;
00015 
00016 
00017 /*     FINDS DSQRT(A**2+B**2) WITHOUT OVERFLOW OR DESTRUCTIVE UNDERFLOW */
00018 
00019 /* Computing MAX */
00020     d__1 = abs(*a), d__2 = abs(*b);
00021     p = max(d__1,d__2);
00022     if (p == 0.) {
00023         goto L20;
00024     }
00025 /* Computing MIN */
00026     d__2 = abs(*a), d__3 = abs(*b);
00027 /* Computing 2nd power */
00028     d__1 = min(d__2,d__3) / p;
00029     r__ = d__1 * d__1;
00030 L10:
00031     t = r__ + 4.;
00032     if (t == 4.) {
00033         goto L20;
00034     }
00035     s = r__ / t;
00036     u = s * 2. + 1.;
00037     p = u * p;
00038 /* Computing 2nd power */
00039     d__1 = s / u;
00040     r__ = d__1 * d__1 * r__;
00041     goto L10;
00042 L20:
00043     ret_val = p;
00044     return ret_val;
00045 } /* pythag_ */
00046 
 

Powered by Plone

This site conforms to the following standards: