x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} = -\infty \lor \neg \left(x + \frac{\left(y - x\right) \cdot z}{t} \le 7.47453856091499786 \cdot 10^{296}\right):\\
\;\;\;\;\frac{y - x}{t} \cdot z + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}double f(double x, double y, double z, double t) {
double r606600 = x;
double r606601 = y;
double r606602 = r606601 - r606600;
double r606603 = z;
double r606604 = r606602 * r606603;
double r606605 = t;
double r606606 = r606604 / r606605;
double r606607 = r606600 + r606606;
return r606607;
}
double f(double x, double y, double z, double t) {
double r606608 = x;
double r606609 = y;
double r606610 = r606609 - r606608;
double r606611 = z;
double r606612 = r606610 * r606611;
double r606613 = t;
double r606614 = r606612 / r606613;
double r606615 = r606608 + r606614;
double r606616 = -inf.0;
bool r606617 = r606615 <= r606616;
double r606618 = 7.474538560914998e+296;
bool r606619 = r606615 <= r606618;
double r606620 = !r606619;
bool r606621 = r606617 || r606620;
double r606622 = r606610 / r606613;
double r606623 = r606622 * r606611;
double r606624 = r606623 + r606608;
double r606625 = r606621 ? r606624 : r606615;
return r606625;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 2.3 |
| Herbie | 1.0 |
if (+ x (/ (* (- y x) z) t)) < -inf.0 or 7.474538560914998e+296 < (+ x (/ (* (- y x) z) t)) Initial program 58.1
rmApplied associate-/l*0.4
rmApplied div-inv0.5
Applied *-un-lft-identity0.5
Applied times-frac58.1
Simplified58.1
rmApplied *-un-lft-identity58.1
Applied *-un-lft-identity58.1
Applied times-frac58.1
Applied associate-*l*58.1
Simplified2.8
if -inf.0 < (+ x (/ (* (- y x) z) t)) < 7.474538560914998e+296Initial program 0.8
Final simplification1.0
herbie shell --seed 2020042
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))