Average Error: 0.3 → 0.3
Time: 41.4s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\log z - \left(\mathsf{fma}\left(0.5 - a, \log t, t\right) - \log \left(y + x\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\log z - \left(\mathsf{fma}\left(0.5 - a, \log t, t\right) - \log \left(y + x\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r3228347 = x;
        double r3228348 = y;
        double r3228349 = r3228347 + r3228348;
        double r3228350 = log(r3228349);
        double r3228351 = z;
        double r3228352 = log(r3228351);
        double r3228353 = r3228350 + r3228352;
        double r3228354 = t;
        double r3228355 = r3228353 - r3228354;
        double r3228356 = a;
        double r3228357 = 0.5;
        double r3228358 = r3228356 - r3228357;
        double r3228359 = log(r3228354);
        double r3228360 = r3228358 * r3228359;
        double r3228361 = r3228355 + r3228360;
        return r3228361;
}

double f(double x, double y, double z, double t, double a) {
        double r3228362 = z;
        double r3228363 = log(r3228362);
        double r3228364 = 0.5;
        double r3228365 = a;
        double r3228366 = r3228364 - r3228365;
        double r3228367 = t;
        double r3228368 = log(r3228367);
        double r3228369 = fma(r3228366, r3228368, r3228367);
        double r3228370 = y;
        double r3228371 = x;
        double r3228372 = r3228370 + r3228371;
        double r3228373 = log(r3228372);
        double r3228374 = r3228369 - r3228373;
        double r3228375 = r3228363 - r3228374;
        return r3228375;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

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. Simplified0.3

    \[\leadsto \color{blue}{\left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right) + \log \left(y + x\right)}\]
  3. Using strategy rm
  4. Applied associate-+l-0.3

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))