Average Error: 0.1 → 0.1
Time: 26.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(\left(1 - \mathsf{fma}\left(\frac{2}{3}, \log t, \log \left(\sqrt{\sqrt[3]{t}}\right)\right)\right) - \log \left(\sqrt{\sqrt[3]{t}}\right), z, y + \mathsf{fma}\left(b, a - 0.5, x\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(\left(1 - \mathsf{fma}\left(\frac{2}{3}, \log t, \log \left(\sqrt{\sqrt[3]{t}}\right)\right)\right) - \log \left(\sqrt{\sqrt[3]{t}}\right), z, y + \mathsf{fma}\left(b, a - 0.5, x\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r14359762 = x;
        double r14359763 = y;
        double r14359764 = r14359762 + r14359763;
        double r14359765 = z;
        double r14359766 = r14359764 + r14359765;
        double r14359767 = t;
        double r14359768 = log(r14359767);
        double r14359769 = r14359765 * r14359768;
        double r14359770 = r14359766 - r14359769;
        double r14359771 = a;
        double r14359772 = 0.5;
        double r14359773 = r14359771 - r14359772;
        double r14359774 = b;
        double r14359775 = r14359773 * r14359774;
        double r14359776 = r14359770 + r14359775;
        return r14359776;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r14359777 = 1.0;
        double r14359778 = 0.6666666666666666;
        double r14359779 = t;
        double r14359780 = log(r14359779);
        double r14359781 = cbrt(r14359779);
        double r14359782 = sqrt(r14359781);
        double r14359783 = log(r14359782);
        double r14359784 = fma(r14359778, r14359780, r14359783);
        double r14359785 = r14359777 - r14359784;
        double r14359786 = r14359785 - r14359783;
        double r14359787 = z;
        double r14359788 = y;
        double r14359789 = b;
        double r14359790 = a;
        double r14359791 = 0.5;
        double r14359792 = r14359790 - r14359791;
        double r14359793 = x;
        double r14359794 = fma(r14359789, r14359792, r14359793);
        double r14359795 = r14359788 + r14359794;
        double r14359796 = fma(r14359786, r14359787, r14359795);
        return r14359796;
}

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.4
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(1 - \log t, z, \mathsf{fma}\left(b, a - 0.5, x\right) + y\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.1

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

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

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

    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(1 - \log \left(\sqrt[3]{t}\right)\right) - \log \left(\sqrt[3]{t}\right)\right)} - \log \left(\sqrt[3]{t}\right), z, \mathsf{fma}\left(b, a - 0.5, x\right) + y\right)\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt0.1

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

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

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

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

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

Reproduce

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

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

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