Average Error: 0.1 → 0.1
Time: 5.8s
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(\left(x + y\right) + z\right) - \left(z \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + z \cdot \log \left(\sqrt[3]{t}\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(\left(x + y\right) + z\right) - \left(z \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + z \cdot \log \left(\sqrt[3]{t}\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r321358 = x;
        double r321359 = y;
        double r321360 = r321358 + r321359;
        double r321361 = z;
        double r321362 = r321360 + r321361;
        double r321363 = t;
        double r321364 = log(r321363);
        double r321365 = r321361 * r321364;
        double r321366 = r321362 - r321365;
        double r321367 = a;
        double r321368 = 0.5;
        double r321369 = r321367 - r321368;
        double r321370 = b;
        double r321371 = r321369 * r321370;
        double r321372 = r321366 + r321371;
        return r321372;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r321373 = b;
        double r321374 = a;
        double r321375 = 0.5;
        double r321376 = r321374 - r321375;
        double r321377 = x;
        double r321378 = y;
        double r321379 = r321377 + r321378;
        double r321380 = z;
        double r321381 = r321379 + r321380;
        double r321382 = 2.0;
        double r321383 = t;
        double r321384 = cbrt(r321383);
        double r321385 = log(r321384);
        double r321386 = r321382 * r321385;
        double r321387 = r321380 * r321386;
        double r321388 = r321380 * r321385;
        double r321389 = r321387 + r321388;
        double r321390 = r321381 - r321389;
        double r321391 = fma(r321373, r321376, r321390);
        return r321391;
}

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(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-lft-in0.1

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

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

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

Reproduce

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