Average Error: 0.1 → 0.1
Time: 13.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 - 2 \cdot \log \left({t}^{\frac{1}{3}}\right)\right) - \log \left(\sqrt[3]{t}\right), z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y\]
\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 - 2 \cdot \log \left({t}^{\frac{1}{3}}\right)\right) - \log \left(\sqrt[3]{t}\right), z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y
double f(double x, double y, double z, double t, double a, double b) {
        double r357820 = x;
        double r357821 = y;
        double r357822 = r357820 + r357821;
        double r357823 = z;
        double r357824 = r357822 + r357823;
        double r357825 = t;
        double r357826 = log(r357825);
        double r357827 = r357823 * r357826;
        double r357828 = r357824 - r357827;
        double r357829 = a;
        double r357830 = 0.5;
        double r357831 = r357829 - r357830;
        double r357832 = b;
        double r357833 = r357831 * r357832;
        double r357834 = r357828 + r357833;
        return r357834;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r357835 = 1.0;
        double r357836 = 2.0;
        double r357837 = t;
        double r357838 = 0.3333333333333333;
        double r357839 = pow(r357837, r357838);
        double r357840 = log(r357839);
        double r357841 = r357836 * r357840;
        double r357842 = r357835 - r357841;
        double r357843 = cbrt(r357837);
        double r357844 = log(r357843);
        double r357845 = r357842 - r357844;
        double r357846 = z;
        double r357847 = a;
        double r357848 = 0.5;
        double r357849 = r357847 - r357848;
        double r357850 = b;
        double r357851 = x;
        double r357852 = fma(r357849, r357850, r357851);
        double r357853 = fma(r357845, r357846, r357852);
        double r357854 = y;
        double r357855 = r357853 + r357854;
        return r357855;
}

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(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y}\]
  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(a - 0.5, b, x\right)\right) + y\]
  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(a - 0.5, b, x\right)\right) + y\]
  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(a - 0.5, b, x\right)\right) + y\]
  7. Simplified0.1

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

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

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

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)))