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 -1.6037434565059096 \cdot 10^{-237}:\\
\;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{\frac{a - t}{\sqrt[3]{z - t}}} \cdot \sqrt[3]{\frac{a - t}{\sqrt[3]{z - t}}}} \cdot \frac{y - x}{\sqrt[3]{\frac{a - t}{\sqrt[3]{z - t}}}}\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 0.0:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - x) * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((x + (((y - x) * (z - t)) / (a - t))) <= -1.6037434565059096e-237)) {
VAR = (x + (((cbrt((z - t)) * cbrt((z - t))) / (cbrt(((a - t) / cbrt((z - t)))) * cbrt(((a - t) / cbrt((z - t)))))) * ((y - x) / cbrt(((a - t) / cbrt((z - t)))))));
} else {
double VAR_1;
if (((x + (((y - x) * (z - t)) / (a - t))) <= 0.0)) {
VAR_1 = ((y + ((x * z) / t)) - ((z * y) / t));
} else {
VAR_1 = (x + ((y - x) * ((z - t) / (a - 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.0 |
|---|---|
| Target | 9.4 |
| Herbie | 9.1 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -1.6037434565059096e-237Initial program 21.6
rmApplied associate-/l*7.7
rmApplied add-cube-cbrt8.5
Applied *-un-lft-identity8.5
Applied times-frac8.5
Applied *-un-lft-identity8.5
Applied times-frac9.5
Simplified9.5
rmApplied add-cube-cbrt9.7
Applied *-un-lft-identity9.7
Applied times-frac9.6
Applied associate-*r*8.5
Simplified8.5
if -1.6037434565059096e-237 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 0.0Initial program 53.8
Taylor expanded around inf 22.4
if 0.0 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 20.5
rmApplied *-un-lft-identity20.5
Applied times-frac7.0
Simplified7.0
Final simplification9.1
herbie shell --seed 2020079
(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))))