\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \leq -2.642073336958404 \cdot 10^{-86} \lor \neg \left(z \leq 1.3583837970033708 \cdot 10^{-139}\right):\\
\;\;\;\;\frac{-\left(x + z \cdot \frac{y}{t}\right)}{-\left(\left(a + 1\right) + \frac{y}{t} \cdot b\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z \cdot y}{t}\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\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 (or (<= z -2.642073336958404e-86) (not (<= z 1.3583837970033708e-139))) (/ (- (+ x (* z (/ y t)))) (- (+ (+ a 1.0) (* (/ y t) b)))) (* (+ x (/ (* z y) t)) (/ 1.0 (+ (+ 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 (((z <= -2.642073336958404e-86) || !(z <= 1.3583837970033708e-139))) {
tmp = (((double) -(((double) (x + ((double) (z * (y / t))))))) / ((double) -(((double) (((double) (a + 1.0)) + ((double) ((y / t) * b)))))));
} else {
tmp = ((double) (((double) (x + (((double) (z * y)) / t))) * (1.0 / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))))));
}
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.7 |
|---|---|
| Target | 13.2 |
| Herbie | 13.7 |
if z < -2.64207333695840391e-86 or 1.3583837970033708e-139 < z Initial program Error: 20.7 bits
rmApplied add-cube-cbrtError: 21.0 bits
Applied associate-/r*Error: 21.0 bits
SimplifiedError: 18.9 bits
rmApplied *-un-lft-identityError: 18.9 bits
Applied associate-/r*Error: 18.9 bits
SimplifiedError: 18.7 bits
rmApplied frac-2negError: 18.7 bits
SimplifiedError: 16.3 bits
if -2.64207333695840391e-86 < z < 1.3583837970033708e-139Initial program Error: 8.3 bits
rmApplied div-invError: 8.4 bits
Final simplificationError: 13.7 bits
herbie shell --seed 2020205
(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))))