Average Error: 0.1 → 0.1
Time: 4.7s
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, \left(x + y\right) + \left(\mathsf{fma}\left(-z, 2 \cdot \log \left(\sqrt[3]{t}\right), z\right) - \frac{1}{3} \cdot \left(\log t \cdot z\right)\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, \left(x + y\right) + \left(\mathsf{fma}\left(-z, 2 \cdot \log \left(\sqrt[3]{t}\right), z\right) - \frac{1}{3} \cdot \left(\log t \cdot z\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r301390 = x;
        double r301391 = y;
        double r301392 = r301390 + r301391;
        double r301393 = z;
        double r301394 = r301392 + r301393;
        double r301395 = t;
        double r301396 = log(r301395);
        double r301397 = r301393 * r301396;
        double r301398 = r301394 - r301397;
        double r301399 = a;
        double r301400 = 0.5;
        double r301401 = r301399 - r301400;
        double r301402 = b;
        double r301403 = r301401 * r301402;
        double r301404 = r301398 + r301403;
        return r301404;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r301405 = b;
        double r301406 = a;
        double r301407 = 0.5;
        double r301408 = r301406 - r301407;
        double r301409 = x;
        double r301410 = y;
        double r301411 = r301409 + r301410;
        double r301412 = z;
        double r301413 = -r301412;
        double r301414 = 2.0;
        double r301415 = t;
        double r301416 = cbrt(r301415);
        double r301417 = log(r301416);
        double r301418 = r301414 * r301417;
        double r301419 = fma(r301413, r301418, r301412);
        double r301420 = 0.3333333333333333;
        double r301421 = log(r301415);
        double r301422 = r301421 * r301412;
        double r301423 = r301420 * r301422;
        double r301424 = r301419 - r301423;
        double r301425 = r301411 + r301424;
        double r301426 = fma(r301405, r301408, r301425);
        return r301426;
}

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(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)}\]
  3. Using strategy rm
  4. Applied associate--l+0.1

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

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

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \left(x + y\right) + \left(z - \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)\right)\]
  9. Applied associate--r+0.1

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

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

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

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

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

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

Reproduce

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