about summary refs log tree commit diff
path: root/math/gen-libm-test.pl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-19 13:53:34 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-19 13:53:34 +0000
commitfe559c5e1ce629f94f1621c76f5cfd59d6028830 (patch)
tree8aff0f4deccf163242ad22f0dddcd2f2da238c26 /math/gen-libm-test.pl
parent8847214f239965f538e42a09d3d08ce8c700dea2 (diff)
downloadglibc-fe559c5e1ce629f94f1621c76f5cfd59d6028830.tar.gz
glibc-fe559c5e1ce629f94f1621c76f5cfd59d6028830.tar.xz
glibc-fe559c5e1ce629f94f1621c76f5cfd59d6028830.zip
Update.
1999-10-19  Andreas Jaeger  <aj@suse.de>

	* include/bits/ipc.h: Remove K&R compatibility.
	* include/libintl.h: Likewise.
	* include/math.h: Likewise.
	* include/mntent.h: Likewise
	* include/netdb.h: Likewise.
	* include/pwd.h: Likewise.
	* include/sched.h: Likewise.
	* include/shadow.h: Likewise
	* include/stdlib.h: Likewise.
	* include/sys/file.h: Likewise.
	* include/sys/gmon.h: Likewise.
	* include/sys/ioctl.h: Likewise.
	* include/sys/mman.h: Likewise.
	* include/sys/resource.h: Likewise.
	* include/sys/socket.h: Likewise.
	* include/sys/stat.h: Likewise.
	* include/sys/sysinfo.h: Likewise.
	* include/sys/time.h: Likewise.
	* include/sys/times.h: Likewise.
	* include/sys/uio.h: Likewise.
	* include/sys/wait.h: Likewise.
	* include/termios.h: Likewise.
	* include/time.h: Likewise.
	* include/ulimit.h: Likewise.
	* include/utmp.h: Likewise.
	* include/wchar.h: Likewise.
	* include/wctype.h: Likewise.

1999-10-19  Andreas Jaeger  <aj@suse.de>

	* math/libm-test.inc: Remove one K&R compatibility.
	(main): Enable nexttoward_test.

	* math/gen-libm-test.pl (output_ulps): Output name of Ulps file to
	libm-test-ulps.h; pretty print output a bit.

1999-10-19  Andreas Jaeger  <aj@suse.de>

	* iconv/iconv_prog.c (main): Set exit value in case that reading
	from stdin failed [PR libc/1404].
Diffstat (limited to 'math/gen-libm-test.pl')
-rwxr-xr-xmath/gen-libm-test.pl28
1 files changed, 15 insertions, 13 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;
 }
-