x + \left(y - x\right) \cdot \frac{z}{t}\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)double f(double x, double y, double z, double t) {
double r20271668 = x;
double r20271669 = y;
double r20271670 = r20271669 - r20271668;
double r20271671 = z;
double r20271672 = t;
double r20271673 = r20271671 / r20271672;
double r20271674 = r20271670 * r20271673;
double r20271675 = r20271668 + r20271674;
return r20271675;
}
double f(double x, double y, double z, double t) {
double r20271676 = z;
double r20271677 = t;
double r20271678 = r20271676 / r20271677;
double r20271679 = y;
double r20271680 = x;
double r20271681 = r20271679 - r20271680;
double r20271682 = fma(r20271678, r20271681, r20271680);
return r20271682;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 1.8 |
|---|---|
| Target | 2.0 |
| Herbie | 1.8 |
Initial program 1.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2019171 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ 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))))