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} = -inf.0:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -7.96166522638044944 \cdot 10^{-261}:\\
\;\;\;\;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(t + \frac{x \cdot y}{z}\right) - \frac{t \cdot y}{z}\\
\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 1.7240747028308507 \cdot 10^{308}:\\
\;\;\;\;x + \left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + (((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) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= -inf.0)) {
VAR = ((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z)))))));
} else {
double VAR_1;
if ((((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= -7.961665226380449e-261)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) * (1.0 / ((double) (a - z)))))));
} else {
double VAR_2;
if ((((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= 0.0)) {
VAR_2 = ((double) (((double) (t + (((double) (x * y)) / z))) - (((double) (t * y)) / z)));
} else {
double VAR_3;
if ((((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= 1.7240747028308507e+308)) {
VAR_3 = ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) * (1.0 / ((double) (a - z)))))));
} else {
VAR_3 = ((double) (t + ((double) (y * ((double) ((x / z) - (t / 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 | 25.1 |
|---|---|
| Target | 12.7 |
| Herbie | 9.4 |
if (+ x (/ (* (- y z) (- t x)) (- a z))) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac17.6
Simplified17.6
if -inf.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) < -7.96166522638044944e-261 or 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 1.7240747028308507e308Initial program 2.2
rmApplied div-inv2.3
if -7.96166522638044944e-261 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0Initial program 57.0
Taylor expanded around inf 19.0
if 1.7240747028308507e308 < (+ x (/ (* (- y z) (- t x)) (- a z))) Initial program 64.0
rmApplied add-cube-cbrt64.0
Applied times-frac17.5
rmApplied add-cube-cbrt17.7
Applied associate-*r*17.7
Taylor expanded around inf 40.6
Simplified25.8
Final simplification9.4
herbie shell --seed 2020182
(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))))