x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;z \le -9.321316198184014864250290572846970188364 \cdot 10^{-37} \lor \neg \left(z \le 2.048461183832285343472596302907101930479 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{y - x}{t} \cdot z + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}double f(double x, double y, double z, double t) {
double r333354 = x;
double r333355 = y;
double r333356 = r333355 - r333354;
double r333357 = z;
double r333358 = t;
double r333359 = r333357 / r333358;
double r333360 = r333356 * r333359;
double r333361 = r333354 + r333360;
return r333361;
}
double f(double x, double y, double z, double t) {
double r333362 = z;
double r333363 = -9.321316198184015e-37;
bool r333364 = r333362 <= r333363;
double r333365 = 2.0484611838322853e-167;
bool r333366 = r333362 <= r333365;
double r333367 = !r333366;
bool r333368 = r333364 || r333367;
double r333369 = y;
double r333370 = x;
double r333371 = r333369 - r333370;
double r333372 = t;
double r333373 = r333371 / r333372;
double r333374 = r333373 * r333362;
double r333375 = r333374 + r333370;
double r333376 = r333371 * r333362;
double r333377 = r333376 / r333372;
double r333378 = r333370 + r333377;
double r333379 = r333368 ? r333375 : r333378;
return r333379;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if z < -9.321316198184015e-37 or 2.0484611838322853e-167 < z Initial program 2.5
Simplified2.5
rmApplied fma-udef2.5
rmApplied div-inv2.5
Applied associate-*l*2.8
Simplified2.7
if -9.321316198184015e-37 < z < 2.0484611838322853e-167Initial program 1.4
Simplified1.4
rmApplied fma-udef1.4
rmApplied *-un-lft-identity1.4
Applied *-un-lft-identity1.4
Applied times-frac1.4
Applied associate-*l*1.4
Simplified1.2
Final simplification2.1
herbie shell --seed 2019174 +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))))