(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 (- (* z t) x)))
(if (<= (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0)) INFINITY)
(+ (/ (- x (/ x t_1)) (+ x 1.0)) (/ y (* t_1 (/ (+ x 1.0) z))))
(/ (+ x (/ y t)) (+ x 1.0)))))
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0
Initial program 4.8
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\]
Simplified4.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
\[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t \cdot z - x}, \frac{z}{x + 1}, \frac{x - \frac{x}{t \cdot z - x}}{x + 1}\right)}
\]
Proof
(fma.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (+.f64 x 1)) (/.f64 (-.f64 x (/.f64 x (-.f64 (*.f64 t z) x))) (+.f64 x 1))): 0 points increase in error, 0 points decrease in error
(fma.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (Rewrite<= +-commutative_binary64 (+.f64 1 x))) (/.f64 (-.f64 x (/.f64 x (-.f64 (*.f64 t z) x))) (+.f64 x 1))): 0 points increase in error, 0 points decrease in error
(fma.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (+.f64 1 x)) (/.f64 (-.f64 x (/.f64 x (-.f64 (*.f64 t z) x))) (Rewrite<= +-commutative_binary64 (+.f64 1 x)))): 0 points increase in error, 0 points decrease in error
(fma.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (+.f64 1 x)) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 x (+.f64 1 x)) (/.f64 (/.f64 x (-.f64 (*.f64 t z) x)) (+.f64 1 x))))): 0 points increase in error, 0 points decrease in error
(fma.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (+.f64 1 x)) (-.f64 (/.f64 x (+.f64 1 x)) (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x)))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y (-.f64 (*.f64 t z) x)) (/.f64 z (+.f64 1 x))) (-.f64 (/.f64 x (+.f64 1 x)) (/.f64 x (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x)))))): 0 points increase in error, 0 points decrease in error
(+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y z) (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x)))) (-.f64 (/.f64 x (+.f64 1 x)) (/.f64 x (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x))))): 39 points increase in error, 13 points decrease in error
(Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 (*.f64 y z) (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x))) (/.f64 x (+.f64 1 x))) (/.f64 x (*.f64 (-.f64 (*.f64 t z) x) (+.f64 1 x))))): 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))
Initial program 64.0
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\]
Simplified64.0
\[\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 2022300
(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)))