x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \leq -3.409957248191829 \cdot 10^{-277} \lor \neg \left(x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \leq 0\right):\\
\;\;\;\;x + \frac{\frac{y - z}{a - z}}{\frac{1}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\
\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 (<= (+ x (/ (* (- y z) (- t x)) (- a z))) -3.409957248191829e-277)
(not (<= (+ x (/ (* (- y z) (- t x)) (- a z))) 0.0)))
(+ x (/ (/ (- y z) (- a z)) (/ 1.0 (- t x))))
(- (+ t (/ (* x y) z)) (/ (* y t) z))))double code(double x, double y, double z, double t, double a) {
return ((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= -3.409957248191829e-277) || !(((double) (x + (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))) <= 0.0))) {
tmp = ((double) (x + ((((double) (y - z)) / ((double) (a - z))) / (1.0 / ((double) (t - x))))));
} else {
tmp = ((double) (((double) (t + (((double) (x * y)) / z))) - (((double) (y * 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.6 |
|---|---|
| Target | 11.8 |
| Herbie | 8.3 |
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -3.40995724819182881e-277 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 21.4
rmApplied associate-/l*_binary6410.5
rmApplied div-inv_binary6410.5
Applied associate-/r*_binary647.3
if -3.40995724819182881e-277 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 59.1
rmApplied associate-/l*_binary6459.2
Taylor expanded around inf 18.2
Simplified18.2
Final simplification8.3
herbie shell --seed 2020205
(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))))