\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \leq -4.843246152437076 \cdot 10^{-92}:\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq 1.6463407347992611 \cdot 10^{-24}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \sqrt{\frac{1}{t}} \cdot \left(y \cdot \left(z \cdot \sqrt{\frac{1}{t}}\right)\right)}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(FPCore (x y z t a b)
:precision binary64
(if (<= t -4.843246152437076e-92)
(* (+ x (* y (/ z t))) (/ 1.0 (+ a (+ 1.0 (* y (/ b t))))))
(if (<= t 1.6463407347992611e-24)
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
(/
(+ x (* (sqrt (/ 1.0 t)) (* y (* z (sqrt (/ 1.0 t))))))
(+ a (+ 1.0 (* y (/ b t))))))))double code(double x, double y, double z, double t, double a, double b) {
return (((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.843246152437076e-92)) {
tmp = ((double) (((double) (x + ((double) (y * (z / t))))) * (1.0 / ((double) (a + ((double) (1.0 + ((double) (y * (b / t))))))))));
} else {
double tmp_1;
if ((t <= 1.6463407347992611e-24)) {
tmp_1 = (((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
} else {
tmp_1 = (((double) (x + ((double) (((double) sqrt((1.0 / t))) * ((double) (y * ((double) (z * ((double) sqrt((1.0 / t))))))))))) / ((double) (a + ((double) (1.0 + ((double) (y * (b / t))))))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 16.4 |
|---|---|
| Target | 13.1 |
| Herbie | 13.3 |
if t < -4.84324615243707631e-92Initial program Error: 11.5 bits
SimplifiedError: 6.7 bits
rmApplied div-invError: 6.8 bits
if -4.84324615243707631e-92 < t < 1.6463407347992611e-24Initial program Error: 24.1 bits
if 1.6463407347992611e-24 < t Initial program Error: 11.4 bits
SimplifiedError: 4.3 bits
rmApplied div-invError: 4.4 bits
Applied associate-*r*Error: 8.2 bits
rmApplied add-sqr-sqrtError: 8.2 bits
Applied associate-*r*Error: 8.2 bits
SimplifiedError: 5.5 bits
Final simplificationError: 13.3 bits
herbie shell --seed 2020203
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))