Average Error: 0.1 → 0.1
Time: 17.1s
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(z, \left(1 - 2 \cdot \log \left({t}^{\frac{1}{3}}\right)\right) - \log \left(\sqrt[3]{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\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(z, \left(1 - 2 \cdot \log \left({t}^{\frac{1}{3}}\right)\right) - \log \left(\sqrt[3]{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r359853 = x;
        double r359854 = y;
        double r359855 = r359853 + r359854;
        double r359856 = z;
        double r359857 = r359855 + r359856;
        double r359858 = t;
        double r359859 = log(r359858);
        double r359860 = r359856 * r359859;
        double r359861 = r359857 - r359860;
        double r359862 = a;
        double r359863 = 0.5;
        double r359864 = r359862 - r359863;
        double r359865 = b;
        double r359866 = r359864 * r359865;
        double r359867 = r359861 + r359866;
        return r359867;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r359868 = z;
        double r359869 = 1.0;
        double r359870 = 2.0;
        double r359871 = t;
        double r359872 = 0.3333333333333333;
        double r359873 = pow(r359871, r359872);
        double r359874 = log(r359873);
        double r359875 = r359870 * r359874;
        double r359876 = r359869 - r359875;
        double r359877 = cbrt(r359871);
        double r359878 = log(r359877);
        double r359879 = r359876 - r359878;
        double r359880 = a;
        double r359881 = 0.5;
        double r359882 = r359880 - r359881;
        double r359883 = b;
        double r359884 = x;
        double r359885 = y;
        double r359886 = r359884 + r359885;
        double r359887 = fma(r359882, r359883, r359886);
        double r359888 = fma(r359868, r359879, r359887);
        return r359888;
}

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020045 +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)))