Average Error: 0.1 → 0.1
Time: 6.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(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot {\left(\sqrt[3]{\sqrt[3]{t}}\right)}^{4}\right), x + y\right) - \log \left({\left(\frac{1}{t}\right)}^{\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
\mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot {\left(\sqrt[3]{\sqrt[3]{t}}\right)}^{4}\right), x + y\right) - \log \left({\left(\frac{1}{t}\right)}^{\frac{-1}{3}}\right) \cdot z\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r368371 = x;
        double r368372 = y;
        double r368373 = r368371 + r368372;
        double r368374 = z;
        double r368375 = r368373 + r368374;
        double r368376 = t;
        double r368377 = log(r368376);
        double r368378 = r368374 * r368377;
        double r368379 = r368375 - r368378;
        double r368380 = a;
        double r368381 = 0.5;
        double r368382 = r368380 - r368381;
        double r368383 = b;
        double r368384 = r368382 * r368383;
        double r368385 = r368379 + r368384;
        return r368385;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r368386 = b;
        double r368387 = a;
        double r368388 = 0.5;
        double r368389 = r368387 - r368388;
        double r368390 = z;
        double r368391 = 1.0;
        double r368392 = t;
        double r368393 = cbrt(r368392);
        double r368394 = r368393 * r368393;
        double r368395 = cbrt(r368394);
        double r368396 = cbrt(r368393);
        double r368397 = 4.0;
        double r368398 = pow(r368396, r368397);
        double r368399 = r368395 * r368398;
        double r368400 = log(r368399);
        double r368401 = r368391 - r368400;
        double r368402 = x;
        double r368403 = y;
        double r368404 = r368402 + r368403;
        double r368405 = fma(r368390, r368401, r368404);
        double r368406 = r368391 / r368392;
        double r368407 = -0.3333333333333333;
        double r368408 = pow(r368406, r368407);
        double r368409 = log(r368408);
        double r368410 = r368409 * r368390;
        double r368411 = r368405 - r368410;
        double r368412 = fma(r368386, r368389, r368411);
        return r368412;
}

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 add-cube-cbrt0.1

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

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

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

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \color{blue}{\mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right)} - \log \left(\sqrt[3]{t}\right) \cdot z\right)\]
  9. Taylor expanded around inf 0.1

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

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

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

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

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

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

Reproduce

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