x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le -6.20432 \cdot 10^{277}:\\
\;\;\;\;\left(\left(\left(-\left(z - t\right)\right) \cdot \frac{x}{a - t} + \frac{y}{a - t} \cdot z\right) + \frac{y}{a - t} \cdot \left(-t\right)\right) + x\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le -7.085349948856307 \cdot 10^{-302}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 0.0:\\
\;\;\;\;y\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 1.2247868798824063 \cdot 10^{294}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t} - \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{a - t}}, z - t, x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= -6.204318022337247e+277)) {
VAR = ((double) (((double) (((double) (((double) (((double) -(((double) (z - t)))) * ((double) (x / ((double) (a - t)))))) + ((double) (((double) (y / ((double) (a - t)))) * z)))) + ((double) (((double) (y / ((double) (a - t)))) * ((double) -(t)))))) + x));
} else {
double VAR_1;
if ((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= -7.085349948856307e-302)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
} else {
double VAR_2;
if ((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 0.0)) {
VAR_2 = y;
} else {
double VAR_3;
if ((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 1.2247868798824063e+294)) {
VAR_3 = ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
} else {
VAR_3 = ((double) fma(((double) (((double) (y / ((double) (a - t)))) - ((double) (((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) / ((double) (((double) cbrt(((double) (a - t)))) * ((double) cbrt(((double) (a - t)))))))) * ((double) (((double) cbrt(x)) / ((double) cbrt(((double) (a - t)))))))))), ((double) (z - t)), x));
}
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.7 |
|---|---|
| Target | 9.7 |
| Herbie | 9.9 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -6.204318022337247e+277Initial program 57.9
Simplified18.4
rmApplied div-sub18.4
rmApplied add-cube-cbrt18.5
Applied *-un-lft-identity18.5
Applied times-frac18.5
rmApplied fma-udef18.5
Simplified18.4
if -6.204318022337247e+277 < (+ x (/ (* (- y x) (- z t)) (- a t))) < -7.085349948856307e-302 or 0.0 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 1.2247868798824063e+294Initial program 1.9
if -7.085349948856307e-302 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 0.0Initial program 61.0
Simplified60.8
Taylor expanded around 0 35.7
if 1.2247868798824063e+294 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 61.8
Simplified18.2
rmApplied div-sub18.2
rmApplied add-cube-cbrt18.3
Applied add-cube-cbrt18.4
Applied times-frac18.4
Final simplification9.9
herbie shell --seed 2020113 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))