x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x \le -1.07053695690361482 \cdot 10^{-168} \lor \neg \left(x \le 1.92427481921363205 \cdot 10^{-122}\right):\\
\;\;\;\;1 \cdot \mathsf{fma}\left(\frac{z}{t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{t}{y - x}}{z}} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r427183 = x;
double r427184 = y;
double r427185 = r427184 - r427183;
double r427186 = z;
double r427187 = r427185 * r427186;
double r427188 = t;
double r427189 = r427187 / r427188;
double r427190 = r427183 + r427189;
return r427190;
}
double f(double x, double y, double z, double t) {
double r427191 = x;
double r427192 = -1.0705369569036148e-168;
bool r427193 = r427191 <= r427192;
double r427194 = 1.924274819213632e-122;
bool r427195 = r427191 <= r427194;
double r427196 = !r427195;
bool r427197 = r427193 || r427196;
double r427198 = 1.0;
double r427199 = z;
double r427200 = t;
double r427201 = r427199 / r427200;
double r427202 = y;
double r427203 = r427202 - r427191;
double r427204 = fma(r427201, r427203, r427191);
double r427205 = r427198 * r427204;
double r427206 = r427200 / r427203;
double r427207 = r427206 / r427199;
double r427208 = r427198 / r427207;
double r427209 = r427208 + r427191;
double r427210 = r427197 ? r427205 : r427209;
return r427210;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.7 |
|---|---|
| Target | 1.9 |
| Herbie | 2.0 |
if x < -1.0705369569036148e-168 or 1.924274819213632e-122 < x Initial program 7.4
Simplified7.1
rmApplied clear-num7.1
rmApplied fma-udef7.1
Simplified6.4
rmApplied *-un-lft-identity6.4
Applied *-un-lft-identity6.4
Applied distribute-lft-out6.4
Simplified0.6
if -1.0705369569036148e-168 < x < 1.924274819213632e-122Initial program 5.2
Simplified5.5
rmApplied clear-num5.7
rmApplied fma-udef5.7
Simplified5.3
rmApplied clear-num5.3
Final simplification2.0
herbie shell --seed 2020021 +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)))