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} \le -1.36370666452502506 \cdot 10^{-267} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0\right):\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\
\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)))))) <= -1.363706664525025e-267) || !(((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 0.0))) {
VAR = ((double) (x + ((double) (((double) (t - x)) * ((double) (((double) (y - z)) / ((double) (a - z))))))));
} else {
VAR = ((double) (t + ((double) (((double) (y / z)) * ((double) (x - t))))));
}
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.3 |
|---|---|
| Target | 12.0 |
| Herbie | 8.2 |
if (+ x (/ (* (- y z) (- t x)) (- a z))) < -1.36370666452502506e-267 or 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z))) Initial program 21.2
Simplified10.5
rmApplied add-cube-cbrt11.2
Applied *-un-lft-identity11.2
Applied times-frac11.2
Applied associate-*r*8.2
Simplified8.2
rmApplied pow18.2
Applied pow18.2
Applied pow-prod-down8.2
Simplified7.1
if -1.36370666452502506e-267 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0Initial program 58.1
Simplified58.2
Taylor expanded around inf 20.0
Simplified20.0
Final simplification8.2
herbie shell --seed 2020181
(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))))