x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;x \le -1.370918042146381127285332195867531032316 \cdot 10^{-76} \lor \neg \left(x \le 1.78843006131791689904510956091429861366 \cdot 10^{49}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1 \cdot \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}double f(double x, double y, double z, double t) {
double r668979 = x;
double r668980 = y;
double r668981 = r668980 - r668979;
double r668982 = z;
double r668983 = t;
double r668984 = r668982 / r668983;
double r668985 = r668981 * r668984;
double r668986 = r668979 + r668985;
return r668986;
}
double f(double x, double y, double z, double t) {
double r668987 = x;
double r668988 = -1.3709180421463811e-76;
bool r668989 = r668987 <= r668988;
double r668990 = 1.788430061317917e+49;
bool r668991 = r668987 <= r668990;
double r668992 = !r668991;
bool r668993 = r668989 || r668992;
double r668994 = z;
double r668995 = t;
double r668996 = r668994 / r668995;
double r668997 = y;
double r668998 = r668997 - r668987;
double r668999 = fma(r668996, r668998, r668987);
double r669000 = 1.0;
double r669001 = r668998 * r668994;
double r669002 = r669001 / r668995;
double r669003 = r669000 * r669002;
double r669004 = r668987 + r669003;
double r669005 = r668993 ? r668999 : r669004;
return r669005;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 2.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.4 |
if x < -1.3709180421463811e-76 or 1.788430061317917e+49 < x Initial program 0.2
rmApplied *-commutative0.2
Taylor expanded around 0 9.2
Simplified0.2
if -1.3709180421463811e-76 < x < 1.788430061317917e+49Initial program 3.6
rmApplied *-commutative3.6
rmApplied *-un-lft-identity3.6
Applied associate-*l*3.6
Simplified4.4
Final simplification2.4
herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.887) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))