x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x \le -8.197251181992450336177184911706312715011 \cdot 10^{-110} \lor \neg \left(x \le 1.163685728587467934538355368329212838924 \cdot 10^{-252}\right):\\
\;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r343357 = x;
double r343358 = y;
double r343359 = r343358 - r343357;
double r343360 = z;
double r343361 = r343359 * r343360;
double r343362 = t;
double r343363 = r343361 / r343362;
double r343364 = r343357 + r343363;
return r343364;
}
double f(double x, double y, double z, double t) {
double r343365 = x;
double r343366 = -8.19725118199245e-110;
bool r343367 = r343365 <= r343366;
double r343368 = 1.163685728587468e-252;
bool r343369 = r343365 <= r343368;
double r343370 = !r343369;
bool r343371 = r343367 || r343370;
double r343372 = z;
double r343373 = t;
double r343374 = r343372 / r343373;
double r343375 = y;
double r343376 = r343375 - r343365;
double r343377 = r343374 * r343376;
double r343378 = r343365 + r343377;
double r343379 = r343376 * r343372;
double r343380 = r343379 / r343373;
double r343381 = r343380 + r343365;
double r343382 = r343371 ? r343378 : r343381;
return r343382;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.0 |
| Herbie | 1.9 |
if x < -8.19725118199245e-110 or 1.163685728587468e-252 < x Initial program 7.0
Simplified6.8
rmApplied div-inv6.8
rmApplied add-cube-cbrt7.2
Applied associate-*r*7.2
Simplified7.2
Taylor expanded around inf 7.0
Simplified1.2
if -8.19725118199245e-110 < x < 1.163685728587468e-252Initial program 4.5
Simplified5.6
rmApplied div-inv5.7
rmApplied fma-udef5.7
Simplified4.5
Final simplification1.9
herbie shell --seed 2019305 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.0255111955330046e-135) (- x (* (/ z t) (- x y))) (if (< x 4.2750321637007147e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))