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 r357718 = x;
double r357719 = y;
double r357720 = r357719 - r357718;
double r357721 = z;
double r357722 = r357720 * r357721;
double r357723 = t;
double r357724 = r357722 / r357723;
double r357725 = r357718 + r357724;
return r357725;
}
double f(double x, double y, double z, double t) {
double r357726 = x;
double r357727 = y;
double r357728 = r357727 - r357726;
double r357729 = z;
double r357730 = r357728 * r357729;
double r357731 = t;
double r357732 = r357730 / r357731;
double r357733 = r357726 + r357732;
double r357734 = -inf.0;
bool r357735 = r357733 <= r357734;
double r357736 = r357728 / r357731;
double r357737 = fma(r357736, r357729, r357726);
double r357738 = -2.398417684101355e-89;
bool r357739 = r357733 <= r357738;
double r357740 = r357731 / r357729;
double r357741 = r357728 / r357740;
double r357742 = r357726 + r357741;
double r357743 = r357739 ? r357733 : r357742;
double r357744 = r357735 ? r357737 : r357743;
return r357744;
}




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
Simplified0.2
if -inf.0 < (+ x (/ (* (- y x) z) t)) < -2.398417684101355e-89Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac2.2
Simplified2.2
rmApplied associate-*r/0.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)))