Skip to content

Commit

Permalink
Fix ldbl-128ibm tanhl inaccuracy (bug 18790).
Browse files Browse the repository at this point in the history
ldbl-128ibm tanhl uses a too-small threshold to decide when to return
+/-1, resulting in large errors.  This patch changes it to a more
appropriate threshold (the requirement is for 2*exp(-2|x|) to be small
in terms of ulps of 1).

Tested for x86_64, x86 and powerpc.

	[BZ #18790]
	* sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Increase
	threshold for returning +/- 1.
	* math/auto-libm-test-in: Add more tests of tanh.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
  • Loading branch information
Joseph Myers committed Aug 10, 2015
1 parent eb32b0d commit 7ee06ef
Show file tree
Hide file tree
Showing 6 changed files with 952 additions and 7 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2015-08-10 Joseph Myers <joseph@codesourcery.com>

[BZ #18790]
* sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Increase
threshold for returning +/- 1.
* math/auto-libm-test-in: Add more tests of tanh.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/fpu/libm-test-ulps: Update.

2015-08-10 Andreas Schwab <schwab@suse.de>

[BZ #18781]
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Version 2.23
* The following bugs are resolved with this release:

16517, 16519, 17905, 18265, 18480, 18525, 18618, 18647, 18661, 18674,
18781, 18787, 18789.
18781, 18787, 18789, 18790.

Version 2.22

Expand Down
36 changes: 36 additions & 0 deletions math/auto-libm-test-in
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,42 @@ tanh 0.75
tanh -0.75
tanh 1.0
tanh -1.0
tanh 2
tanh -2
tanh 3
tanh -3
tanh 4
tanh -4
tanh 5
tanh -5
tanh 6
tanh -6
tanh 7
tanh -7
tanh 8
tanh -8
tanh 9
tanh -9
tanh 10
tanh -10
tanh 15
tanh -15
tanh 20
tanh -20
tanh 22
tanh -22
tanh 25
tanh -25
tanh 30
tanh -30
tanh 35
tanh -35
tanh 40
tanh -40
tanh 45
tanh -45
tanh 50
tanh -50
tanh 0x1p-57
tanh 0xe.6c659p-4
tanh 0x8.c259ep-4
Expand Down
Loading

0 comments on commit 7ee06ef

Please sign in to comment.