Average Error: 0.3 → 0.3
Time: 21.3s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\mathsf{fma}\left(2 \cdot \log \left(\sqrt{\sqrt[3]{t}} \cdot \sqrt{\sqrt[3]{t}}\right), a - 0.5, \left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log \left({t}^{\frac{1}{3}}\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(2 \cdot \log \left(\sqrt{\sqrt[3]{t}} \cdot \sqrt{\sqrt[3]{t}}\right), a - 0.5, \left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log \left({t}^{\frac{1}{3}}\right)
double f(double x, double y, double z, double t, double a) {
        double r389307 = x;
        double r389308 = y;
        double r389309 = r389307 + r389308;
        double r389310 = log(r389309);
        double r389311 = z;
        double r389312 = log(r389311);
        double r389313 = r389310 + r389312;
        double r389314 = t;
        double r389315 = r389313 - r389314;
        double r389316 = a;
        double r389317 = 0.5;
        double r389318 = r389316 - r389317;
        double r389319 = log(r389314);
        double r389320 = r389318 * r389319;
        double r389321 = r389315 + r389320;
        return r389321;
}

double f(double x, double y, double z, double t, double a) {
        double r389322 = 2.0;
        double r389323 = t;
        double r389324 = cbrt(r389323);
        double r389325 = sqrt(r389324);
        double r389326 = r389325 * r389325;
        double r389327 = log(r389326);
        double r389328 = r389322 * r389327;
        double r389329 = a;
        double r389330 = 0.5;
        double r389331 = r389329 - r389330;
        double r389332 = x;
        double r389333 = y;
        double r389334 = r389332 + r389333;
        double r389335 = log(r389334);
        double r389336 = z;
        double r389337 = log(r389336);
        double r389338 = r389335 + r389337;
        double r389339 = r389338 - r389323;
        double r389340 = fma(r389328, r389331, r389339);
        double r389341 = 0.3333333333333333;
        double r389342 = pow(r389323, r389341);
        double r389343 = log(r389342);
        double r389344 = r389331 * r389343;
        double r389345 = r389340 + r389344;
        return r389345;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original0.3
Target0.2
Herbie0.3
\[\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)\]

Derivation

  1. Initial program 0.3

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\]
  4. Applied log-prod0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\left(\log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \log \left(\sqrt[3]{t}\right)\right)}\]
  5. Applied distribute-lft-in0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(\left(a - 0.5\right) \cdot \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{t}\right)\right)}\]
  6. Applied associate-+r+0.3

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

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

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

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

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))

  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))