aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-01 11:25:26 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-01 11:25:26 +0000
commitee586e0ec492d818be9aa0c77dd44095d42f486f (patch)
tree21172ee5bbec6a0a0be049d633b6b9e7d9034c90 /math
parent28ab8526f2cf0dfbe0da8b4a6ef46e5efb8c3e4b (diff)
downloadglibc-ee586e0ec492d818be9aa0c77dd44095d42f486f.tar.xz
glibc-ee586e0ec492d818be9aa0c77dd44095d42f486f.zip
Update.
1998-12-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * sunrpc/auth_des.c: Use new XDR int32 functions for integers. * sunrpc/rpc/xdr.h: Add IXDR INT32 functions. * sunrpc/rpc_hout.c: Remove (u_long) casts in defines to avoid conflicts with new solaris version. * sunrpc/rpc_main.c: Fix bug in generating Makefile name (malloc doesn't zero allocated memory). * sunrpc/rpc_svcout.c: Local variables now starts with a _ to avoid conflicts with xdr functions. Solves PR libc/877. * nis/rpcsvc/nis.x: Use always uint32_t. * nis/rpcsvc/nis.h: Likewise. * nis/rpcsvc/nis_object.x: Likewise. 1998-12-01 Ulrich Drepper <drepper@cygnus.com> * math/libm-test.c: Various cleanups. Patch by Zack Weinberg. * sysdeps/unix/sysv/linux/alpha/setfpucw.c: Use correct type for parameter. Patch by Christian Gafton. * string/envz.h: Add prototype for envz_remove. Reported by Andreas Jaeger.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.c1810
1 files changed, 872 insertions, 938 deletions
diff --git a/math/libm-test.c b/math/libm-test.c
index 86616a4404..2f57ef21bd 100644
--- a/math/libm-test.c
+++ b/math/libm-test.c
@@ -17,9 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/*
- Part of testsuite for libm.
+/* Part of testsuite for libm.
This file has to be included by a master file that defines:
@@ -27,16 +25,16 @@
FUNC(function): converts general function name (like cos) to
name with correct suffix (e.g. cosl or cosf)
MATHCONST(x): like FUNC but for constants (e.g convert 0.0 to 0.0L)
- MATHTYPE: floating point type to test
- TEST_MSG: informal message to be displayed
+ MATHTYPE: floating point type to test
+ TEST_MSG: informal message to be displayed
CHOOSE(Clongdouble,Cdouble,Cfloat):
chooses one of the parameters as epsilon for testing
equality
- PRINTF_EXPR Floating point conversion specification to print a variable
- of type MATHTYPE with printf. PRINTF_EXPR just contains
+ PRINTF_EXPR Floating point conversion specification to print a variable
+ of type MATHTYPE with printf. PRINTF_EXPR just contains
the specifier, not the percent and width arguments,
e.g. "f".
- PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
+ PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
*/
/* This program isn't finished yet.
@@ -58,12 +56,12 @@
ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan, ctanh.
At the moment the following functions aren't tested:
-OB conj, cproj, cimag, creal, drem,
+ conj, cproj, cimag, creal, drem,
j0, j1, jn, y0, y1, yn,
significand,
nan
- The routines using random variables are still under construction. I don't
+ The routines using random variables are still under construction. I don't
like it the way it's working now and will change it.
Parameter handling is primitive in the moment:
@@ -82,25 +80,25 @@ OB conj, cproj, cimag, creal, drem,
This suite tests some aspects of the correct implementation of
mathematical functions in libm. Some simple, specific parameters
are tested for correctness but there's no exhaustive
- testing. Handling of specific inputs (e.g. infinity, not-a-number)
- is also tested. Correct handling of exceptions is checked
- against. These implemented tests should check all cases that are
+ testing. Handling of specific inputs (e.g. infinity, not-a-number)
+ is also tested. Correct handling of exceptions is checked
+ against. These implemented tests should check all cases that are
specified in ISO C 9X.
Exception testing: At the moment only divide-by-zero and invalid
- exceptions are tested. Overflow/underflow and inexact exceptions
+ exceptions are tested. Overflow/underflow and inexact exceptions
aren't checked at the moment.
- NaN values: There exist signalling and quiet NaNs. This implementation
+ NaN values: There exist signalling and quiet NaNs. This implementation
only uses signalling NaN as parameter but does not differenciate
between the two kinds of NaNs as result.
Inline functions: Inlining functions should give an improvement in
- speed - but not in precission. The inlined functions return
- reasonable values for a reasonable range of input values. The
+ speed - but not in precission. The inlined functions return
+ reasonable values for a reasonable range of input values. The
result is not necessarily correct for all values and exceptions are
- not correctly raised in all cases. Problematic input and return
- values are infinity, not-a-number and minus zero. This suite
+ not correctly raised in all cases. Problematic input and return
+ values are infinity, not-a-number and minus zero. This suite
therefore does not check these specific inputs and the exception
handling for inlined mathematical functions - just the "reasonable"
values are checked.
@@ -112,8 +110,7 @@ OB conj, cproj, cimag, creal, drem,
- Compiler has errors
With e.g. gcc 2.7.2.2 the test for cexp fails because of a compiler error.
-
-*/
+ */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
@@ -130,21 +127,21 @@ OB conj, cproj, cimag, creal, drem,
#include <getopt.h>
/* Possible exceptions */
-#define NO_EXCEPTION 0x0
-#define INVALID_EXCEPTION 0x1
+#define NO_EXCEPTION 0x0
+#define INVALID_EXCEPTION 0x1
#define DIVIDE_BY_ZERO_EXCEPTION 0x2
#define PRINT 1
#define NO_PRINT 0
/* Various constants (we must supply them precalculated for accuracy). */
-#define M_PI_6l .52359877559829887308L
+#define M_PI_6l .52359877559829887308L
#define M_E2l 7.389056098930650227230L
#define M_E3l 20.08553692318766774093L
-static int noErrors; /* number of errors */
-static int noTests; /* number of tests (without testing exceptions) */
-static int noExcTests; /* number of tests for exception flags */
+static int noErrors; /* number of errors */
+static int noTests; /* number of tests (without testing exceptions) */
+static int noExcTests; /* number of tests for exception flags */
static int verbose = 3;
static MATHTYPE minus_zero, plus_zero;
@@ -166,23 +163,22 @@ typedef MATHTYPE (*mathfunc) (MATHTYPE);
isinf (x) : isinfl (x))
- /*
- Test if Floating-Point stack hasn't changed
- */
+/* Test if Floating-Point stack hasn't changed */
static void
fpstack_test (const char *test_name)
{
#ifdef i386
static int old_stack;
int sw;
-asm ("fnstsw":"=a" (sw));
+
+ asm ("fnstsw":"=a" (sw));
sw >>= 11;
sw &= 7;
+
if (sw != old_stack)
{
- printf ("FP-Stack wrong after test %s\n", test_name);
- if (verbose > 2)
- printf ("=======> stack = %d\n", sw);
+ printf ("FP-Stack wrong after test %s (%d, should be %d)\n",
+ test_name, sw, old_stack);
++noErrors;
old_stack = sw;
}
@@ -190,11 +186,9 @@ asm ("fnstsw":"=a" (sw));
}
-/*
- Get a random value x with min_value < x < max_value
+/* Get a random value x with min_value < x < max_value
and min_value, max_value finite,
- max_value and min_value shouldn't be too close together
- */
+ max_value and min_value shouldn't be too close together */
static MATHTYPE
random_value (MATHTYPE min_value, MATHTYPE max_value)
{
@@ -214,13 +208,15 @@ random_value (MATHTYPE min_value, MATHTYPE max_value)
return x;
}
+
/* Get a random value x with x > min_value. */
static MATHTYPE
random_greater (MATHTYPE min_value)
{
- return random_value (min_value, 1e6); /* CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX) */
+ return random_value (min_value, 1e6); /* CHOOSE(LDBL_MAX, DBL_MAX, FLT_MAX) */
}
+
/* Get a random value x with x < max_value. */
static MATHTYPE
random_less (MATHTYPE max_value)
@@ -246,7 +242,7 @@ output_pass_value (void)
static void
-output_fail_value (const char * test_name)
+output_fail_value (const char *test_name)
{
if (verbose > 0 && verbose < 3)
printf ("Fail: %s\n", test_name);
@@ -258,48 +254,48 @@ output_fail_value (const char * test_name)
/* Test whether a given exception was raised. */
static void
test_single_exception (const char *test_name,
- short int exception,
- short int exc_flag,
- int fe_flag,
- const char *flag_name)
+ short int exception,
+ short int exc_flag,
+ int fe_flag,
+ const char *flag_name)
{
#ifndef TEST_INLINE
if (exception & exc_flag)
{
if (fetestexcept (fe_flag))
- {
- if (verbose > 3)
- printf ("Pass: Exception \"%s\" set\n", flag_name);
- }
+ {
+ if (verbose > 3)
+ printf ("Pass: Exception \"%s\" set\n", flag_name);
+ }
else
- {
- if (verbose && verbose < 3)
- printf ("Fail: %s: Exception \"%s\" not set\n",
+ {
+ if (verbose && verbose < 3)
+ printf ("Fail: %s: Exception \"%s\" not set\n",
test_name, flag_name);
- if (verbose >= 3)
- printf ("Fail: Exception \"%s\" not set\n",
- flag_name);
- ++noErrors;
- }
+ if (verbose >= 3)
+ printf ("Fail: Exception \"%s\" not set\n",
+ flag_name);
+ ++noErrors;
+ }
}
else
{
if (fetestexcept (fe_flag))
- {
- if (verbose && verbose < 3)
- printf ("Fail: %s: Exception \"%s\" set\n",
+ {
+ if (verbose && verbose < 3)
+ printf ("Fail: %s: Exception \"%s\" set\n",
test_name, flag_name);
- if (verbose >= 3)
- printf ("Fail: Exception \"%s\" set\n",
- flag_name);
- ++noErrors;
- }
+ if (verbose >= 3)
+ printf ("Fail: Exception \"%s\" set\n",
+ flag_name);
+ ++noErrors;
+ }
else
- {
- if (verbose > 3)
- printf ("Pass: Exception \"%s\" not set\n",
+ {
+ if (verbose > 3)
+ printf ("Pass: Exception \"%s\" not set\n",
flag_name);
- }
+ }
}
#endif
}
@@ -332,12 +328,12 @@ test_exceptions (const char *test_name, short int exception)
++noExcTests;
#ifdef FE_DIVBYZERO
test_single_exception (test_name, exception,
- DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
- "Divide by zero");
+ DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
+ "Divide by zero");
#endif
#ifdef FE_INVALID
test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
- "Invalid operation");
+ "Invalid operation");
#endif
feclearexcept (FE_ALL_EXCEPT);
}
@@ -360,16 +356,16 @@ check_equal (MATHTYPE computed, MATHTYPE supplied, MATHTYPE eps, MATHTYPE * diff
ret_value = (*diff <= eps &&
- (signbit (computed) == signbit (supplied) || eps != 0.0));
+ (signbit (computed) == signbit (supplied) || eps != 0.0));
- /* Make sure the subtraction/comparison have no influence on the exceptions. */
+ /* Make sure the subtraction/comparison
+ have no influence on the exceptions. */
feclearexcept (FE_ALL_EXCEPT);
return ret_value;
}
-
static void
output_result_bool (const char *test_name, int result)
{
@@ -382,7 +378,7 @@ output_result_bool (const char *test_name, int result)
{
output_fail_value (test_name);
if (verbose > 1)
- printf (" Value: %d\n", result);
+ printf (" Value: %d\n", result);
++noErrors;
}
@@ -455,12 +451,12 @@ output_result (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
computed, computed);
- printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
expected, expected);
if (print_diff)
- printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
"\n", difference, difference);
}
++noErrors;
@@ -488,14 +484,14 @@ output_result_ext (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
computed, computed);
- printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
expected, expected);
if (print_diff)
- printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
"\n", difference, difference);
- printf ("Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf ("Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
parameter, parameter);
}
++noErrors;
@@ -504,9 +500,8 @@ output_result_ext (const char *test_name, int result,
fpstack_test (test_name);
}
-/*
- check that computed and expected values are the same
- */
+
+/* check that computed and expected values are the same */
static void
check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
{
@@ -521,10 +516,8 @@ check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
}
-/*
- check that computed and expected values are the same,
- outputs the parameter to the function
- */
+/* check that computed and expected values are the same,
+ outputs the parameter to the function */
static void
check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE parameter)
@@ -540,10 +533,8 @@ check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
}
-/*
- check that computed and expected values are the same and
- checks also for exception flags
- */
+/* check that computed and expected values are the same and
+ checks also for exception flags */
static void
check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
short exception)
@@ -558,9 +549,8 @@ check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
-/*
- check that computed and expected values are close enough
- */
+
+/* check that computed and expected values are close enough */
static void
check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE epsilon)
@@ -575,9 +565,8 @@ check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
-/*
- check a boolean condition
- */
+
+/* check a boolean condition */
static void
check_bool (const char *test_name, int computed)
{
@@ -587,10 +576,7 @@ check_bool (const char *test_name, int computed)
}
-
-/*
- check that computed and expected values are equal (int values)
- */
+/* check that computed and expected values are equal (int values) */
static void
check_int (const char *test_name, int computed, int expected)
{
@@ -610,8 +596,8 @@ check_int (const char *test_name, int computed, int expected)
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %d\n", computed);
- printf (" should be: %d\n", expected);
+ printf (" is: %d\n", computed);
+ printf (" should be: %d\n", expected);
}
noErrors++;
}
@@ -620,9 +606,7 @@ check_int (const char *test_name, int computed, int expected)
}
-/*
- check that computed and expected values are equal (long int values)
- */
+/* check that computed and expected values are equal (long int values) */
static void
check_long (const char *test_name, long int computed, long int expected)
{
@@ -643,8 +627,8 @@ check_long (const char *test_name, long int computed, long int expected)
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %ld\n", computed);
- printf (" should be: %ld\n", expected);
+ printf (" is: %ld\n", computed);
+ printf (" should be: %ld\n", expected);
}
noErrors++;
}
@@ -652,9 +636,8 @@ check_long (const char *test_name, long int computed, long int expected)
fpstack_test (test_name);
}
-/*
- check that computed and expected values are equal (long long int values)
- */
+
+/* check that computed and expected values are equal (long long int values) */
static void
check_longlong (const char *test_name, long long int computed,
long long int expected)
@@ -676,8 +659,8 @@ check_longlong (const char *test_name, long long int computed,
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %lld\n", computed);
- printf (" should be: %lld\n", expected);
+ printf (" is: %lld\n", computed);
+ printf (" should be: %lld\n", expected);
}
noErrors++;
}
@@ -685,9 +668,8 @@ check_longlong (const char *test_name, long long int computed,
fpstack_test (test_name);
}
-/*
- check that computed value is not-a-number
- */
+
+/* check that computed value is not-a-number */
static void
check_isnan (const char *test_name, MATHTYPE computed)
{
@@ -697,9 +679,7 @@ check_isnan (const char *test_name, MATHTYPE computed)
}
-/*
- check that computed value is not-a-number and test for exceptions
- */
+/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_exc (const char *test_name, MATHTYPE computed,
short exception)
@@ -710,9 +690,7 @@ check_isnan_exc (const char *test_name, MATHTYPE computed,
}
-/*
- check that computed value is not-a-number and test for exceptions
- */
+/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
short exception)
@@ -722,9 +700,8 @@ check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, isnan (computed), computed);
}
-/*
- check that computed value is not-a-number and supply parameter
- */
+
+/* check that computed value is not-a-number and supply parameter */
#ifndef TEST_INLINE
static void
check_isnan_ext (const char *test_name, MATHTYPE computed,
@@ -736,16 +713,14 @@ check_isnan_ext (const char *test_name, MATHTYPE computed,
}
#endif
-/*
- check that computed value is not-a-number, test for exceptions
- and supply parameter
- */
+/* check that computed value is not-a-number, test for exceptions
+ and supply parameter */
static void
check_isnan_exc_ext (const char *test_name, MATHTYPE computed,
- short exception, MATHTYPE parameter)
+ short exception, MATHTYPE parameter)
{
output_new_test (test_name);
- test_exceptions (test_name,exception);
+ test_exceptions (test_name, exception);
output_isvalue_ext (test_name, isnan (computed), computed, parameter);
}
@@ -760,6 +735,7 @@ check_isinfp (const char *test_name, MATHTYPE computed)
}
+/* Tests if computed is +Inf and supply parameter */
static void
check_isinfp_ext (const char *test_name, MATHTYPE computed,
MATHTYPE parameter)
@@ -770,7 +746,7 @@ check_isinfp_ext (const char *test_name, MATHTYPE computed,
}
-/* Tests if computed is +Inf */
+/* Tests if computed is +Inf and check exceptions */
static void
check_isinfp_exc (const char *test_name, MATHTYPE computed,
int exception)
@@ -780,6 +756,7 @@ check_isinfp_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, (ISINF (computed) == +1), computed);
}
+
/* Tests if computed is -Inf */
static void
check_isinfn (const char *test_name, MATHTYPE computed)
@@ -790,6 +767,7 @@ check_isinfn (const char *test_name, MATHTYPE computed)
}
+/* Tests if computed is -Inf and supply parameter */
#ifndef TEST_INLINE
static void
check_isinfn_ext (const char *test_name, MATHTYPE computed,
@@ -801,8 +779,7 @@ check_isinfn_ext (const char *test_name, MATHTYPE computed,
}
#endif
-
-/* Tests if computed is -Inf */
+/* Tests if computed is -Inf and check exceptions */
static void
check_isinfn_exc (const char *test_name, MATHTYPE computed,
int exception)
@@ -848,13 +825,12 @@ acos_test (void)
check ("acos (-1) == pi", FUNC(acos) (-1), M_PIl);
check_eps ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6l * 2.0,
- CHOOSE (1e-18, 0, 0));
+ CHOOSE(1e-18, 0, 0));
check_eps ("acos (-0.5) == 2*pi/3", FUNC(acos) (-0.5), M_PI_6l * 4.0,
- CHOOSE (1e-17, 0, 0));
+ CHOOSE(1e-17, 0, 0));
check_eps ("acos (0.7) == 0.795398830...", FUNC(acos) (0.7),
0.7953988301841435554L, CHOOSE(7e-17L, 0, 0));
-
}
@@ -873,7 +849,7 @@ acosh_test (void)
check ("acosh(1) == 0", FUNC(acosh) (1), 0);
check_eps ("acosh(7) == 2.633915793...", FUNC(acosh) (7),
- 2.6339157938496334172L, CHOOSE (3e-19, 0, 0));
+ 2.6339157938496334172L, CHOOSE(3e-19, 0, 0));
}
@@ -900,7 +876,7 @@ asin_test (void)
CHOOSE(3.5e-18, 0, 2e-7));
check_eps ("asin (-0.5) == -pi/6", FUNC(asin) (-0.5), -M_PI_6l,
CHOOSE(3.5e-18, 0, 2e-7));
- check ("asin (1.0) == pi/2", FUNC(asin) (1.0), M_PI_2l);
+ check ("asin (1.0) == pi/2", FUNC(asin) (1.0), M_PI_2l);
check ("asin (-1.0) == -pi/2", FUNC(asin) (-1.0), -M_PI_2l);
check_eps ("asin (0.7) == 0.775397496...", FUNC(asin) (0.7),
0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 2e-7));
@@ -910,7 +886,6 @@ asin_test (void)
static void
asinh_test (void)
{
-
check ("asinh(+0) == +0", FUNC(asinh) (0), 0);
#ifndef TEST_INLINE
check ("asinh(-0) == -0", FUNC(asinh) (minus_zero), minus_zero);
@@ -919,7 +894,6 @@ asinh_test (void)
#endif
check_eps ("asinh(0.7) == 0.652666566...", FUNC(asinh) (0.7),
0.652666566082355786L, CHOOSE(4e-17L, 0, 6e-8));
-
}
@@ -933,9 +907,9 @@ atan_test (void)
check ("atan (-inf) == -pi/2", FUNC(atan) (minus_infty), -M_PI_2l);
check_eps ("atan (1) == pi/4", FUNC(atan) (1), M_PI_4l,
- CHOOSE (1e-18, 0, 0));
+ CHOOSE(1e-18, 0, 0));
check_eps ("atan (-1) == -pi/4", FUNC(atan) (1), M_PI_4l,
- CHOOSE (1e-18, 0, 0));
+ CHOOSE(1e-18, 0, 0));
check_eps ("atan (0.7) == 0.610725964...", FUNC(atan) (0.7),
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
@@ -990,11 +964,11 @@ atan2_test (void)
x = random_value (-1e4, 1e4);
check ("atan2(+inf, x) == pi/2 for finite x",
- FUNC(atan2) (plus_infty, x), M_PI_2l);
+ FUNC(atan2) (plus_infty, x), M_PI_2l);
x = random_value (-1e4, 1e4);
check ("atan2(-inf, x) == -pi/2 for finite x",
- FUNC(atan2) (minus_infty, x), -M_PI_2l);
+ FUNC(atan2) (minus_infty, x), -M_PI_2l);
x = random_greater (0);
check ("atan2 (y,-inf) == +pi for finite y > 0",
@@ -1017,11 +991,10 @@ atan2_test (void)
FUNC(atan2) (minus_infty, minus_infty), -3 * M_PI_4l);
/* FIXME: Add some specific tests */
- check_eps ("atan2 (0.7,1) == 0.61072...", FUNC(atan2) (0.7,1),
+ check_eps ("atan2 (0.7,1) == 0.61072...", FUNC(atan2) (0.7, 1),
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
check_eps ("atan2 (0.4,0.0003) == 1.57004...", FUNC(atan2) (0.4, 0.0003),
1.5700463269355215718L, CHOOSE(2e-19L, 0, 1.2e-7));
-
}
@@ -1043,11 +1016,11 @@ atanh_test (void)
x = random_greater (1.0);
check_isnan_exc_ext ("atanh (x) == NaN plus invalid exception if |x| > 1",
- FUNC(atanh) (x), INVALID_EXCEPTION, x);
+ FUNC(atanh) (x), INVALID_EXCEPTION, x);
x = random_less (1.0);
check_isnan_exc_ext ("atanh (x) == NaN plus invalid exception if |x| > 1",
- FUNC(atanh) (x), INVALID_EXCEPTION, x);
+ FUNC(atanh) (x), INVALID