\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -1.827951620185827 \cdot 10^{+18}:\\
\;\;\;\;\frac{y \cdot z}{\left(z \cdot t - x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2.8875763343058745 \cdot 10^{-46}:\\
\;\;\;\;\frac{x + \left(\left(\frac{y}{t} + \frac{x \cdot y}{t \cdot \left(z \cdot t\right)}\right) - \frac{x}{z \cdot t}\right)}{x + 1}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2.159075804414875 \cdot 10^{+307}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{t \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t)
:precision binary64
(if (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
-1.827951620185827e+18)
(/ (* y z) (* (- (* z t) x) (+ x 1.0)))
(if (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
2.8875763343058745e-46)
(/
(+ x (- (+ (/ y t) (/ (* x y) (* t (* z t)))) (/ x (* z t))))
(+ x 1.0))
(if (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
2.159075804414875e+307)
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
(-
(+ (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))
(/ x (* t (* z (+ x 1.0)))))))))double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
double code(double x, double y, double z, double t) {
double tmp;
if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= -1.827951620185827e+18) {
tmp = (y * z) / (((z * t) - x) * (x + 1.0));
} else if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 2.8875763343058745e-46) {
tmp = (x + (((y / t) + ((x * y) / (t * (z * t)))) - (x / (z * t)))) / (x + 1.0);
} else if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 2.159075804414875e+307) {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 3.2 |
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -1827951620185827070Initial program 18.9
Taylor expanded around inf 18.9
Simplified18.9
if -1827951620185827070 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.8875763343058745e-46Initial program 3.0
Taylor expanded around inf 3.3
Simplified2.3
if 2.8875763343058745e-46 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.1590758044148749e307Initial program 0.1
if 2.1590758044148749e307 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 63.9
Taylor expanded around inf 9.0
Final simplification3.2
herbie shell --seed 2021059
(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)))