diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-04-11 20:03:22 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-04-11 20:03:22 +0000 |
commit | 3006c130095f6097759a775ce732636429614162 (patch) | |
tree | ba7f53fb3f231af46c17aa266875559b5fcdb4d3 | |
parent | 62bf6a2cbe5adf54f4ab03782e81e08d1ebcb2e9 (diff) |
in the old days compiler could not convert decimal constants
accurately, hence the tricks in libm, using machine representation
of constants. remove kludges and switch to use decimal constants,
much simplifying the code. since, the compiler converts them
accurately. generated values match on vaxfp
discussed with millert@, and miod@
testing todd@, and myself
ok millert@
-rw-r--r-- | lib/libm/noieee_src/mathimpl.h | 56 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_acosh.c | 14 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_asinh.c | 14 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_atan2.c | 81 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_cosh.c | 18 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_exp.c | 46 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_exp__E.c | 25 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_expm1.c | 22 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_floor.c | 10 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_hypot.c | 18 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_log10.c | 10 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_log1p.c | 18 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_log__L.c | 37 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_sinh.c | 19 |
14 files changed, 82 insertions, 306 deletions
diff --git a/lib/libm/noieee_src/mathimpl.h b/lib/libm/noieee_src/mathimpl.h index 315a04d21a1..163843ab186 100644 --- a/lib/libm/noieee_src/mathimpl.h +++ b/lib/libm/noieee_src/mathimpl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mathimpl.h,v 1.9 2009/04/05 02:12:43 martynas Exp $ */ +/* $OpenBSD: mathimpl.h,v 1.10 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: mathimpl.h,v 1.1 1995/10/10 23:36:31 ragge Exp $ */ /* * Copyright (c) 1988, 1993 @@ -31,61 +31,15 @@ * @(#)mathimpl.h 8.1 (Berkeley) 6/4/93 */ -#include <sys/cdefs.h> - -#if defined(__vax__) - -/* Deal with concatenation in cpp */ -# define cat3(a,b,c) a ## b ## c - -/* Deal with vax byte order issues */ -# ifdef __vax__ -# define cat3t(a,b,c) cat3(a,b,c) -# else -# define cat3t(a,b,c) cat3(a,c,b) -# endif - -# define vccast(name) (*(const double *)(cat3(name,,x))) - - /* - * Define a constant to high precision on a Vax or Tahoe. - * - * Args are the name to define, the decimal floating point value, - * four 16-bit chunks of the float value in hex - * (because the vax differ in float format!), the power - * of 2 of the hex-float exponent, and the hex-float mantissa. - * Most of these arguments are not used at compile time; they are - * used in a post-check to make sure the constants were compiled - * correctly. - * - * People who want to use the constant will have to do their own - * #define foo vccast(foo) - * since CPP cannot do this for them from inside another macro (sigh). - * We define "vccast" if this needs doing. - */ -# define vc(name, value, x1,x2,x3,x4, bexp, xval) \ - static const long cat3(name,,x)[] = {cat3t(0x,x1,x2), cat3t(0x,x3,x4)}; - -# define ic(name, value, bexp, xval) ; - -#else /* defined(__vax__) */ - - /* Hooray, we have an IEEE machine */ -# undef vccast -# define vc(name, value, x1,x2,x3,x4, bexp, xval) ; - -# define ic(name, value, bexp, xval) \ - static const double name = value; - -#endif /* defined(__vax__) */ - - /* * Functions internal to the math package, yet not static. */ extern double __exp__E(); extern double __log__L(); -struct Double {double a, b;}; +struct Double { + double a, b; +}; + double __exp__D(double, double); struct Double __log__D(double); diff --git a/lib/libm/noieee_src/n_acosh.c b/lib/libm/noieee_src/n_acosh.c index 347cf1c8a0a..52b1d14a1f2 100644 --- a/lib/libm/noieee_src/n_acosh.c +++ b/lib/libm/noieee_src/n_acosh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_acosh.c,v 1.7 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_acosh.c,v 1.8 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_acosh.c,v 1.1 1995/10/10 23:36:33 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -73,16 +73,8 @@ static char sccsid[] = "@(#)acosh.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10,-33, 1.A39EF35793C76) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#endif +static const double ln2hi = 6.9314718055829871446E-1; +static const double ln2lo = 1.6465949582897081279E-12; double acosh(double x) diff --git a/lib/libm/noieee_src/n_asinh.c b/lib/libm/noieee_src/n_asinh.c index fbd34ffdfed..96adfb9df0b 100644 --- a/lib/libm/noieee_src/n_asinh.c +++ b/lib/libm/noieee_src/n_asinh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_asinh.c,v 1.8 2009/04/05 02:12:43 martynas Exp $ */ +/* $OpenBSD: n_asinh.c,v 1.9 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_asinh.c,v 1.1 1995/10/10 23:36:35 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -69,16 +69,8 @@ static char sccsid[] = "@(#)asinh.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10, -33, 1.A39EF35793C76) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#endif +static const double ln2hi = 6.9314718055829871446E-1; +static const double ln2lo = 1.6465949582897081279E-12; double asinh(double x) diff --git a/lib/libm/noieee_src/n_atan2.c b/lib/libm/noieee_src/n_atan2.c index ee03b0af254..201814f4b97 100644 --- a/lib/libm/noieee_src/n_atan2.c +++ b/lib/libm/noieee_src/n_atan2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_atan2.c,v 1.11 2008/12/10 01:08:24 martynas Exp $ */ +/* $OpenBSD: n_atan2.c,v 1.12 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_atan2.c,v 1.1 1995/10/10 23:36:37 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -112,66 +112,25 @@ static char sccsid[] = "@(#)atan2.c 8.1 (Berkeley) 6/4/93"; #include "mathimpl.h" -vc(athfhi, 4.6364760900080611433E-1 ,6338,3fed,da7b,2b0d, -1, .ED63382B0DDA7B) -vc(athflo, 1.9338828231967579916E-19 ,5005,2164,92c0,9cfe, -62, .E450059CFE92C0) -vc(PIo4, 7.8539816339744830676E-1 ,0fda,4049,68c2,a221, 0, .C90FDAA22168C2) -vc(at1fhi, 9.8279372324732906796E-1 ,985e,407b,b4d9,940f, 0, .FB985E940FB4D9) -vc(at1flo,-3.5540295636764633916E-18 ,1edc,a383,eaea,34d6, -57,-.831EDC34D6EAEA) -vc(PIo2, 1.5707963267948966135E0 ,0fda,40c9,68c2,a221, 1, .C90FDAA22168C2) -vc(PI, 3.1415926535897932270E0 ,0fda,4149,68c2,a221, 2, .C90FDAA22168C2) -vc(a1, 3.3333333333333473730E-1 ,aaaa,3faa,ab75,aaaa, -1, .AAAAAAAAAAAB75) -vc(a2, -2.0000000000017730678E-1 ,cccc,bf4c,946e,cccd, -2,-.CCCCCCCCCD946E) -vc(a3, 1.4285714286694640301E-1 ,4924,3f12,4262,9274, -2, .92492492744262) -vc(a4, -1.1111111135032672795E-1 ,8e38,bee3,6292,ebc6, -3,-.E38E38EBC66292) -vc(a5, 9.0909091380563043783E-2 ,2e8b,3eba,d70c,b31b, -3, .BA2E8BB31BD70C) -vc(a6, -7.6922954286089459397E-2 ,89c8,be9d,7f18,27c3, -3,-.9D89C827C37F18) -vc(a7, 6.6663180891693915586E-2 ,86b4,3e88,9e58,ae37, -3, .8886B4AE379E58) -vc(a8, -5.8772703698290408927E-2 ,bba5,be70,a942,8481, -4,-.F0BBA58481A942) -vc(a9, 5.2170707402812969804E-2 ,b0f3,3e55,13ab,a1ab, -4, .D5B0F3A1AB13AB) -vc(a10, -4.4895863157820361210E-2 ,e4b9,be37,048f,7fd1, -4,-.B7E4B97FD1048F) -vc(a11, 3.3006147437343875094E-2 ,3174,3e07,2d87,3cf7, -4, .8731743CF72D87) -vc(a12, -1.4614844866464185439E-2 ,731a,bd6f,76d9,2f34, -6,-.EF731A2F3476D9) - -ic(athfhi, 4.6364760900080609352E-1 , -2, 1.DAC670561BB4F) -ic(athflo, 4.6249969567426939759E-18 , -58, 1.5543B8F253271) -ic(PIo4, 7.8539816339744827900E-1 , -1, 1.921FB54442D18) -ic(at1fhi, 9.8279372324732905408E-1 , -1, 1.F730BD281F69B) -ic(at1flo,-2.4407677060164810007E-17 , -56, -1.C23DFEFEAE6B5) -ic(PIo2, 1.5707963267948965580E0 , 0, 1.921FB54442D18) -ic(PI, 3.1415926535897931160E0 , 1, 1.921FB54442D18) -ic(a1, 3.3333333333333942106E-1 , -2, 1.55555555555C3) -ic(a2, -1.9999999999979536924E-1 , -3, -1.9999999997CCD) -ic(a3, 1.4285714278004377209E-1 , -3, 1.24924921EC1D7) -ic(a4, -1.1111110579344973814E-1 , -4, -1.C71C7059AF280) -ic(a5, 9.0908906105474668324E-2 , -4, 1.745CE5AA35DB2) -ic(a6, -7.6919217767468239799E-2 , -4, -1.3B0FA54BEC400) -ic(a7, 6.6614695906082474486E-2 , -4, 1.10DA924597FFF) -ic(a8, -5.8358371008508623523E-2 , -5, -1.DE125FDDBD793) -ic(a9, 4.9850617156082015213E-2 , -5, 1.9860524BDD807) -ic(a10, -3.6700606902093604877E-2 , -5, -1.2CA6C04C6937A) -ic(a11, 1.6438029044759730479E-2 , -6, 1.0D52174A1BB54) - -#ifdef vccast -#define athfhi vccast(athfhi) -#define athflo vccast(athflo) -#define PIo4 vccast(PIo4) -#define at1fhi vccast(at1fhi) -#define at1flo vccast(at1flo) -#define PIo2 vccast(PIo2) -#define PI vccast(PI) -#define a1 vccast(a1) -#define a2 vccast(a2) -#define a3 vccast(a3) -#define a4 vccast(a4) -#define a5 vccast(a5) -#define a6 vccast(a6) -#define a7 vccast(a7) -#define a8 vccast(a8) -#define a9 vccast(a9) -#define a10 vccast(a10) -#define a11 vccast(a11) -#define a12 vccast(a12) -#endif +static const double athfhi = 4.6364760900080611433E-1; +static const double athflo = 1.9338828231967579916E-19; +static const double PIo4 = 7.8539816339744830676E-1; +static const double at1fhi = 9.8279372324732906796E-1; +static const double at1flo = -3.5540295636764633916E-18; +static const double PIo2 = 1.5707963267948966135E0; +static const double PI = 3.1415926535897932270E0; +static const double a1 = 3.3333333333333473730E-1; +static const double a2 = -2.0000000000017730678E-1; +static const double a3 = 1.4285714286694640301E-1; +static const double a4 = -1.1111111135032672795E-1; +static const double a5 = 9.0909091380563043783E-2; +static const double a6 = -7.6922954286089459397E-2; +static const double a7 = 6.6663180891693915586E-2; +static const double a8 = -5.8772703698290408927E-2; +static const double a9 = 5.2170707402812969804E-2; +static const double a10 = -4.4895863157820361210E-2; +static const double a11 = 3.3006147437343875094E-2; +static const double a12 = -1.4614844866464185439E-2; double atan2(double y, double x) diff --git a/lib/libm/noieee_src/n_cosh.c b/lib/libm/noieee_src/n_cosh.c index c42daa1ac33..795c9c6e4bc 100644 --- a/lib/libm/noieee_src/n_cosh.c +++ b/lib/libm/noieee_src/n_cosh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_cosh.c,v 1.8 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_cosh.c,v 1.9 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_cosh.c,v 1.1 1995/10/10 23:36:42 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -83,19 +83,9 @@ static char sccsid[] = "@(#)cosh.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) -vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) -vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) - -ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) -ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) -ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) - -#ifdef vccast -#define mln2hi vccast(mln2hi) -#define mln2lo vccast(mln2lo) -#define lnovfl vccast(lnovfl) -#endif +static const double mln2hi = 8.8029691931113054792E1; +static const double mln2lo = -4.9650192275318476525E-16; +static const double lnovfl = 8.8029691931113053016E1; #if defined(__vax__) static max = 126 ; diff --git a/lib/libm/noieee_src/n_exp.c b/lib/libm/noieee_src/n_exp.c index 682522ad771..0f12ca47ade 100644 --- a/lib/libm/noieee_src/n_exp.c +++ b/lib/libm/noieee_src/n_exp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_exp.c,v 1.8 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_exp.c,v 1.9 2009/04/11 20:03:21 martynas Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -77,40 +77,16 @@ static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) -vc(lnhuge, 9.4961163736712506989E1 ,ec1d,43bd,9010,a73e, 7, .BDEC1DA73E9010) -vc(lntiny,-9.5654310917272452386E1 ,4f01,c3bf,33af,d72e, 7,-.BF4F01D72E33AF) -vc(invln2, 1.4426950408889634148E0 ,aa3b,40b8,17f1,295c, 1, .B8AA3B295C17F1) -vc(p1, 1.6666666666666602251E-1 ,aaaa,3f2a,a9f1,aaaa, -2, .AAAAAAAAAAA9F1) -vc(p2, -2.7777777777015591216E-3 ,0b60,bc36,ec94,b5f5, -8,-.B60B60B5F5EC94) -vc(p3, 6.6137563214379341918E-5 ,b355,398a,f15f,792e, -13, .8AB355792EF15F) -vc(p4, -1.6533902205465250480E-6 ,ea0e,b6dd,5f84,2e93, -19,-.DDEA0E2E935F84) -vc(p5, 4.1381367970572387085E-8 ,bb4b,3431,2683,95f5, -24, .B1BB4B95F52683) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#define lnhuge vccast(lnhuge) -#define lntiny vccast(lntiny) -#define invln2 vccast(invln2) -#define p1 vccast(p1) -#define p2 vccast(p2) -#define p3 vccast(p3) -#define p4 vccast(p4) -#define p5 vccast(p5) -#endif - -ic(p1, 1.6666666666666601904E-1, -3, 1.555555555553E) -ic(p2, -2.7777777777015593384E-3, -9, -1.6C16C16BEBD93) -ic(p3, 6.6137563214379343612E-5, -14, 1.1566AAF25DE2C) -ic(p4, -1.6533902205465251539E-6, -20, -1.BBD41C5D26BF1) -ic(p5, 4.1381367970572384604E-8, -25, 1.6376972BEA4D0) -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10,-33, 1.A39EF35793C76) -ic(lnhuge, 7.1602103751842355450E2, 9, 1.6602B15B7ECF2) -ic(lntiny,-7.5137154372698068983E2, 9, -1.77AF8EBEAE354) -ic(invln2, 1.4426950408889633870E0, 0, 1.71547652B82FE) +static const double ln2hi = 6.9314718055829871446E-1; +static const double ln2lo = 1.6465949582897081279E-12; +static const double lnhuge = 9.4961163736712506989E1; +static const double lntiny = -9.5654310917272452386E1; +static const double invln2 = 1.4426950408889634148E0; +static const double p1 = 1.6666666666666602251E-1; +static const double p2 = -2.7777777777015591216E-3; +static const double p3 = 6.6137563214379341918E-5; +static const double p4 = -1.6533902205465250480E-6; +static const double p5 = 4.1381367970572387085E-8; double exp(double x) diff --git a/lib/libm/noieee_src/n_exp__E.c b/lib/libm/noieee_src/n_exp__E.c index cc70306373e..bb064cc8b0a 100644 --- a/lib/libm/noieee_src/n_exp__E.c +++ b/lib/libm/noieee_src/n_exp__E.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_exp__E.c,v 1.10 2009/04/05 02:12:43 martynas Exp $ */ +/* $OpenBSD: n_exp__E.c,v 1.11 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_exp__E.c,v 1.1 1995/10/10 23:36:45 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -87,24 +87,11 @@ static char sccsid[] = "@(#)exp__E.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(p1, 1.5150724356786683059E-2 ,3abe,3d78,066a,67e1, -6, .F83ABE67E1066A) -vc(p2, 6.3112487873718332688E-5 ,5b42,3984,0173,48cd, -13, .845B4248CD0173) -vc(q1, 1.1363478204690669916E-1 ,b95a,3ee8,ec45,44a2, -3, .E8B95A44A2EC45) -vc(q2, 1.2624568129896839182E-3 ,7905,3ba5,f5e7,72e4, -9, .A5790572E4F5E7) -vc(q3, 1.5021856115869022674E-6 ,9eb4,36c9,c395,604a, -19, .C99EB4604AC395) - -ic(p1, 1.3887401997267371720E-2, -7, 1.C70FF8B3CC2CF) -ic(p2, 3.3044019718331897649E-5, -15, 1.15317DF4526C4) -ic(q1, 1.1110813732786649355E-1, -4, 1.C719538248597) -ic(q2, 9.9176615021572857300E-4, -10, 1.03FC4CB8C98E8) - -#ifdef vccast -#define p1 vccast(p1) -#define p2 vccast(p2) -#define q1 vccast(q1) -#define q2 vccast(q2) -#define q3 vccast(q3) -#endif +static const double p1 = 1.5150724356786683059E-2; +static const double p2 = 6.3112487873718332688E-5; +static const double q1 = 1.1363478204690669916E-1; +static const double q2 = 1.2624568129896839182E-3; +static const double q3 = 1.5021856115869022674E-6; double __exp__E(double x, double c) diff --git a/lib/libm/noieee_src/n_expm1.c b/lib/libm/noieee_src/n_expm1.c index 070f84db3ea..2d555686417 100644 --- a/lib/libm/noieee_src/n_expm1.c +++ b/lib/libm/noieee_src/n_expm1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_expm1.c,v 1.10 2009/04/05 02:12:43 martynas Exp $ */ +/* $OpenBSD: n_expm1.c,v 1.11 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_expm1.c,v 1.1 1995/10/10 23:36:46 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -87,22 +87,10 @@ static char sccsid[] = "@(#)expm1.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) -vc(lnhuge, 9.4961163736712506989E1 ,ec1d,43bd,9010,a73e, 7, .BDEC1DA73E9010) -vc(invln2, 1.4426950408889634148E0 ,aa3b,40b8,17f1,295c, 1, .B8AA3B295C17F1) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10, -33, 1.A39EF35793C76) -ic(lnhuge, 7.1602103751842355450E2, 9, 1.6602B15B7ECF2) -ic(invln2, 1.4426950408889633870E0, 0, 1.71547652B82FE) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#define lnhuge vccast(lnhuge) -#define invln2 vccast(invln2) -#endif +static const double ln2hi = 6.9314718055829871446E-1; +static const double ln2lo = 1.6465949582897081279E-12; +static const double lnhuge = 9.4961163736712506989E1; +static const double invln2 = 1.4426950408889634148E0; double expm1(double x) diff --git a/lib/libm/noieee_src/n_floor.c b/lib/libm/noieee_src/n_floor.c index 21a7444f392..050cfd4944b 100644 --- a/lib/libm/noieee_src/n_floor.c +++ b/lib/libm/noieee_src/n_floor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_floor.c,v 1.11 2009/04/08 21:58:28 martynas Exp $ */ +/* $OpenBSD: n_floor.c,v 1.12 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_floor.c,v 1.1 1995/10/10 23:36:48 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -38,13 +38,7 @@ static char sccsid[] = "@(#)floor.c 8.1 (Berkeley) 6/4/93"; #include "mathimpl.h" -vc(L, 36028797018963968.0E0 ,0000,5c00,0000,0000, 55, 1.0) /* 2**55 */ - -ic(L, 4503599627370496.0E0, 52, 1.0) /* 2**52 */ - -#ifdef vccast -#define L vccast(L) -#endif +static const double L = 36028797018963968.0E0; /* * floor(x) := the largest integer no larger than x; diff --git a/lib/libm/noieee_src/n_hypot.c b/lib/libm/noieee_src/n_hypot.c index 4f613607400..c985d943aa5 100644 --- a/lib/libm/noieee_src/n_hypot.c +++ b/lib/libm/noieee_src/n_hypot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_hypot.c,v 1.1 2008/10/07 22:25:53 martynas Exp $ */ +/* $OpenBSD: n_hypot.c,v 1.2 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_cabs.c,v 1.1 1995/10/10 23:36:39 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -89,19 +89,9 @@ static char sccsid[] = "@(#)cabs.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(r2p1hi, 2.4142135623730950345E0 ,8279,411a,ef32,99fc, 2, .9A827999FCEF32) -vc(r2p1lo, 1.4349369327986523769E-17 ,597d,2484,754b,89b3, -55, .84597D89B3754B) -vc(sqrt2, 1.4142135623730950622E0 ,04f3,40b5,de65,33f9, 1, .B504F333F9DE65) - -ic(r2p1hi, 2.4142135623730949234E0 , 1, 1.3504F333F9DE6) -ic(r2p1lo, 1.2537167179050217666E-16 , -53, 1.21165F626CDD5) -ic(sqrt2, 1.4142135623730951455E0 , 0, 1.6A09E667F3BCD) - -#ifdef vccast -#define r2p1hi vccast(r2p1hi) -#define r2p1lo vccast(r2p1lo) -#define sqrt2 vccast(sqrt2) -#endif +static const double r2p1hi = 2.4142135623730950345E0; +static const double r2p1lo = 1.4349369327986523769E-17; +static const double sqrt2 = 1.4142135623730950622E0; double hypot(double x, double y) diff --git a/lib/libm/noieee_src/n_log10.c b/lib/libm/noieee_src/n_log10.c index e1c0e970bbc..85b16f9e8cb 100644 --- a/lib/libm/noieee_src/n_log10.c +++ b/lib/libm/noieee_src/n_log10.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_log10.c,v 1.6 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_log10.c,v 1.7 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_log10.c,v 1.1 1995/10/10 23:36:58 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -74,13 +74,7 @@ static char sccsid[] = "@(#)log10.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln10hi, 2.3025850929940456790E0 ,5d8d,4113,a8ac,ddaa, 2, .935D8DDDAAA8AC) - -ic(ivln10, 4.3429448190325181667E-1, -2, 1.BCB7B1526E50E) - -#ifdef vccast -#define ln10hi vccast(ln10hi) -#endif +static const double ln10hi = 2.3025850929940456790E0; double log10(double x) diff --git a/lib/libm/noieee_src/n_log1p.c b/lib/libm/noieee_src/n_log1p.c index 5dfedcc5015..ba69e4084d6 100644 --- a/lib/libm/noieee_src/n_log1p.c +++ b/lib/libm/noieee_src/n_log1p.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_log1p.c,v 1.9 2009/04/05 02:12:43 martynas Exp $ */ +/* $OpenBSD: n_log1p.c,v 1.10 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_log1p.c,v 1.1 1995/10/10 23:37:00 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -96,19 +96,9 @@ static char sccsid[] = "@(#)log1p.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) -vc(sqrt2, 1.4142135623730950622E0 ,04f3,40b5,de65,33f9, 1, .B504F333F9DE65) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10, -33, 1.A39EF35793C76) -ic(sqrt2, 1.4142135623730951455E0, 0, 1.6A09E667F3BCD) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#define sqrt2 vccast(sqrt2) -#endif +static const double ln2hi = 6.9314718055829871446E-1; +static const double ln2lo = 1.6465949582897081279E-12; +static const double sqrt2 = 1.4142135623730950622E0; double log1p(double x) diff --git a/lib/libm/noieee_src/n_log__L.c b/lib/libm/noieee_src/n_log__L.c index c28a0268dbc..711f0cff0eb 100644 --- a/lib/libm/noieee_src/n_log__L.c +++ b/lib/libm/noieee_src/n_log__L.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_log__L.c,v 1.7 2008/07/22 19:58:40 martynas Exp $ */ +/* $OpenBSD: n_log__L.c,v 1.8 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_log__L.c,v 1.1 1995/10/10 23:37:01 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -70,33 +70,14 @@ static char sccsid[] = "@(#)log__L.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(L1, 6.6666666666666703212E-1 ,aaaa,402a,aac5,aaaa, 0, .AAAAAAAAAAAAC5) -vc(L2, 3.9999999999970461961E-1 ,cccc,3fcc,2684,cccc, -1, .CCCCCCCCCC2684) -vc(L3, 2.8571428579395698188E-1 ,4924,3f92,5782,92f8, -1, .92492492F85782) -vc(L4, 2.2222221233634724402E-1 ,8e38,3f63,af2c,39b7, -2, .E38E3839B7AF2C) -vc(L5, 1.8181879517064680057E-1 ,2eb4,3f3a,655e,cc39, -2, .BA2EB4CC39655E) -vc(L6, 1.5382888777946145467E-1 ,8551,3f1d,781d,e8c5, -2, .9D8551E8C5781D) -vc(L7, 1.3338356561139403517E-1 ,95b3,3f08,cd92,907f, -2, .8895B3907FCD92) -vc(L8, 1.2500000000000000000E-1 ,0000,3f00,0000,0000, -2, .80000000000000) - -ic(L1, 6.6666666666667340202E-1, -1, 1.5555555555592) -ic(L2, 3.9999999999416702146E-1, -2, 1.999999997FF24) -ic(L3, 2.8571428742008753154E-1, -2, 1.24924941E07B4) -ic(L4, 2.2222198607186277597E-1, -3, 1.C71C52150BEA6) -ic(L5, 1.8183562745289935658E-1, -3, 1.74663CC94342F) -ic(L6, 1.5314087275331442206E-1, -3, 1.39A1EC014045B) -ic(L7, 1.4795612545334174692E-1, -3, 1.2F039F0085122) - -#ifdef vccast -#define L1 vccast(L1) -#define L2 vccast(L2) -#define L3 vccast(L3) -#define L4 vccast(L4) -#define L5 vccast(L5) -#define L6 vccast(L6) -#define L7 vccast(L7) -#define L8 vccast(L8) -#endif +static const double L1 = 6.6666666666666703212E-1; +static const double L2 = 3.9999999999970461961E-1; +static const double L3 = 2.8571428579395698188E-1; +static const double L4 = 2.2222221233634724402E-1; +static const double L5 = 1.8181879517064680057E-1; +static const double L6 = 1.5382888777946145467E-1; +static const double L7 = 1.3338356561139403517E-1; +static const double L8 = 1.2500000000000000000E-1; double __log__L(double z) diff --git a/lib/libm/noieee_src/n_sinh.c b/lib/libm/noieee_src/n_sinh.c index ade1f633e39..fd57c726f60 100644 --- a/lib/libm/noieee_src/n_sinh.c +++ b/lib/libm/noieee_src/n_sinh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_sinh.c,v 1.8 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_sinh.c,v 1.9 2009/04/11 20:03:21 martynas Exp $ */ /* $NetBSD: n_sinh.c,v 1.1 1995/10/10 23:37:05 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -76,19 +76,9 @@ static char sccsid[] = "@(#)sinh.c 8.1 (Berkeley) 6/4/93"; #include "math.h" #include "mathimpl.h" -vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) -vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) -vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) - -ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) -ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) -ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) - -#ifdef vccast -#define mln2hi vccast(mln2hi) -#define mln2lo vccast(mln2lo) -#define lnovfl vccast(lnovfl) -#endif +static const double mln2hi = 8.8029691931113054792E1; +static const double mln2lo = -4.9650192275318476525E-16; +static const double lnovfl = 8.8029691931113053016E1; #if defined(__vax__) static max = 126 ; @@ -96,7 +86,6 @@ static max = 126 ; static max = 1023 ; #endif /* defined(__vax__) */ - double sinh(double x) { |