x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \le 3.2897350745799706 \cdot 10^{215}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{t}, 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 r585255 = x;
double r585256 = y;
double r585257 = r585256 - r585255;
double r585258 = z;
double r585259 = t;
double r585260 = r585258 / r585259;
double r585261 = r585257 * r585260;
double r585262 = r585255 + r585261;
return r585262;
}
double f(double x, double y, double z, double t) {
double r585263 = z;
double r585264 = t;
double r585265 = r585263 / r585264;
double r585266 = 3.2897350745799706e+215;
bool r585267 = r585265 <= r585266;
double r585268 = y;
double r585269 = x;
double r585270 = r585268 - r585269;
double r585271 = fma(r585270, r585265, r585269);
double r585272 = r585270 * r585263;
double r585273 = r585272 / r585264;
double r585274 = r585273 + r585269;
double r585275 = r585267 ? r585271 : r585274;
return r585275;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 2.2 |
|---|---|
| Target | 2.5 |
| Herbie | 1.5 |
if (/ z t) < 3.2897350745799706e+215Initial program 1.5
Simplified1.5
if 3.2897350745799706e+215 < (/ z t) Initial program 25.9
Simplified25.9
rmApplied fma-udef25.9
rmApplied associate-*r/0.5
Final simplification1.5
herbie shell --seed 2020060 +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))))