\frac{x}{y - z \cdot t}
\begin{array}{l}
t_1 := t \cdot \frac{z}{x}\\
\mathbf{if}\;x \leq 1.105352214638888 \cdot 10^{+179}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, -z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(y, \frac{1}{x}, -t_1\right) + \mathsf{fma}\left(\frac{-z}{x}, t, t_1\right)\right)}^{-1}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ z x))))
(if (<= x 1.105352214638888e+179)
(/ x (fma t (- z) y))
(pow (+ (fma y (/ 1.0 x) (- t_1)) (fma (/ (- z) x) t t_1)) -1.0))))double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
double code(double x, double y, double z, double t) {
double t_1 = t * (z / x);
double tmp;
if (x <= 1.105352214638888e+179) {
tmp = x / fma(t, -z, y);
} else {
tmp = pow((fma(y, (1.0 / x), -t_1) + fma((-z / x), t, t_1)), -1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 3.1 |
|---|---|
| Target | 1.9 |
| Herbie | 2.8 |
if x < 1.10535221463888801e179Initial program 2.4
Applied egg-rr2.4
if 1.10535221463888801e179 < x Initial program 9.4
Applied egg-rr9.5
Applied egg-rr6.4
Final simplification2.8
herbie shell --seed 2022125
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(/ x (- y (* z t))))