x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;t \leq -3.9871011799561977 \cdot 10^{+189} \lor \neg \left(t \leq 2.908034067975434 \cdot 10^{+163}\right):\\
\;\;\;\;y + \left(\frac{x}{t} \cdot z - y \cdot \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\
\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 (or (<= t -3.9871011799561977e+189) (not (<= t 2.908034067975434e+163))) (+ y (- (* (/ x t) z) (* y (/ z t)))) (+ x (* (- y x) (/ (- z t) (- a t))))))
double code(double x, double y, double z, double t, double a) {
return ((double) (x + (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((t <= -3.9871011799561977e+189) || !(t <= 2.908034067975434e+163))) {
tmp = ((double) (y + ((double) (((double) ((x / t) * z)) - ((double) (y * (z / t)))))));
} else {
tmp = ((double) (x + ((double) (((double) (y - x)) * (((double) (z - t)) / ((double) (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 | 9.3 |
| Herbie | 9.7 |
if t < -3.98710117995619768e189 or 2.90803406797543381e163 < t Initial program Error: 48.0 bits
SimplifiedError: 23.7 bits
Taylor expanded around inf Error: 24.6 bits
SimplifiedError: 14.9 bits
if -3.98710117995619768e189 < t < 2.90803406797543381e163Initial program Error: 16.5 bits
SimplifiedError: 8.0 bits
Final simplificationError: 9.7 bits
herbie shell --seed 2020203
(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))))