x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.1644172666068035 \cdot 10^{-167} \lor \neg \left(a \le 1.98222165902928314 \cdot 10^{-148}\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{1}{\frac{a - t}{z - t}}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\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.1644172666068035e-167) || !(a <= 1.982221659029283e-148))) {
VAR = fma((y - x), (1.0 / ((a - t) / (z - t))), x);
} else {
VAR = fma((x / t), z, (y - ((z * y) / t)));
}
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.1 |
|---|---|
| Target | 9.4 |
| Herbie | 10.2 |
if a < -1.1644172666068035e-167 or 1.982221659029283e-148 < a Initial program 22.7
Simplified12.0
rmApplied fma-udef12.1
rmApplied div-inv12.1
Applied associate-*l*9.7
Simplified9.6
rmApplied fma-def9.6
rmApplied clear-num9.7
if -1.1644172666068035e-167 < a < 1.982221659029283e-148Initial program 29.6
Simplified25.2
rmApplied fma-udef25.2
rmApplied div-inv25.3
Applied associate-*l*19.9
Simplified19.8
Taylor expanded around inf 12.7
Simplified12.2
Final simplification10.2
herbie shell --seed 2020102 +o rules:numerics
(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))))