Revert div-by-0 fix. Breaks other things.
This commit is contained in:
parent
63e26cf17a
commit
d50ccec0b9
|
@ -126,23 +126,14 @@
|
|||
(values (unsafe-fl/ (unsafe-fl+ b (unsafe-fl* a r)) den)
|
||||
i)))
|
||||
|
||||
(cond [second-non-float
|
||||
;; two possibilities:
|
||||
;; - if first-non-float:
|
||||
;; we haven't hit float operands, so we shouldn't coerce to float yet
|
||||
;; (implies that they're both real)
|
||||
;; - if not first-non-float:
|
||||
;; we're dividing by something that is not a float, and thus may be
|
||||
;; exact 0, so we shouldn't coerce, to trigger a div-by-0 error if
|
||||
;; need be
|
||||
;; so either way, don't optimize
|
||||
(when first-non-float
|
||||
(unless both-real?
|
||||
(int-err "optimizer: complex division, non-floats not real")))
|
||||
(cond [(and first-non-float second-non-float)
|
||||
;; we haven't hit float operands, so we shouldn't coerce to float yet
|
||||
;; (implies that they're both real)
|
||||
(unless both-real?
|
||||
(int-err "optimizer: complex division, non-floats not real"))
|
||||
#`[(#,(mark-as-non-float res-real res-real)
|
||||
#,(mark-as-real res-imag)) ; this case implies a real result
|
||||
(values (/ #,(or first-non-float a)
|
||||
#,second-non-float)
|
||||
#,(mark-as-real res-imag)) ; this case implies real
|
||||
(values (/ #,first-non-float #,second-non-float)
|
||||
0.0)]]
|
||||
[both-real?
|
||||
#`[(#,res-real #,(mark-as-real res-imag))
|
||||
|
|
Loading…
Reference in New Issue
Block a user