x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;t \le -3.022362617005285 \cdot 10^{-154}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;t \le 1.55312046934753671 \cdot 10^{36}:\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\sqrt{t}} \cdot \frac{z}{\sqrt{t}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -3.022362617005285e-154)) {
VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
} else {
double VAR_1;
if ((t <= 1.5531204693475367e+36)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (z * y)) / t)) - ((double) (((double) (x * z)) / t))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) / ((double) sqrt(t)))) * ((double) (z / ((double) sqrt(t))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.4 |
| Herbie | 1.5 |
if t < -3.022362617005285e-154Initial program 1.4
if -3.022362617005285e-154 < t < 1.55312046934753671e36Initial program 4.0
rmApplied add-cube-cbrt4.8
Applied *-un-lft-identity4.8
Applied times-frac4.8
Applied associate-*r*10.4
Simplified10.4
Taylor expanded around 0 2.2
if 1.55312046934753671e36 < t Initial program 1.6
rmApplied add-sqr-sqrt1.7
Applied *-un-lft-identity1.7
Applied times-frac1.7
Applied associate-*r*0.7
Simplified0.7
Final simplification1.5
herbie shell --seed 2020175
(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.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))))