b_exp.c (92887) | b_exp.c (93211) |
---|---|
1/* 2 * Copyright (c) 1985, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 6/4/93"; 36#endif /* not lint */ 37#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1985, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 6/4/93"; 36#endif /* not lint */ 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/msun/bsdsrc/b_exp.c 92887 2002-03-21 18:06:09Z obrien $"); | 38__FBSDID("$FreeBSD: head/lib/msun/bsdsrc/b_exp.c 93211 2002-03-26 11:59:29Z bde $"); |
39 40 41/* EXP(X) 42 * RETURN THE EXPONENTIAL OF X 43 * DOUBLE PRECISION (IEEE 53 bits, VAX D FORMAT 56 BITS) 44 * CODED IN C BY K.C. NG, 1/19/85; 45 * REVISED BY K.C. NG on 2/6/85, 2/15/85, 3/7/85, 3/24/85, 4/16/85, 6/14/86. 46 * --- 65 unchanged lines hidden (view full) --- 112ic(p4, -1.6533902205465251539E-6, -20, -1.BBD41C5D26BF1) 113ic(p5, 4.1381367970572384604E-8, -25, 1.6376972BEA4D0) 114ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) 115ic(ln2lo, 1.9082149292705877000E-10,-33, 1.A39EF35793C76) 116ic(lnhuge, 7.1602103751842355450E2, 9, 1.6602B15B7ECF2) 117ic(lntiny,-7.5137154372698068983E2, 9, -1.77AF8EBEAE354) 118ic(invln2, 1.4426950408889633870E0, 0, 1.71547652B82FE) 119 | 39 40 41/* EXP(X) 42 * RETURN THE EXPONENTIAL OF X 43 * DOUBLE PRECISION (IEEE 53 bits, VAX D FORMAT 56 BITS) 44 * CODED IN C BY K.C. NG, 1/19/85; 45 * REVISED BY K.C. NG on 2/6/85, 2/15/85, 3/7/85, 3/24/85, 4/16/85, 6/14/86. 46 * --- 65 unchanged lines hidden (view full) --- 112ic(p4, -1.6533902205465251539E-6, -20, -1.BBD41C5D26BF1) 113ic(p5, 4.1381367970572384604E-8, -25, 1.6376972BEA4D0) 114ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) 115ic(ln2lo, 1.9082149292705877000E-10,-33, 1.A39EF35793C76) 116ic(lnhuge, 7.1602103751842355450E2, 9, 1.6602B15B7ECF2) 117ic(lntiny,-7.5137154372698068983E2, 9, -1.77AF8EBEAE354) 118ic(invln2, 1.4426950408889633870E0, 0, 1.71547652B82FE) 119 |
120#if 0 |
|
120double exp(x) 121double x; 122{ 123 double z,hi,lo,c; 124 int k; 125 126#if !defined(vax)&&!defined(tahoe) 127 if(x!=x) return(x); /* x is NaN */ --- 26 unchanged lines hidden (view full) --- 154 else return(0.0); 155 } 156 /* end of x < lnhuge */ 157 158 else 159 /* exp(INF) is INF, exp(+big#) overflows to INF */ 160 return( finite(x) ? scalb(1.0,5000) : x); 161} | 121double exp(x) 122double x; 123{ 124 double z,hi,lo,c; 125 int k; 126 127#if !defined(vax)&&!defined(tahoe) 128 if(x!=x) return(x); /* x is NaN */ --- 26 unchanged lines hidden (view full) --- 155 else return(0.0); 156 } 157 /* end of x < lnhuge */ 158 159 else 160 /* exp(INF) is INF, exp(+big#) overflows to INF */ 161 return( finite(x) ? scalb(1.0,5000) : x); 162} |
163#endif |
|
162 163/* returns exp(r = x + c) for |c| < |x| with no overlap. */ 164 165double __exp__D(x, c) 166double x, c; 167{ 168 double z,hi,lo, t; 169 int k; --- 37 unchanged lines hidden --- | 164 165/* returns exp(r = x + c) for |c| < |x| with no overlap. */ 166 167double __exp__D(x, c) 168double x, c; 169{ 170 double z,hi,lo, t; 171 int k; --- 37 unchanged lines hidden --- |