x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -6.7754897102361347 \cdot 10^{-49} \lor \neg \left(a \le 1.6801047980398177 \cdot 10^{-165}\right):\\
\;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{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 (((a <= -6.775489710236135e-49) || !(a <= 1.6801047980398177e-165))) {
VAR = (x + ((y - x) / ((a / (z - t)) - (t / (z - t)))));
} else {
VAR = ((y + ((x * z) / t)) - ((z * y) / 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.9 |
|---|---|
| Target | 9.5 |
| Herbie | 11.0 |
if a < -6.775489710236135e-49 or 1.6801047980398177e-165 < a Initial program 22.9
rmApplied associate-/l*8.9
rmApplied div-sub8.9
if -6.775489710236135e-49 < a < 1.6801047980398177e-165Initial program 29.8
Taylor expanded around inf 16.3
Final simplification11.0
herbie shell --seed 2020103
(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))))