\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}{t \cdot z - x}}{x + 1} \le +inf.0:\\
\;\;\;\;\frac{x + \left(y \cdot \left(z \cdot \frac{1}{t \cdot z - x}\right) - \frac{x}{t \cdot z - x}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}double code(double x, double y, double z, double t) {
return (((double) (x + (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x))))) / ((double) (x + 1.0)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x + (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x))))) / ((double) (x + 1.0))) <= +inf.0)) {
VAR = (((double) (x + ((double) (((double) (y * ((double) (z * (1.0 / ((double) (((double) (t * z)) - x))))))) - (x / ((double) (((double) (t * z)) - x))))))) / ((double) (x + 1.0)));
} else {
VAR = (((double) (x + (y / t))) / ((double) (x + 1.0)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.9 |
if (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) < +inf.0Initial program 5.1
rmApplied div-sub5.1
Simplified0.9
rmApplied div-inv1.0
if +inf.0 < (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) Initial program 64.0
Taylor expanded around inf 0.0
Final simplification0.9
herbie shell --seed 2020182
(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)))