\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 -9.9994706219759 \cdot 10^{+306}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1} - \frac{x}{z + x \cdot z}}{t}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 1.864267776294181 \cdot 10^{+223}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(\frac{y}{t} + \left(\frac{x}{t \cdot \left(z \cdot t\right)} \cdot \left(y - \frac{x}{z}\right) - \frac{x}{z \cdot t}\right)\right)}{x + 1}\\
\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))
-9.9994706219759e+306)
(+ (/ x (+ x 1.0)) (/ (- (/ y (+ x 1.0)) (/ x (+ z (* x z)))) t))
(if (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
1.864267776294181e+223)
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
(/
(+ x (+ (/ y t) (- (* (/ x (* t (* z t))) (- y (/ x z))) (/ x (* z t)))))
(+ 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)) <= -9.9994706219759e+306) {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z + (x * z)))) / t);
} else if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 1.864267776294181e+223) {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = (x + ((y / t) + (((x / (t * (z * t))) * (y - (x / z))) - (x / (z * t))))) / (x + 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 2.5 |
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -9.9994706219759e306Initial program 63.5
Taylor expanded around inf 21.3
Simplified21.3
Taylor expanded around 0 21.3
Simplified21.3
if -9.9994706219759e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1.864267776294181e223Initial program 0.6
if 1.864267776294181e223 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 56.6
Taylor expanded around inf 30.9
Simplified13.9
Final simplification2.5
herbie shell --seed 2021098
(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)))