(FPCore (x y z t a)
:precision binary64
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
↓
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (<= t_1 (- INFINITY))
(* 0.5 (* y (/ x a)))
(if (<= t_1 4e+307)
(+ (/ (/ (* x y) 2.0) a) (/ (* (* z t) -4.5) a))
(* -4.5 (* z (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}}
\]
Proof
(/.f64 (fma.f64 x y (*.f64 z (*.f64 t -9))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(/.f64 (fma.f64 x y (*.f64 z (*.f64 t (Rewrite<= metadata-eval (neg.f64 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(/.f64 (fma.f64 x y (*.f64 z (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 t 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(/.f64 (fma.f64 x y (*.f64 z (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(/.f64 (fma.f64 x y (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(/.f64 (fma.f64 x y (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 z 9) t)))) (*.f64 a 2)): 17 points increase in error, 8 points decrease in error
(/.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))) (*.f64 a 2)): 2 points increase in error, 1 points decrease in error
(/.f64 (-.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 (*.f64 x y) 0)) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
(Rewrite=> div-sub_binary64 (-.f64 (/.f64 (+.f64 (*.f64 x y) 0) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2)))): 2 points increase in error, 3 points decrease in error
(-.f64 (/.f64 (Rewrite=> +-rgt-identity_binary64 (*.f64 x y)) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2))): 0 points increase in error, 0 points decrease in error
(Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2))): 3 points increase in error, 2 points decrease in error
(-.f64 (*.f64 y (/.f64 x (+.f64 a a))) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y x) (+.f64 a a))) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 35 points increase in error, 31 points decrease in error
(-.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 x y)) (+.f64 a a)) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 y (+.f64 a a)))) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 33 points increase in error, 38 points decrease in error
(-.f64 (*.f64 x (/.f64 y (+.f64 a a))) (/.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 z t)) 9/2) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 x (/.f64 y (+.f64 a a))) (/.f64 (*.f64 (*.f64 z t) (Rewrite<= metadata-eval (*.f64 9 1/2))) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 x (/.f64 y (+.f64 a a))) (/.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 z t) 9) 1/2)) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 x (/.f64 y (+.f64 a a))) (/.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 9 (*.f64 z t))) 1/2) a)): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 x (/.f64 y (+.f64 a a))) (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 9 (*.f64 z t)) (/.f64 1/2 a)))): 19 points increase in error, 9 points decrease in error
(Rewrite=> fma-neg_binary64 (fma.f64 x (/.f64 y (+.f64 a a)) (neg.f64 (*.f64 (*.f64 9 (*.f64 z t)) (/.f64 1/2 a))))): 0 points increase in error, 0 points decrease in error
(fma.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 x 1)) (/.f64 y (+.f64 a a)) (neg.f64 (*.f64 (*.f64 9 (*.f64 z t)) (/.f64 1/2 a)))): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022338
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))