x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;z \le 3.29194830615707638 \cdot 10^{-308} \lor \neg \left(z \le 2.88733508478686524 \cdot 10^{205}\right):\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\sqrt{z} \cdot \left(y - x\right)\right) \cdot \frac{\sqrt{z}}{t}\\
\end{array}double code(double x, double y, double z, double t) {
return (x + ((y - x) * (z / t)));
}
double code(double x, double y, double z, double t) {
double temp;
if (((z <= 3.2919483061570764e-308) || !(z <= 2.8873350847868652e+205))) {
temp = (x + ((y - x) * (z / t)));
} else {
temp = (x + ((sqrt(z) * (y - x)) * (sqrt(z) / t)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.5 |
| Herbie | 2.4 |
if z < 3.2919483061570764e-308 or 2.8873350847868652e+205 < z Initial program 2.6
if 3.2919483061570764e-308 < z < 2.8873350847868652e+205Initial program 1.8
rmApplied *-un-lft-identity1.8
Applied add-sqr-sqrt2.0
Applied times-frac2.0
Applied associate-*r*2.3
Simplified2.3
Final simplification2.4
herbie shell --seed 2020060
(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))))