x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -6.363594727051577 \cdot 10^{-191}:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)\\
\mathbf{elif}\;a \leq 5.9148642543831895 \cdot 10^{-180}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.363594727051577e-191)
(+ x (* (- y x) (- (/ z (- a t)) (/ t (- a t)))))
(if (<= a 5.9148642543831895e-180)
(- (+ y (/ (* x z) t)) (/ (* y z) t))
(+ x (* (- y x) (* (- z t) (/ 1.0 (- a t))))))))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 tmp;
if (a <= -6.363594727051577e-191) {
tmp = x + ((y - x) * ((z / (a - t)) - (t / (a - t))));
} else if (a <= 5.9148642543831895e-180) {
tmp = (y + ((x * z) / t)) - ((y * z) / t);
} else {
tmp = x + ((y - x) * ((z - t) * (1.0 / (a - t))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.1 |
|---|---|
| Target | 8.9 |
| Herbie | 10.0 |
if a < -6.363594727051577e-191Initial program 23.1
rmApplied *-un-lft-identity_binary64_1659023.1
Applied times-frac_binary64_165969.6
Simplified9.6
rmApplied div-sub_binary64_165959.6
if -6.363594727051577e-191 < a < 5.9148642543831895e-180Initial program 29.6
Taylor expanded around inf 11.3
Simplified11.3
if 5.9148642543831895e-180 < a Initial program 22.7
rmApplied *-un-lft-identity_binary64_1659022.7
Applied times-frac_binary64_165969.7
Simplified9.7
rmApplied div-inv_binary64_165879.8
Final simplification10.0
herbie shell --seed 2020292
(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))))