Average Error: 0.1 → 0.1
Time: 6.2s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(1 \cdot {t}^{\frac{1}{3}}\right)\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(1 \cdot {t}^{\frac{1}{3}}\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r398983 = x;
        double r398984 = y;
        double r398985 = r398983 + r398984;
        double r398986 = z;
        double r398987 = r398985 + r398986;
        double r398988 = t;
        double r398989 = log(r398988);
        double r398990 = r398986 * r398989;
        double r398991 = r398987 - r398990;
        double r398992 = a;
        double r398993 = 0.5;
        double r398994 = r398992 - r398993;
        double r398995 = b;
        double r398996 = r398994 * r398995;
        double r398997 = r398991 + r398996;
        return r398997;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r398998 = b;
        double r398999 = a;
        double r399000 = 0.5;
        double r399001 = r398999 - r399000;
        double r399002 = z;
        double r399003 = 1.0;
        double r399004 = t;
        double r399005 = cbrt(r399004);
        double r399006 = r399005 * r399005;
        double r399007 = log(r399006);
        double r399008 = r399003 - r399007;
        double r399009 = x;
        double r399010 = y;
        double r399011 = r399009 + r399010;
        double r399012 = fma(r399002, r399008, r399011);
        double r399013 = 0.3333333333333333;
        double r399014 = pow(r399004, r399013);
        double r399015 = r399003 * r399014;
        double r399016 = log(r399015);
        double r399017 = r399002 * r399016;
        double r399018 = r399012 - r399017;
        double r399019 = fma(r398998, r399001, r399018);
        return r399019;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original0.1
Target0.3
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\left(\log t\right)}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b\]

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \log \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\right)\]
  5. Applied log-prod0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \color{blue}{\left(\log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \log \left(\sqrt[3]{t}\right)\right)}\right)\]
  6. Applied distribute-lft-in0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \left(\left(x + y\right) + z\right) - \color{blue}{\left(z \cdot \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + z \cdot \log \left(\sqrt[3]{t}\right)\right)}\right)\]
  7. Applied associate--r+0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) - z \cdot \log \left(\sqrt[3]{t}\right)}\right)\]
  8. Simplified0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \color{blue}{\mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right)} - z \cdot \log \left(\sqrt[3]{t}\right)\right)\]
  9. Using strategy rm
  10. Applied *-un-lft-identity0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(\sqrt[3]{\color{blue}{1 \cdot t}}\right)\right)\]
  11. Applied cbrt-prod0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{t}\right)}\right)\]
  12. Simplified0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(\color{blue}{1} \cdot \sqrt[3]{t}\right)\right)\]
  13. Simplified0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(1 \cdot \color{blue}{{t}^{\frac{1}{3}}}\right)\right)\]
  14. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(1 \cdot {t}^{\frac{1}{3}}\right)\right)\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))