\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\left(a + 1\right) + \left(\sqrt[3]{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}\right) \cdot \left(\sqrt[3]{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{b}{\sqrt[3]{t}}\right)}double code(double x, double y, double z, double t, double a, double b) {
return ((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)));
}
double code(double x, double y, double z, double t, double a, double b) {
return (fma((y / t), z, x) / ((a + 1.0) + ((cbrt((y / (cbrt(t) * cbrt(t)))) * cbrt((y / (cbrt(t) * cbrt(t))))) * (cbrt((y / (cbrt(t) * cbrt(t)))) * (b / cbrt(t))))));
}




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.5 |
|---|---|
| Target | 13.0 |
| Herbie | 15.1 |
Initial program 16.5
rmApplied add-cube-cbrt16.6
Applied times-frac16.1
rmApplied *-un-lft-identity16.1
Applied associate-/r*16.1
Simplified15.0
rmApplied add-cube-cbrt15.1
Applied associate-*l*15.1
Final simplification15.1
herbie shell --seed 2020100 +o rules:numerics
(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 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1) (/ (* y b) t))))