x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;t \le -8.21512428613670165 \cdot 10^{62}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \le 1.31866975863346645 \cdot 10^{-50}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{t} \cdot z + x\\
\end{array}double f(double x, double y, double z, double t) {
double r477527 = x;
double r477528 = y;
double r477529 = r477528 - r477527;
double r477530 = z;
double r477531 = r477529 * r477530;
double r477532 = t;
double r477533 = r477531 / r477532;
double r477534 = r477527 + r477533;
return r477534;
}
double f(double x, double y, double z, double t) {
double r477535 = t;
double r477536 = -8.215124286136702e+62;
bool r477537 = r477535 <= r477536;
double r477538 = y;
double r477539 = x;
double r477540 = r477538 - r477539;
double r477541 = z;
double r477542 = r477541 / r477535;
double r477543 = fma(r477540, r477542, r477539);
double r477544 = 1.3186697586334664e-50;
bool r477545 = r477535 <= r477544;
double r477546 = r477540 * r477541;
double r477547 = r477546 / r477535;
double r477548 = r477547 + r477539;
double r477549 = r477540 / r477535;
double r477550 = r477549 * r477541;
double r477551 = r477550 + r477539;
double r477552 = r477545 ? r477548 : r477551;
double r477553 = r477537 ? r477543 : r477552;
return r477553;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.7 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if t < -8.215124286136702e+62Initial program 11.1
Simplified1.3
rmApplied fma-udef1.3
rmApplied div-inv1.4
Applied associate-*l*1.3
Simplified1.3
rmApplied fma-def1.3
if -8.215124286136702e+62 < t < 1.3186697586334664e-50Initial program 2.1
Simplified14.3
rmApplied fma-udef14.3
rmApplied div-inv14.4
Applied associate-*l*3.5
Simplified3.4
rmApplied associate-*r/2.1
if 1.3186697586334664e-50 < t Initial program 8.5
Simplified1.4
rmApplied fma-udef1.4
Final simplification1.6
herbie shell --seed 2020065 +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)))