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 -2.6650803551403255 \cdot 10^{-282} \lor \neg \left(x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 1.36358456559634 \cdot 10^{-259}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}, \frac{\left(\sqrt[3]{\sqrt[3]{y - x}} \cdot \sqrt[3]{\sqrt[3]{y - x}}\right) \cdot \sqrt[3]{\sqrt[3]{y - x}}}{\sqrt[3]{a - t}} \cdot \left(z - t\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\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))) <= -2.6650803551403255e-282) || !((x + (((y - x) * (z - t)) / (a - t))) <= 1.3635845655963375e-259))) {
VAR = fma(((cbrt((y - x)) * cbrt((y - x))) / (cbrt((a - t)) * cbrt((a - t)))), ((((cbrt(cbrt((y - x))) * cbrt(cbrt((y - x)))) * cbrt(cbrt((y - x)))) / cbrt((a - t))) * (z - t)), x);
} else {
VAR = y;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 23.9 |
|---|---|
| Target | 9.3 |
| Herbie | 10.4 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -2.6650803551403255e-282 or 1.3635845655963375e-259 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 20.7
Simplified10.4
rmApplied fma-udef10.4
rmApplied add-cube-cbrt11.0
Applied add-cube-cbrt11.2
Applied times-frac11.2
Applied associate-*l*7.5
rmApplied fma-def7.5
rmApplied add-cube-cbrt7.6
if -2.6650803551403255e-282 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 1.3635845655963375e-259Initial program 55.2
Simplified55.9
Taylor expanded around 0 37.0
Final simplification10.4
herbie shell --seed 2020105 +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))))