summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2011-07-08 16:49:06 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2011-07-08 16:49:06 +0000
commit0d2d5282eb28b36229596cae847707a8077fe021 (patch)
treed95db21e998536320fc9f3987f82939b99bad96e
parent7f37445faa11a385460bbba0b8c31e3fcdde175d (diff)
Add 80-bit and 128-bit precision test vectors for the math functions.
No problems found by Cephes in 17022 tests.
-rw-r--r--regress/lib/libm/cephes/monotl.c26
-rw-r--r--regress/lib/libm/cephes/monotll.c20
-rw-r--r--regress/lib/libm/cephes/testvectl.c34
-rw-r--r--regress/lib/libm/cephes/testvectll.c35
4 files changed, 36 insertions, 79 deletions
diff --git a/regress/lib/libm/cephes/monotl.c b/regress/lib/libm/cephes/monotl.c
index ea190904313..d1ba7c40afd 100644
--- a/regress/lib/libm/cephes/monotl.c
+++ b/regress/lib/libm/cephes/monotl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monotl.c,v 1.1 2011/05/30 20:23:35 martynas Exp $ */
+/* $OpenBSD: monotl.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -65,16 +65,8 @@ long double tanhl (long double);
long double asinhl (long double);
long double acoshl (long double);
long double atanhl (long double);
-#if 1
-long double lgaml (long double);
-long double gammal (long double);
-#define lgammal lgaml
-#else
long double lgammal (long double);
long double tgammal (long double);
-#define lgammal lgaml
-#define gammal tgammal
-#endif
long double fabsl (long double);
long double floorl (long double);
long double j0l (long double);
@@ -101,7 +93,6 @@ struct oneargument
static struct oneargument test1[] =
{
-#if 0
{"exp", expl, 1.0L, 2.7182769775390625L,
4.85091998273536028747e-6L, 2.71828182845904523536L, TOL},
{"exp", expl, -1.0L, 3.678741455078125e-1L,
@@ -118,7 +109,6 @@ static struct oneargument test1[] =
7.1430341006605745676897e-7L, 7.0710678118654758708668e-1L, TOL},
{"log", logl, 7.07106781186547461715e-1L, -3.46588134765625e-1L,
1.45444856522566402246e-5L, 1.41421356237309517417L, TOL},
-#endif
{"sin", sinl, 7.85398163397448278999e-1L, 7.0709228515625e-1L,
1.4496030297502751942956e-5L, 7.071067811865475460497e-1L, TOL},
{"sin", sinl, -7.85398163397448501044e-1L, -7.071075439453125e-1L,
@@ -202,7 +192,6 @@ static struct oneargument test1[] =
1.47019821746724723933E-5L, -5.12583089548300990774E0L, TOL},
{"acos", acosl, -0.5L, 2.09439086914062500000E0L,
4.23325257049230842892E-6L, -1.15470053837925152902E0L, TOL},
-#if 0
{"sinh", sinhl, 1.0L, 1.17518615722656250000E0L,
1.50364172389568823819E-5L, 1.54308063481524377848E0L, TOL},
{"sinh", sinhl, 7.09089565712818057364E2L, 4.49423283712885057274E307L,
@@ -241,7 +230,6 @@ static struct oneargument test1[] =
9.62177257298785143908E-6L, 3.96911150685467059809E0L, TOL},
{"atanh", atanhl, 0.5L, 5.49301147460937500000E-1L,
4.99687311734569762262E-6L, 1.33333333333333333333E0L, TOL},
-#endif
#if 0
{"j0", j0l, 8.0L, 1.71646118164062500000E-1L,
@@ -292,18 +280,15 @@ static struct oneargument test1[] =
3.88547280871200700671E-1L, 4.69742480525120196168E19L, -4},
#endif
-#if 0
- {"gamma", gammal, 1.0L, 1.0L,
+ {"tgamma", tgammal, 1.0L, 1.0L,
0.0L, -5.772156649015328606e-1L, TOL},
- {"gamma", gammal, 2.0L, 1.0L,
+ {"tgamma", tgammal, 2.0L, 1.0L,
0.0L, 4.2278433509846713939e-1L, TOL},
- {"gamma", gammal, 3.0L, 2.0L,
+ {"tgamma", tgammal, 3.0L, 2.0L,
0.0L, 1.845568670196934279L, TOL},
- {"gamma", gammal, 4.0L, 6.0L,
+ {"tgamma", tgammal, 4.0L, 6.0L,
0.0L, 7.536706010590802836L, TOL},
-#endif
-#if 0
{"lgamma", lgammal, 8.0L, 8.525146484375L,
1.48766904143001655310E-5, 2.01564147795560999654E0L, TOL},
{"lgamma", lgammal, 8.99993896484375e-1L, 6.6375732421875e-2L,
@@ -332,7 +317,6 @@ static struct oneargument test1[] =
1.79986700949327405470E-7, 1.10315664064524318723E0L, -TOL},
{"lgamma", lgammal, -3.5L, -1.30902099609375L,
1.43111007079536392848E-5L, 1.38887092635952890151E0L, TOL},
-#endif
{"null", NULL, 0.0L, 0.0L, 0.0L, 1},
};
diff --git a/regress/lib/libm/cephes/monotll.c b/regress/lib/libm/cephes/monotll.c
index ceccdc5da4e..7dd88fd8c7b 100644
--- a/regress/lib/libm/cephes/monotll.c
+++ b/regress/lib/libm/cephes/monotll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monotll.c,v 1.1 2011/05/30 20:23:35 martynas Exp $ */
+/* $OpenBSD: monotll.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -67,7 +67,6 @@ long double tanhl (long double);
long double asinhl (long double);
long double acoshl (long double);
long double atanhl (long double);
-long double gammal (long double);
long double lgammal (long double);
long double tgammal (long double);
long double fabsl (long double);
@@ -98,7 +97,6 @@ struct oneargument
static struct oneargument test1[] =
{
-#if 0
{"exp", expl, 1.0L, 2.7182769775390625L,
4.85091998273536028747135266249775725E-6L,
2.71828182845904523536028747135266250E0L, TOL},
@@ -138,7 +136,6 @@ static struct oneargument test1[] =
3.465728759765625E-1L,
7.14303410154708616060729088217412434E-7L,
7.07106781186547524400844362104849086E-1L, TOL},
-#endif
{"sin", sinl, 7.85398163397448309615660845819875699E-1L,
7.0709228515625E-1L,
1.44960302975244008443621048490239551E-5L,
@@ -295,7 +292,6 @@ static struct oneargument test1[] =
2.094390869140625L,
4.23325257049230842892218633525613145E-6L,
-1.15470053837925152901829756100391491E0L, TOL},
-#if 0
{"sinh", sinhl, 1.0L,
1.1751861572265625L,
1.50364172389568823818505956008151557E-5L,
@@ -420,6 +416,7 @@ static struct oneargument test1[] =
{"atanh", atanhl, 6.938893903907228377647697925567626953125E-18,
6.938893903907228377647697925567626953125E-18, /* 2^-57 */
1.1136519625384148525585568613131174816786E-52, 1.0, TOL},
+#if 0
{"j0", j0l, 16.0L, -1.749114990234375e-1L,
1.24250398083151715974822741805925455E-5L,
-9.03971756613041862386833024580760244E-2L, -2},
@@ -549,7 +546,6 @@ static struct oneargument test1[] =
2.6551531852207537950481339962774251294400E-59L,
3.0092655e-36L, -2},
#endif
-#if 0
{"lgamma", lgammal, 8.0L, 8.525146484375L,
1.4876690414300165531036347125050759667737E-5L,
2.0156414779556099965363450527747404656959E0L, 4},
@@ -633,18 +629,14 @@ static struct oneargument test1[] =
{"lgamma", lgammal, 1.0e18L, 4.0446531673037733888E19L,
8.5508840451951888057681732252156677289759E8L,
4.1446531673892822311823846184318555736736E1, 4},
-#endif /* 0 */
-#if 0
-#define gammal tgammal /* Yuck. */
- {"gamma", gammal, 1.0L, 1.0L,
+ {"tgamma", tgammal, 1.0L, 1.0L,
0.0L, -5.772156649015328606e-1L, 4},
- {"gamma", gammal, 2.0L, 1.0L,
+ {"tgamma", tgammal, 2.0L, 1.0L,
0.0L, 4.2278433509846713939e-1L, 4},
- {"gamma", gammal, 3.0L, 2.0L,
+ {"tgamma", tgammal, 3.0L, 2.0L,
0.0L, 1.845568670196934279L, 4},
- {"gamma", gammal, 4.0L, 6.0L,
+ {"tgamma", tgammal, 4.0L, 6.0L,
0.0L, 7.536706010590802836L, 4},
-#endif
{NULL, NULL, 0.0L, 0.0L, 0.0L, 1},
};
diff --git a/regress/lib/libm/cephes/testvectl.c b/regress/lib/libm/cephes/testvectl.c
index d3b3ee762b1..2f4355764bb 100644
--- a/regress/lib/libm/cephes/testvectl.c
+++ b/regress/lib/libm/cephes/testvectl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: testvectl.c,v 1.1 2011/05/30 20:23:35 martynas Exp $ */
+/* $OpenBSD: testvectl.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -80,8 +80,8 @@ long double log2l (long double);
long double fabsl (long double);
long double erfl (long double);
long double erfcl (long double);
-long double gammal (long double);
-long double lgaml (long double);
+long double tgammal (long double);
+long double lgammal (long double);
long double floorl (long double);
long double ceill (long double);
long double cbrtl (long double);
@@ -143,7 +143,6 @@ static struct oneargument test1[] =
{"tanl", tanl, &NEGZEROL, &NEGZEROL, 0},
{"tanl", tanl, &INFINITYL, &NANL, 0},
{"tanl", tanl, &MINFL, &NANL, 0},
-#if 0
{"acoshl", acoshl, &NANL, &NANL, 0},
{"acoshl", acoshl, &ONEL, &ZEROL, 0},
{"acoshl", acoshl, &INFINITYL, &INFINITYL, 0},
@@ -181,13 +180,11 @@ static struct oneargument test1[] =
{"expl", expl, &NEGZEROL, &ONEL, 0},
{"expl", expl, &INFINITYL, &INFINITYL, 0},
{"expl", expl, &MINFL, &ZEROL, 0},
-#endif
{"exp2l", exp2l, &NANL, &NANL, 0},
{"exp2l", exp2l, &ZEROL, &ONEL, 0},
{"exp2l", exp2l, &NEGZEROL, &ONEL, 0},
{"exp2l", exp2l, &INFINITYL, &INFINITYL, 0},
{"exp2l", exp2l, &MINFL, &ZEROL, 0},
-#if 0
{"expm1l", expm1l, &NANL, &NANL, 0},
{"expm1l", expm1l, &ZEROL, &ZEROL, 0},
{"expm1l", expm1l, &NEGZEROL, &NEGZEROL, 0},
@@ -216,7 +213,6 @@ static struct oneargument test1[] =
{"log2l", log2l, &NEGZEROL, &MINFL, 0},
{"log2l", log2l, &MONEL, &NANL, 0},
{"log2l", log2l, &INFINITYL, &INFINITYL, 0},
-#endif
/* {"fabsl", fabsl, &NANL, &NANL, 0}, */
{"fabsl", fabsl, &ONEL, &ONEL, 0},
{"fabsl", fabsl, &MONEL, &ONEL, 0},
@@ -224,7 +220,6 @@ static struct oneargument test1[] =
{"fabsl", fabsl, &NEGZEROL, &ZEROL, 0},
{"fabsl", fabsl, &INFINITYL, &INFINITYL, 0},
{"fabsl", fabsl, &MINFL, &INFINITYL, 0},
-#if 0
{"cbrtl", cbrtl, &NANL, &NANL, 0},
{"cbrtl", cbrtl, &ZEROL, &ZEROL, 0},
{"cbrtl", cbrtl, &NEGZEROL, &NEGZEROL, 0},
@@ -238,16 +233,16 @@ static struct oneargument test1[] =
{"erfcl", erfcl, &NANL, &NANL, 0},
{"erfcl", erfcl, &INFINITYL, &ZEROL, 0},
{"erfcl", erfcl, &MINFL, &TWOL, 0},
- {"gammal", gammal, &NANL, &NANL, 0},
- {"gammal", gammal, &INFINITYL, &INFINITYL, 0},
- {"gammal", gammal, &MONEL, &NANL, 0},
- {"gammal", gammal, &ZEROL, &NANL, 0},
- {"gammal", gammal, &MINFL, &NANL, 0},
- {"lgaml", lgaml, &NANL, &NANL, 0},
- {"lgaml", lgaml, &INFINITYL, &INFINITYL, 0},
- {"lgaml", lgaml, &MONEL, &INFINITYL, 0},
- {"lgaml", lgaml, &ZEROL, &INFINITYL, 0},
- {"lgaml", lgaml, &MINFL, &INFINITYL, 0},
+ {"tgammal", tgammal, &NANL, &NANL, 0},
+ {"tgammal", tgammal, &INFINITYL, &INFINITYL, 0},
+ {"tgammal", tgammal, &MONEL, &NANL, 0},
+ {"tgammal", tgammal, &ZEROL, &NANL, 0},
+ {"tgammal", tgammal, &MINFL, &NANL, 0},
+ {"lgammal", lgammal, &NANL, &NANL, 0},
+ {"lgammal", lgammal, &INFINITYL, &INFINITYL, 0},
+ {"lgammal", lgammal, &MONEL, &INFINITYL, 0},
+ {"lgammal", lgammal, &ZEROL, &INFINITYL, 0},
+ {"lgammal", lgammal, &MINFL, &INFINITYL, 0},
{"ceill", ceill, &NANL, &NANL, 0},
{"ceill", ceill, &ZEROL, &ZEROL, 0},
{"ceill", ceill, &NEGZEROL, &NEGZEROL, 0},
@@ -258,7 +253,6 @@ static struct oneargument test1[] =
{"floorl", floorl, &NEGZEROL, &NEGZEROL, 0},
{"floorl", floorl, &INFINITYL, &INFINITYL, 0},
{"floorl", floorl, &MINFL, &MINFL, 0},
-#endif
{"null", NULL, &ZEROL, &ZEROL, 0},
};
@@ -306,7 +300,6 @@ static struct twoarguments test2[] =
{"atan2l", atan2l, &NANL, &ONEL, &NANL, 0},
{"atan2l", atan2l, &ONEL, &NANL, &NANL, 0},
{"atan2l", atan2l, &NANL, &NANL, &NANL, 0},
-#if 0
{"powl", powl, &ONEL, &ZEROL, &ONEL, 0},
{"powl", powl, &ONEL, &NEGZEROL, &ONEL, 0},
{"powl", powl, &MONEL, &ZEROL, &ONEL, 0},
@@ -347,7 +340,6 @@ static struct twoarguments test2[] =
{"powl", powl, &NEGZEROL, &THREEL, &NEGZEROL, 0},
{"powl", powl, &ZEROL, &HALFL, &ZEROL, 0},
{"powl", powl, &NEGZEROL, &HALFL, &ZEROL, 0},
-#endif
{"null", NULL, &ZEROL, &ZEROL, &ZEROL, 0},
};
diff --git a/regress/lib/libm/cephes/testvectll.c b/regress/lib/libm/cephes/testvectll.c
index 8164d6a1259..37e4f81dc80 100644
--- a/regress/lib/libm/cephes/testvectll.c
+++ b/regress/lib/libm/cephes/testvectll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: testvectll.c,v 1.1 2011/05/30 20:23:35 martynas Exp $ */
+/* $OpenBSD: testvectll.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -83,14 +83,11 @@ long double log2l (long double);
long double fabsl (long double);
long double erfl (long double);
long double erfcl (long double);
-long double gammal (long double);
+long double tgammal (long double);
long double floorl (long double);
long double ceill (long double);
long double cbrtl (long double);
-
-/* long double lgaml (long double); */
long double lgammal (long double);
-#define lgaml lgammal
struct oneargument
{
@@ -149,7 +146,6 @@ static struct oneargument test1[] =
{"tanl", tanl, &NEGZEROL, &NEGZEROL, 0},
{"tanl", tanl, &INFINITYL, &NANL, 0},
{"tanl", tanl, &MINFL, &NANL, 0},
-#if 0
{"acoshl", acoshl, &NANL, &NANL, 0},
{"acoshl", acoshl, &ONEL, &ZEROL, 0},
{"acoshl", acoshl, &INFINITYL, &INFINITYL, 0},
@@ -187,13 +183,11 @@ static struct oneargument test1[] =
{"expl", expl, &NEGZEROL, &ONEL, 0},
{"expl", expl, &INFINITYL, &INFINITYL, 0},
{"expl", expl, &MINFL, &ZEROL, 0},
-#endif
{"exp2l", exp2l, &NANL, &NANL, 0},
{"exp2l", exp2l, &ZEROL, &ONEL, 0},
{"exp2l", exp2l, &NEGZEROL, &ONEL, 0},
{"exp2l", exp2l, &INFINITYL, &INFINITYL, 0},
{"exp2l", exp2l, &MINFL, &ZEROL, 0},
-#if 0
{"expm1l", expm1l, &NANL, &NANL, 0},
{"expm1l", expm1l, &ZEROL, &ZEROL, 0},
{"expm1l", expm1l, &NEGZEROL, &NEGZEROL, 0},
@@ -222,7 +216,6 @@ static struct oneargument test1[] =
{"log2l", log2l, &NEGZEROL, &MINFL, 0},
{"log2l", log2l, &MONEL, &NANL, 0},
{"log2l", log2l, &INFINITYL, &INFINITYL, 0},
-#endif
/* {"fabsl", fabsl, &NANL, &NANL, 0}, */
{"fabsl", fabsl, &ONEL, &ONEL, 0},
{"fabsl", fabsl, &MONEL, &ONEL, 0},
@@ -230,7 +223,6 @@ static struct oneargument test1[] =
{"fabsl", fabsl, &NEGZEROL, &ZEROL, 0},
{"fabsl", fabsl, &INFINITYL, &INFINITYL, 0},
{"fabsl", fabsl, &MINFL, &INFINITYL, 0},
-#if 0
{"cbrtl", cbrtl, &NANL, &NANL, 0},
{"cbrtl", cbrtl, &ZEROL, &ZEROL, 0},
{"cbrtl", cbrtl, &NEGZEROL, &NEGZEROL, 0},
@@ -244,16 +236,16 @@ static struct oneargument test1[] =
{"erfcl", erfcl, &NANL, &NANL, 0},
{"erfcl", erfcl, &INFINITYL, &ZEROL, 0},
{"erfcl", erfcl, &MINFL, &TWOL, 0},
- {"gammal", gammal, &NANL, &NANL, 0},
- {"gammal", gammal, &INFINITYL, &INFINITYL, 0},
- {"gammal", gammal, &MONEL, &NANL, 0},
- {"gammal", gammal, &ZEROL, &NANL, 0},
- {"gammal", gammal, &MINFL, &NANL, 0},
- {"lgaml", lgaml, &NANL, &NANL, 0},
- {"lgaml", lgaml, &INFINITYL, &INFINITYL, 0},
- {"lgaml", lgaml, &MONEL, &INFINITYL, 0},
- {"lgaml", lgaml, &ZEROL, &INFINITYL, 0},
- {"lgaml", lgaml, &MINFL, &INFINITYL, 0},
+ {"tgammal", tgammal, &NANL, &NANL, 0},
+ {"tgammal", tgammal, &INFINITYL, &INFINITYL, 0},
+ {"tgammal", tgammal, &MONEL, &NANL, 0},
+ {"tgammal", tgammal, &ZEROL, &NANL, 0},
+ {"tgammal", tgammal, &MINFL, &NANL, 0},
+ {"lgammal", lgammal, &NANL, &NANL, 0},
+ {"lgammal", lgammal, &INFINITYL, &INFINITYL, 0},
+ {"lgammal", lgammal, &MONEL, &INFINITYL, 0},
+ {"lgammal", lgammal, &ZEROL, &INFINITYL, 0},
+ {"lgammal", lgammal, &MINFL, &INFINITYL, 0},
{"ceill", ceill, &NANL, &NANL, 0},
{"ceill", ceill, &ZEROL, &ZEROL, 0},
{"ceill", ceill, &NEGZEROL, &NEGZEROL, 0},
@@ -264,7 +256,6 @@ static struct oneargument test1[] =
{"floorl", floorl, &NEGZEROL, &NEGZEROL, 0},
{"floorl", floorl, &INFINITYL, &INFINITYL, 0},
{"floorl", floorl, &MINFL, &MINFL, 0},
-#endif
{"null", NULL, &ZEROL, &ZEROL, 0},
};
@@ -312,7 +303,6 @@ static struct twoarguments test2[] =
{"atan2l", atan2l, &NANL, &ONEL, &NANL, 0},
{"atan2l", atan2l, &ONEL, &NANL, &NANL, 0},
{"atan2l", atan2l, &NANL, &NANL, &NANL, 0},
-#if 0
{"powl", powl, &ONEL, &ZEROL, &ONEL, 0},
{"powl", powl, &ONEL, &NEGZEROL, &ONEL, 0},
{"powl", powl, &MONEL, &ZEROL, &ONEL, 0},
@@ -353,7 +343,6 @@ static struct twoarguments test2[] =
{"powl", powl, &NEGZEROL, &THREEL, &NEGZEROL, 0},
{"powl", powl, &ZEROL, &HALFL, &ZEROL, 0},
{"powl", powl, &NEGZEROL, &HALFL, &ZEROL, 0},
-#endif
{"null", NULL, &ZEROL, &ZEROL, &ZEROL, 0},
};