e_exp.c (8870) | e_exp.c (17141) |
---|---|
1/* @(#)e_exp.c 5.1 93/09/24 */ 2/* 3 * ==================================================== 4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 * 6 * Developed at SunPro, a Sun Microsystems, Inc. business. 7 * Permission to use, copy, modify, and distribute this 8 * software is freely granted, provided that this notice 9 * is preserved. 10 * ==================================================== 11 */ 12 13#ifndef lint | 1/* @(#)e_exp.c 5.1 93/09/24 */ 2/* 3 * ==================================================== 4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 5 * 6 * Developed at SunPro, a Sun Microsystems, Inc. business. 7 * Permission to use, copy, modify, and distribute this 8 * software is freely granted, provided that this notice 9 * is preserved. 10 * ==================================================== 11 */ 12 13#ifndef lint |
14static char rcsid[] = "$Id: e_exp.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; | 14static char rcsid[] = "$Id: e_exp.c,v 1.2 1995/05/30 05:48:08 rgrimes Exp $"; |
15#endif 16 17/* __ieee754_exp(x) 18 * Returns the exponential of x. 19 * 20 * Method 21 * 1. Argument reduction: 22 * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658. --- 82 unchanged lines hidden (view full) --- 105 106#ifdef __STDC__ 107 double __ieee754_exp(double x) /* default IEEE double exp */ 108#else 109 double __ieee754_exp(x) /* default IEEE double exp */ 110 double x; 111#endif 112{ | 15#endif 16 17/* __ieee754_exp(x) 18 * Returns the exponential of x. 19 * 20 * Method 21 * 1. Argument reduction: 22 * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658. --- 82 unchanged lines hidden (view full) --- 105 106#ifdef __STDC__ 107 double __ieee754_exp(double x) /* default IEEE double exp */ 108#else 109 double __ieee754_exp(x) /* default IEEE double exp */ 110 double x; 111#endif 112{ |
113 double y,hi,lo,c,t; 114 int32_t k,xsb; | 113 double y,hi=0.0,lo=0.0,c,t; 114 int32_t k=0,xsb; |
115 u_int32_t hx; 116 117 GET_HIGH_WORD(hx,x); 118 xsb = (hx>>31)&1; /* sign bit of x */ 119 hx &= 0x7fffffff; /* high word of |x| */ 120 121 /* filter out non-finite argument */ 122 if(hx >= 0x40862E42) { /* if |x|>=709.78... */ --- 45 unchanged lines hidden --- | 115 u_int32_t hx; 116 117 GET_HIGH_WORD(hx,x); 118 xsb = (hx>>31)&1; /* sign bit of x */ 119 hx &= 0x7fffffff; /* high word of |x| */ 120 121 /* filter out non-finite argument */ 122 if(hx >= 0x40862E42) { /* if |x|>=709.78... */ --- 45 unchanged lines hidden --- |