x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} = -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, z, x\right)\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \le -2.398417684101355072336787554272342478967 \cdot 10^{-89}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}double f(double x, double y, double z, double t) {
double r294375 = x;
double r294376 = y;
double r294377 = r294376 - r294375;
double r294378 = z;
double r294379 = r294377 * r294378;
double r294380 = t;
double r294381 = r294379 / r294380;
double r294382 = r294375 + r294381;
return r294382;
}
double f(double x, double y, double z, double t) {
double r294383 = x;
double r294384 = y;
double r294385 = r294384 - r294383;
double r294386 = z;
double r294387 = r294385 * r294386;
double r294388 = t;
double r294389 = r294387 / r294388;
double r294390 = r294383 + r294389;
double r294391 = -inf.0;
bool r294392 = r294390 <= r294391;
double r294393 = r294385 / r294388;
double r294394 = fma(r294393, r294386, r294383);
double r294395 = -2.398417684101355e-89;
bool r294396 = r294390 <= r294395;
double r294397 = r294388 / r294386;
double r294398 = r294385 / r294397;
double r294399 = r294383 + r294398;
double r294400 = r294396 ? r294390 : r294399;
double r294401 = r294392 ? r294394 : r294400;
return r294401;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.3 |
|---|---|
| Target | 2.2 |
| Herbie | 1.5 |
if (+ x (/ (* (- y x) z) t)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
rmApplied *-un-lft-identity64.0
Applied *-un-lft-identity64.0
Applied distribute-lft-out64.0
Simplified0.2
if -inf.0 < (+ x (/ (* (- y x) z) t)) < -2.398417684101355e-89Initial program 0.2
rmApplied *-un-lft-identity0.2
if -2.398417684101355e-89 < (+ x (/ (* (- y x) z) t)) Initial program 5.7
rmApplied associate-/l*2.4
Final simplification1.5
herbie shell --seed 2019323 +o rules:numerics
(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)))