about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rwxr-xr-xmath/gen-libm-test.pl28
-rw-r--r--math/libm-test.inc7
2 files changed, 18 insertions, 17 deletions
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index f7bd323252..275ba7beaa 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -33,7 +33,7 @@ use vars qw (%ulps %failures);
 use vars qw (%beautify);
 use vars qw ($output_dir $ulps_file);
 
-%beautify = 
+%beautify =
   ( "minus_zero" => "-0",
     "plus_zero" => "+0",
     "minus_infty" => "-inf",
@@ -97,7 +97,7 @@ $count = 0;
 
 &parse_ulps ($ulps_file);
 &generate_testfile ($input, $output);
-&output_ulps ("${output_dir}libm-test-ulps.h");
+&output_ulps ("${output_dir}libm-test-ulps.h", $ulps_file);
 &print_ulps_file ("${output_dir}NewUlps") if ($opt_n);
 
 # Return a nicer representation
@@ -142,8 +142,8 @@ sub build_complex_beautify {
 sub get_variable {
   my ($number) = @_;
 
-  return "x" if ($number == 1); 
-  return "y" if ($number == 2); 
+  return "x" if ($number == 1);
+  return "y" if ($number == 2);
   return "z" if ($number == 3);
   # return x1,x2,...
   $number =-3;
@@ -186,7 +186,7 @@ sub special_functions {
   my (@args, $str, $test, $cline);
 
   @args = split /,\s*/, $args;
-  
+
   unless ($args[0] =~ /sincos/) {
     die ("Don't know how to handle $args[0] extra.");
   }
@@ -202,7 +202,7 @@ sub special_functions {
   $cline = "  check_float (\"$test\", sin_res, $args[2]";
   $cline .= &new_test ($test, $args[4]);
   print $file $cline;
-  
+
   # handle cos
   $test = $str . ' puts ' . &beautify ($args[3]) . ' in cos_res';
   $cline = "  check_float (\"$test\", cos_res, $args[3]";
@@ -261,7 +261,7 @@ sub parse_args {
   $call .= ')';
   $str = "$call == ";
 
-  # Result 
+  # Result
   @descr = split //,$descr_res;
   foreach (@descr) {
     if ($_ =~ /f|i|l|L/) {
@@ -382,7 +382,7 @@ sub parse_args {
       my ($str) = "$call sets x to $special[0]";
       $post = "  check_float (\"$str\", x, $special[0]";
       $post .= &new_test ($str, undef);
-    } 
+    }
   } elsif ($args[0] eq 'remquo') {
     if (defined $special[0] && $special[0] ne "IGNORE") {
       my ($str) = "$call sets x to $special[0]";
@@ -390,7 +390,7 @@ sub parse_args {
       $post .= &new_test ($str, undef);
     }
   }
-  
+
   print $file $pre if (defined $pre);
 
   print $file "  $cline\n";
@@ -500,7 +500,7 @@ sub print_ulps {
 # Clean up a floating point number
 sub clean_up_number {
   my ($number) = @_;
-  
+
   # Remove trailing zeros
   $number =~ s/0+$//;
   $number =~ s/\.$//;
@@ -586,21 +586,23 @@ sub output_test {
 
 # Print include file
 sub output_ulps {
-  my ($file) = @_;
+  my ($file, $ulps_filename) = @_;
   my ($i, $fct);
 
   open ULP, ">$file" or die ("Can't open $file: $!");
 
-  print ULP "/* This file is automatically generated.\n";
+  print ULP "/* This file is automatically generated\n";
+  print ULP "   from $ulps_filename with gen-libm-test.pl.\n";
   print ULP "   Don't change it - change instead the master files.  */\n\n";
 
+  print ULP "\n/* Maximal error of functions.  */\n";
   foreach $fct (@functions) {
     output_test (\*ULP, $fct, $fct);
   }
 
+  print ULP "\n/* Error of single function calls.  */\n";
   for ($i = 0; $i < $count; $i++) {
     output_test (\*ULP, $tests[$i], $i);
   }
   close ULP;
 }
-
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 74bdd0381e..02b2f985cb 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -2969,7 +2969,7 @@ nextafter_test (void)
   END (nextafter);
 }
 
-#if 0
+
 static void
 nexttoward_test (void)
 {
@@ -2993,7 +2993,6 @@ nexttoward_test (void)
 
   END (nexttoward);
 }
-#endif
 
 
 static void
@@ -3706,7 +3705,7 @@ static const struct argp_option options[] =
 static const char doc[] = "Math test suite: " TEST_MSG ;
 
 /* Prototype for option handler.  */
-static error_t parse_opt __P ((int key, char *arg, struct argp_state *state));
+static error_t parse_opt (int key, char *arg, struct argp_state *state);
 
 /* Data structure to communicate with argp functions.  */
 static struct argp argp =
@@ -3884,7 +3883,7 @@ main (int argc, char **argv)
   /* Manipulation functions:  */
   copysign_test ();
   nextafter_test ();
-  //  nexttoward_test ();
+  nexttoward_test ();
 
   /* maximum, minimum and positive difference functions */
   fdim_test ();