x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \leq -7.87713316621998 \cdot 10^{-102} \lor \neg \left(a \leq 5.632573208304651 \cdot 10^{-157}\right):\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.87713316621998e-102) (not (<= a 5.632573208304651e-157))) (+ x (* (- t x) (/ (- y z) (- a z)))) (+ t (* y (- (/ x z) (/ t z))))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.87713316621998e-102) || !(a <= 5.632573208304651e-157)) {
tmp = x + ((t - x) * ((y - z) / (a - z)));
} else {
tmp = t + (y * ((x / z) - (t / z)));
}
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.5 |
|---|---|
| Target | 12.1 |
| Herbie | 10.0 |
if a < -7.8771331662199803e-102 or 5.6325732083046509e-157 < a Initial program 23.0
rmApplied add-cube-cbrt_binary64_1937823.3
Applied times-frac_binary64_193499.6
rmApplied pow1_binary64_194049.6
Applied pow1_binary64_194049.6
Applied pow-prod-down_binary64_194149.6
Simplified8.9
if -7.8771331662199803e-102 < a < 5.6325732083046509e-157Initial program 29.1
Taylor expanded around inf 15.1
Simplified13.1
Final simplification10.0
herbie shell --seed 2020277
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))