x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} = -\infty:\\
\;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\
\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -5.157365203149612 \cdot 10^{-306}:\\
\;\;\;\;x + \left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}\\
\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\
\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 4.96462431694059473 \cdot 10^{305}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= -inf.0)) {
VAR = ((double) (((double) (y * ((double) (((double) (x / z)) - ((double) (t / z)))))) + t));
} else {
double VAR_1;
if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= -5.157365203149612e-306)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) * ((double) (1.0 / ((double) (a - z))))))));
} else {
double VAR_2;
if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 0.0)) {
VAR_2 = ((double) (((double) (((double) (((double) (x * y)) / z)) + t)) - ((double) (((double) (t * y)) / z))));
} else {
double VAR_3;
if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 4.964624316940595e+305)) {
VAR_3 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
} else {
VAR_3 = ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.4 |
|---|---|
| Target | 12.2 |
| Herbie | 9.1 |
if (+ x (/ (* (- y z) (- t x)) (- a z))) < -inf.0Initial program 64.0
rmApplied add-cube-cbrt64.0
Applied times-frac17.6
rmApplied add-cube-cbrt17.8
Applied associate-*l*17.8
Taylor expanded around inf 40.5
Simplified27.8
if -inf.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) < -5.157365203149612e-306Initial program 1.8
rmApplied div-inv1.9
if -5.157365203149612e-306 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0Initial program 60.8
Taylor expanded around inf 17.9
if 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 4.964624316940595e+305Initial program 1.8
if 4.964624316940595e+305 < (+ x (/ (* (- y z) (- t x)) (- a z))) Initial program 63.6
rmApplied *-un-lft-identity63.6
Applied times-frac17.4
Simplified17.4
Final simplification9.1
herbie shell --seed 2020120
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))