Average Error: 0.1 → 0.1
Time: 21.5s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\left(y + x\right) + \left(\left(\mathsf{fma}\left(a - 0.5, b, z\right) - \log \left(\sqrt[3]{t}\right) \cdot \left(z + z\right)\right) - \log \left({t}^{\frac{1}{3}}\right) \cdot z\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\left(y + x\right) + \left(\left(\mathsf{fma}\left(a - 0.5, b, z\right) - \log \left(\sqrt[3]{t}\right) \cdot \left(z + z\right)\right) - \log \left({t}^{\frac{1}{3}}\right) \cdot z\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r14485486 = x;
        double r14485487 = y;
        double r14485488 = r14485486 + r14485487;
        double r14485489 = z;
        double r14485490 = r14485488 + r14485489;
        double r14485491 = t;
        double r14485492 = log(r14485491);
        double r14485493 = r14485489 * r14485492;
        double r14485494 = r14485490 - r14485493;
        double r14485495 = a;
        double r14485496 = 0.5;
        double r14485497 = r14485495 - r14485496;
        double r14485498 = b;
        double r14485499 = r14485497 * r14485498;
        double r14485500 = r14485494 + r14485499;
        return r14485500;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r14485501 = y;
        double r14485502 = x;
        double r14485503 = r14485501 + r14485502;
        double r14485504 = a;
        double r14485505 = 0.5;
        double r14485506 = r14485504 - r14485505;
        double r14485507 = b;
        double r14485508 = z;
        double r14485509 = fma(r14485506, r14485507, r14485508);
        double r14485510 = t;
        double r14485511 = cbrt(r14485510);
        double r14485512 = log(r14485511);
        double r14485513 = r14485508 + r14485508;
        double r14485514 = r14485512 * r14485513;
        double r14485515 = r14485509 - r14485514;
        double r14485516 = 0.3333333333333333;
        double r14485517 = pow(r14485510, r14485516);
        double r14485518 = log(r14485517);
        double r14485519 = r14485518 * r14485508;
        double r14485520 = r14485515 - r14485519;
        double r14485521 = r14485503 + r14485520;
        return r14485521;
}

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. Using strategy rm
  3. Applied associate--l+0.1

    \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b\]
  4. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x + y\right) + \left(\left(z - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\right)}\]
  5. Simplified0.1

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

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

    \[\leadsto \left(x + y\right) + \left(\mathsf{fma}\left(b, a - 0.5, 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)\]
  9. Applied distribute-rgt-in0.1

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

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

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

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

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

Reproduce

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