Average Error: 0.1 → 0.1
Time: 17.9s
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(-3, \log \left(\sqrt[3]{-t} \cdot \sqrt[3]{-1}\right) \cdot z, z + y\right)\right) + x\]
\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(-3, \log \left(\sqrt[3]{-t} \cdot \sqrt[3]{-1}\right) \cdot z, z + y\right)\right) + x
double f(double x, double y, double z, double t, double a, double b) {
        double r246417 = x;
        double r246418 = y;
        double r246419 = r246417 + r246418;
        double r246420 = z;
        double r246421 = r246419 + r246420;
        double r246422 = t;
        double r246423 = log(r246422);
        double r246424 = r246420 * r246423;
        double r246425 = r246421 - r246424;
        double r246426 = a;
        double r246427 = 0.5;
        double r246428 = r246426 - r246427;
        double r246429 = b;
        double r246430 = r246428 * r246429;
        double r246431 = r246425 + r246430;
        return r246431;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r246432 = b;
        double r246433 = a;
        double r246434 = 0.5;
        double r246435 = r246433 - r246434;
        double r246436 = -3.0;
        double r246437 = t;
        double r246438 = -r246437;
        double r246439 = cbrt(r246438);
        double r246440 = -1.0;
        double r246441 = cbrt(r246440);
        double r246442 = r246439 * r246441;
        double r246443 = log(r246442);
        double r246444 = z;
        double r246445 = r246443 * r246444;
        double r246446 = y;
        double r246447 = r246444 + r246446;
        double r246448 = fma(r246436, r246445, r246447);
        double r246449 = fma(r246432, r246435, r246448);
        double r246450 = x;
        double r246451 = r246449 + r246450;
        return r246451;
}

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

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

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

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

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

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

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

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

Reproduce

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