tanh: single flonum result for range of arguments
Fix the case for > 1.29f-08 and <= 0.549f0. Closes #2736
This commit is contained in:
parent
cec813fef6
commit
91cdc06c91
|
@ -340,7 +340,11 @@
|
|||
(test 0.0f0 tanh 0.0f0)
|
||||
(test #t single=? tanh+1 (tanh 1.0f0))
|
||||
(test 1.0f0 tanh 20.0f0)
|
||||
(test 1.0f0 tanh +inf.f))
|
||||
(test 1.0f0 tanh +inf.f)
|
||||
(test #t single-flonum? (tanh -0.11100646f0))
|
||||
(test #t single-flonum? (tanh 0.11100646f0))
|
||||
(test #t single-flonum? (tanh 0.61100646f0))
|
||||
(test #t single-flonum? (tanh 20.61100646f0)))
|
||||
|
||||
(test +nan.0 tanh +nan.0)
|
||||
(test -1.0 tanh -inf.0)
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
(define R
|
||||
(/ (* g (+ (* (+ (* p2 g) p1) g) p0))
|
||||
(+ (* (+ (* (+ g q2) g) q1) g) q0)))
|
||||
(+ z (* z R))]
|
||||
(+ z (* z (if (single-flonum? z) (real->single-flonum R) R)))]
|
||||
[(z . < . 19.06154746539849600897D+00) (- 1 (/ 2 (+ 1 (exp (* 2 z)))))]
|
||||
[(z . >= . 19.06154746539849600897D+00) (if (single-flonum? z) (real->single-flonum 1.0) 1.0)]
|
||||
[else z]))] ; +nan.0 or +nan.f
|
||||
|
|
Loading…
Reference in New Issue
Block a user