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(y - x, \frac{z}{t}, x\right)\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \le 1.34935661525439967 \cdot 10^{112}:\\
\;\;\;\;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 r425255 = x;
double r425256 = y;
double r425257 = r425256 - r425255;
double r425258 = z;
double r425259 = r425257 * r425258;
double r425260 = t;
double r425261 = r425259 / r425260;
double r425262 = r425255 + r425261;
return r425262;
}
double f(double x, double y, double z, double t) {
double r425263 = x;
double r425264 = y;
double r425265 = r425264 - r425263;
double r425266 = z;
double r425267 = r425265 * r425266;
double r425268 = t;
double r425269 = r425267 / r425268;
double r425270 = r425263 + r425269;
double r425271 = -inf.0;
bool r425272 = r425270 <= r425271;
double r425273 = r425266 / r425268;
double r425274 = fma(r425265, r425273, r425263);
double r425275 = 1.3493566152543997e+112;
bool r425276 = r425270 <= r425275;
double r425277 = r425268 / r425266;
double r425278 = r425265 / r425277;
double r425279 = r425263 + r425278;
double r425280 = r425276 ? r425270 : r425279;
double r425281 = r425272 ? r425274 : r425280;
return r425281;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.5 |
|---|---|
| Target | 2.0 |
| Herbie | 1.3 |
if (+ x (/ (* (- y x) z) t)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.2
Simplified0.2
Taylor expanded around 0 64.0
Simplified0.2
if -inf.0 < (+ x (/ (* (- y x) z) t)) < 1.3493566152543997e+112Initial program 1.0
if 1.3493566152543997e+112 < (+ x (/ (* (- y x) z) t)) Initial program 12.1
rmApplied associate-/l*2.4
Final simplification1.3
herbie shell --seed 2020035 +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)))