x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -4.5719742657633988 \cdot 10^{124}:\\
\;\;\;\;y + \frac{z}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;t \le 5.6077084680207815 \cdot 10^{178}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot \left(\sqrt[3]{z - t} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}\right)\right) \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\\
\mathbf{else}:\\
\;\;\;\;y + \left(z \cdot \frac{x}{t} - y \cdot \frac{z}{t}\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 ((t <= -4.571974265763399e+124)) {
VAR = ((double) (y + ((double) (((double) (z / t)) * ((double) (x - y))))));
} else {
double VAR_1;
if ((t <= 5.6077084680207815e+178)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (((double) cbrt(((double) (z - t)))) * ((double) (((double) cbrt(((double) (z - t)))) / ((double) (((double) cbrt(((double) (a - t)))) * ((double) cbrt(((double) (a - t)))))))))))) * ((double) (((double) cbrt(((double) (z - t)))) / ((double) cbrt(((double) (a - t))))))))));
} else {
VAR_1 = ((double) (y + ((double) (((double) (z * ((double) (x / t)))) - ((double) (y * ((double) (z / t))))))));
}
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.3 |
|---|---|
| Target | 9.5 |
| Herbie | 9.6 |
if t < -4.5719742657633988e124Initial program 47.1
Simplified22.5
Taylor expanded around inf 26.9
Simplified16.6
if -4.5719742657633988e124 < t < 5.6077084680207815e178Initial program 14.4
Simplified7.3
rmApplied add-cube-cbrt7.9
Applied add-cube-cbrt7.9
Applied times-frac7.9
Applied associate-*r*7.0
Simplified7.0
if 5.6077084680207815e178 < t Initial program 48.3
Simplified24.4
rmApplied add-cube-cbrt25.2
Applied add-cube-cbrt24.7
Applied times-frac24.7
Applied associate-*r*24.7
Simplified24.8
Taylor expanded around inf 25.2
Simplified15.1
Final simplification9.6
herbie shell --seed 2020181
(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.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))