x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x \le -2.7932208206939209 \cdot 10^{-119} \lor \neg \left(x \le 1.849643447572145 \cdot 10^{-145}\right):\\
\;\;\;\;1 \cdot \mathsf{fma}\left(\frac{z}{t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y - x}} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r435166 = x;
double r435167 = y;
double r435168 = r435167 - r435166;
double r435169 = z;
double r435170 = r435168 * r435169;
double r435171 = t;
double r435172 = r435170 / r435171;
double r435173 = r435166 + r435172;
return r435173;
}
double f(double x, double y, double z, double t) {
double r435174 = x;
double r435175 = -2.793220820693921e-119;
bool r435176 = r435174 <= r435175;
double r435177 = 1.849643447572145e-145;
bool r435178 = r435174 <= r435177;
double r435179 = !r435178;
bool r435180 = r435176 || r435179;
double r435181 = 1.0;
double r435182 = z;
double r435183 = t;
double r435184 = r435182 / r435183;
double r435185 = y;
double r435186 = r435185 - r435174;
double r435187 = fma(r435184, r435186, r435174);
double r435188 = r435181 * r435187;
double r435189 = r435183 / r435186;
double r435190 = r435182 / r435189;
double r435191 = r435190 + r435174;
double r435192 = r435180 ? r435188 : r435191;
return r435192;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.4 |
|---|---|
| Target | 2.1 |
| Herbie | 2.1 |
if x < -2.793220820693921e-119 or 1.849643447572145e-145 < x Initial program 6.8
Simplified7.6
rmApplied clear-num7.7
rmApplied fma-udef7.7
Simplified6.8
rmApplied *-un-lft-identity6.8
Applied *-un-lft-identity6.8
Applied distribute-lft-out6.8
Simplified0.7
if -2.793220820693921e-119 < x < 1.849643447572145e-145Initial program 5.5
Simplified5.2
rmApplied clear-num5.5
rmApplied fma-udef5.5
Simplified5.1
Final simplification2.1
herbie shell --seed 2020036 +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)))