\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 -4.980687448045208 \cdot 10^{+287} \lor \neg \left(\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 3.678624921963633 \cdot 10^{+302}\right):\\
\;\;\;\;\left(\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{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 (or (<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
-4.980687448045208e+287)
(not
(<=
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
3.678624921963633e+302)))
(- (+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))) (/ x (* t (* z (+ x 1.0)))))
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ 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)) <= -4.980687448045208e+287) || !(((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= 3.678624921963633e+302)) {
tmp = ((x / (x + 1.0)) + (y / (t * (x + 1.0)))) - (x / (t * (z * (x + 1.0))));
} else {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.4 |
|---|---|
| Target | 0.3 |
| Herbie | 2.0 |
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.9806874480452081e287 or 3.678624921963633e302 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 62.1
Taylor expanded around inf 12.2
Simplified12.2
if -4.9806874480452081e287 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 3.678624921963633e302Initial program 0.7
Final simplification2.0
herbie shell --seed 2021042
(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)))