x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.4065350202544076 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{1}{\frac{\frac{1}{z - t}}{\frac{y - x}{a - t}}}\\
\mathbf{elif}\;a \le -4.81957115971569602 \cdot 10^{-58}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\
\mathbf{elif}\;a \le -3.42609957675525156 \cdot 10^{-167}:\\
\;\;\;\;x + \frac{\frac{y - x}{a - t}}{\frac{1}{z - t}}\\
\mathbf{elif}\;a \le 2.50213665982368351 \cdot 10^{-191}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{a}{z - t} - \frac{t}{z - 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 <= -1.4065350202544076e-08)) {
VAR = (x + (1.0 / ((1.0 / (z - t)) / ((y - x) / (a - t)))));
} else {
double VAR_1;
if ((a <= -4.819571159715696e-58)) {
VAR_1 = ((y + ((x * z) / t)) - ((z * y) / t));
} else {
double VAR_2;
if ((a <= -3.4260995767552516e-167)) {
VAR_2 = (x + (((y - x) / (a - t)) / (1.0 / (z - t))));
} else {
double VAR_3;
if ((a <= 2.5021366598236835e-191)) {
VAR_3 = ((y + ((x * z) / t)) - ((z * y) / t));
} else {
VAR_3 = (x + ((y - x) / ((a / (z - t)) - (t / (z - t)))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
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.6 |
|---|---|
| Target | 9.3 |
| Herbie | 11.8 |
if a < -1.4065350202544076e-08Initial program 23.0
rmApplied associate-/l*7.1
rmApplied div-sub7.1
rmApplied clear-num7.2
rmApplied div-inv7.2
Applied div-inv7.2
Applied distribute-rgt-out--7.2
Applied associate-/l*8.8
if -1.4065350202544076e-08 < a < -4.819571159715696e-58 or -3.4260995767552516e-167 < a < 2.5021366598236835e-191Initial program 28.4
Taylor expanded around inf 15.5
if -4.819571159715696e-58 < a < -3.4260995767552516e-167Initial program 26.6
rmApplied associate-/l*16.6
rmApplied div-inv16.6
Applied associate-/r*21.5
if 2.5021366598236835e-191 < a Initial program 23.2
rmApplied associate-/l*9.8
rmApplied div-sub9.8
Final simplification11.8
herbie shell --seed 2020078
(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))))