Reduce testcases for known bugs and document the root causes.
original commit: 74377e717e86257c01a823f0b7ed6bda0fa4eea7
This commit is contained in:
parent
f5ba0864a0
commit
62a29e93aa
|
@ -42,117 +42,36 @@
|
|||
|
||||
(define tests
|
||||
(test-suite "Known bugs"
|
||||
(bad-opt (/ (cosh (tanh (min 0)))
|
||||
(sqr (make-polar 9.8813129168249e-324 5.64234687795904e-184))))
|
||||
(bad-opt (/ 1.0 (sqr 9.8813129168249e-324+0.0i)))
|
||||
|
||||
;; Arguments are converted to inexact too early
|
||||
(bad-opt (* (make-rectangular -inf.0 1) (* 1 1)))
|
||||
(bad-opt (/ -inf.0-inf.0i 8))
|
||||
(bad-opt (- (* -1 1 +nan.0) 1.0+1.0i))
|
||||
(bad-opt (- (* (/ 6 11) (/ 1.2345678f0 123456.7f0)) (make-rectangular 0.0 0.3)))
|
||||
(bad-opt (/ 1.0 0.0+0.0i))
|
||||
(bad-opt (+ 0.0+0.0i (* 1 1 +inf.0)))
|
||||
|
||||
(bad-opt
|
||||
(/
|
||||
(*
|
||||
(max 3/11 3/2 -0.0f0)
|
||||
(unsafe-fl* (real->double-flonum 0.0034637533f0) (real->double-flonum 2)))
|
||||
(*
|
||||
0.47415978f0
|
||||
(max (exact-round 0) (exact-round 2) (exact-round 1.3396765f0))
|
||||
(make-rectangular +inf.0 -2.6138428f-05))))
|
||||
;; Unary division has bad underflow
|
||||
(bad-opt (/ (make-rectangular 1e+100 1e-300)))
|
||||
(bad-opt (/ 0.5+1.7e+308i))
|
||||
|
||||
(bad-opt (- (/ (ceiling 1.4821969375237e-323) (make-rectangular 1/3 -inf.0))))
|
||||
;; Division of complex 0 should only make part of the result nan
|
||||
(bad-opt (/ 0.0+0.0i))
|
||||
|
||||
(bad-opt
|
||||
(+
|
||||
(make-rectangular 2.8794524657050558e-173 -26.76011f0)
|
||||
(max (sub1 (exact-round -0.0)))
|
||||
(*
|
||||
(fltruncate (real->double-flonum 3))
|
||||
(abs (real->double-flonum -9.194802638300139))
|
||||
(real->double-flonum +inf.f))))
|
||||
|
||||
(bad-opt
|
||||
(/
|
||||
(* (fltruncate (real->double-flonum -0.0961751594300051)))
|
||||
(make-polar
|
||||
(unsafe-flmin (real->double-flonum 0) (real->double-flonum 9))
|
||||
(-
|
||||
(real->double-flonum 1.797693134862315e+308)
|
||||
(real->double-flonum 4.557755020079188e-100)
|
||||
(real->double-flonum -1.7568234f0)))))
|
||||
|
||||
(bad-opt (/ (make-rectangular (+ (real->double-flonum 7/12)) 1.7976931348623157e+308)))
|
||||
|
||||
|
||||
(bad-opt
|
||||
(+
|
||||
(truncate
|
||||
(bitwise-xor
|
||||
(exact-round 3.4584595208887e-323)
|
||||
(exact-round 41.25529f0)
|
||||
(exact-round 5)))
|
||||
(abs (exact-round 1.0117665851393622))
|
||||
(/
|
||||
(make-rectangular -inf.0 -1.7976931348623157e+308)
|
||||
(+ -22024056634.94161 -3.141574f0 0.0))))
|
||||
|
||||
(bad-opt
|
||||
(/
|
||||
(make-rectangular
|
||||
(max (real->double-flonum +inf.f) (real->double-flonum 2))
|
||||
(min (real->double-flonum 9) (real->double-flonum 1)))
|
||||
-23.447956f0))
|
||||
|
||||
(bad-opt
|
||||
(-
|
||||
(* 6/11 (/ 1.2125638f0 142778.6f0))
|
||||
(sqr (* -4))
|
||||
(make-rectangular
|
||||
(unsafe-fl* (real->double-flonum 1) (real->double-flonum 0))
|
||||
(min (real->double-flonum -0.31099018f0)))))
|
||||
|
||||
(bad-opt
|
||||
(/
|
||||
(+ (sqr 6.1239376f0) (make-rectangular -inf.f -2.4703282292062e-323))
|
||||
(max -1/8)))
|
||||
|
||||
(bad-opt
|
||||
(-
|
||||
(* -1 (+ 2 -1.863321008013001) (/ +nan.0 -3 -0.2859221f0))
|
||||
(bitwise-xor
|
||||
(exact-round -2.5171401615688167e-250)
|
||||
(exact-round 9/5)
|
||||
(add1 (exact-round 0)))
|
||||
(sinh (/ (make-rectangular 1.7976931348623155e+308 -13/21) 2))))
|
||||
|
||||
(bad-opt
|
||||
(/ (cosh (make-rectangular +inf.0 -1.7082773f0)) 8))
|
||||
|
||||
(bad-opt
|
||||
(/
|
||||
(make-rectangular
|
||||
-1.0020975423559487e+94
|
||||
(*
|
||||
(real->double-flonum 9.8813129168249e-324)
|
||||
(real->double-flonum -5/7)
|
||||
(real->double-flonum -3)))))
|
||||
|
||||
(bad-opt (sub1 (/ (make-rectangular -5.5945454f0 -inf.0))))
|
||||
|
||||
(bad-opt
|
||||
(*
|
||||
(make-rectangular -inf.0 2.360318017838172)
|
||||
(* 1 (max (exact-round 1)))
|
||||
19/13))
|
||||
|
||||
(bad-opt (/ (make-rectangular 1 +inf.0)))
|
||||
;; Division of complex infinity should only make part of the result nan
|
||||
(bad-opt (/ (make-rectangular 1.0 +inf.0)))
|
||||
(bad-opt (/ (make-rectangular +inf.0 1.0)))
|
||||
|
||||
;; Exp of large real should have 0 imaginary component
|
||||
(bad-opt (+ (exp 1.7976931348623151e+308) 0.0+0.0i))
|
||||
|
||||
;; Multiplication of multiple args should keep exact semantics for exact args
|
||||
(bad-opt (* (expt 10 500) (expt 10 -500) 1.0+1.0i))
|
||||
|
||||
;; Addition of multiple args should keep exact semantics for exact args
|
||||
(bad-opt (+ (expt 10 501) (expt -10 501) 1.0+1.0i))
|
||||
|
||||
|
||||
|
||||
;; Negation should correctly compute sign of 0.0
|
||||
(bad-opt (- (+ 0 0) 0.0+0.0i))))
|
||||
|
||||
(module+ main
|
||||
|
|
Loading…
Reference in New Issue
Block a user