(FPCore (x y z t)
:precision binary64
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))
(t_2 (/ x (+ x 1.0)))
(t_3 (+ (/ y (* t (+ x 1.0))) (- t_2 (/ t_2 (* z t))))))
(if (<= t_1 (- INFINITY)) t_3 (if (<= t_1 5e+190) t_1 t_3))))
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -inf.0 or 5.00000000000000036e190 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))
Initial program 52.7
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\]
Simplified52.7
\[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}}
\]
Proof
(/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 z t) x))) (+.f64 x 1)): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 t z)) x))) (+.f64 x 1)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (*.f64 t (+.f64 x 1))) (-.f64 (/.f64 x (+.f64 x 1)) (/.f64 (/.f64 x (+.f64 x 1)) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (*.f64 t (Rewrite<= +-commutative_binary64 (+.f64 1 x)))) (-.f64 (/.f64 x (+.f64 x 1)) (/.f64 (/.f64 x (+.f64 x 1)) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 1 x) t))) (-.f64 (/.f64 x (+.f64 x 1)) (/.f64 (/.f64 x (+.f64 x 1)) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (*.f64 (+.f64 1 x) t)) (-.f64 (/.f64 x (Rewrite<= +-commutative_binary64 (+.f64 1 x))) (/.f64 (/.f64 x (+.f64 x 1)) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (*.f64 (+.f64 1 x) t)) (-.f64 (/.f64 x (+.f64 1 x)) (/.f64 (/.f64 x (Rewrite<= +-commutative_binary64 (+.f64 1 x))) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 y (*.f64 (+.f64 1 x) t)) (-.f64 (/.f64 x (+.f64 1 x)) (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 (+.f64 1 x) (*.f64 t z)))))): 5 points increase in error, 12 points decrease in error
(Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 y (*.f64 (+.f64 1 x) t)) (/.f64 x (+.f64 1 x))) (/.f64 x (*.f64 (+.f64 1 x) (*.f64 t z))))): 1 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 x (+.f64 1 x)) (/.f64 y (*.f64 (+.f64 1 x) t)))) (/.f64 x (*.f64 (+.f64 1 x) (*.f64 t z)))): 0 points increase in error, 0 points decrease in error
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5.00000000000000036e190
Initial program 0.8
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\]
Simplified0.8
\[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}}
\]
Proof
(/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 z t) x))) (+.f64 x 1)): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 t z)) x))) (+.f64 x 1)): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022295
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))