Average Error: 0.1 → 0.1
Time: 7.6s
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]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(\sqrt[3]{t}\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, \mathsf{fma}\left(z, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - z \cdot \log \left(\sqrt[3]{t}\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r325315 = x;
        double r325316 = y;
        double r325317 = r325315 + r325316;
        double r325318 = z;
        double r325319 = r325317 + r325318;
        double r325320 = t;
        double r325321 = log(r325320);
        double r325322 = r325318 * r325321;
        double r325323 = r325319 - r325322;
        double r325324 = a;
        double r325325 = 0.5;
        double r325326 = r325324 - r325325;
        double r325327 = b;
        double r325328 = r325326 * r325327;
        double r325329 = r325323 + r325328;
        return r325329;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r325330 = b;
        double r325331 = a;
        double r325332 = 0.5;
        double r325333 = r325331 - r325332;
        double r325334 = z;
        double r325335 = 1.0;
        double r325336 = t;
        double r325337 = cbrt(r325336);
        double r325338 = r325337 * r325337;
        double r325339 = log(r325338);
        double r325340 = r325335 - r325339;
        double r325341 = x;
        double r325342 = y;
        double r325343 = r325341 + r325342;
        double r325344 = fma(r325334, r325340, r325343);
        double r325345 = log(r325337);
        double r325346 = r325334 * r325345;
        double r325347 = r325344 - r325346;
        double r325348 = fma(r325330, r325333, r325347);
        return r325348;
}

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-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. Applied associate--r+0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \color{blue}{\left(\left(\left(x + y\right) + z\right) - z \cdot \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) - z \cdot \log \left(\sqrt[3]{t}\right)}\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)} - z \cdot \log \left(\sqrt[3]{t}\right)\right)\]
  9. Final simplification0.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) - z \cdot \log \left(\sqrt[3]{t}\right)\right)\]

Reproduce

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