x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.16771796279353043 \cdot 10^{-218}:\\
\;\;\;\;x + \frac{y - x}{\frac{a - t}{z - t}}\\
\mathbf{elif}\;a \le 4.08783574424685039 \cdot 10^{-156}:\\
\;\;\;\;\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 ((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 ((a <= -2.1677179627935304e-218)) {
VAR = ((double) (x + ((double) (((double) (y - x)) / ((double) (((double) (a - t)) / ((double) (z - t))))))));
} else {
double VAR_1;
if ((a <= 4.0878357442468504e-156)) {
VAR_1 = ((double) (((double) (y + ((double) (((double) (x * z)) / t)))) - ((double) (((double) (z * y)) / t))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (y - x)) * ((double) (((double) (z - t)) / ((double) (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.5 |
|---|---|
| Target | 9.2 |
| Herbie | 10.3 |
if a < -2.16771796279353043e-218Initial program 23.8
rmApplied associate-/l*10.6
if -2.16771796279353043e-218 < a < 4.08783574424685039e-156Initial program 29.2
Taylor expanded around inf 12.8
if 4.08783574424685039e-156 < a Initial program 23.2
rmApplied *-un-lft-identity23.2
Applied times-frac8.9
Simplified8.9
Final simplification10.3
herbie shell --seed 2020168
(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))))