Average Error: 0.3 → 0.3
Time: 45.2s
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 r3228345 = x;
        double r3228346 = y;
        double r3228347 = r3228345 + r3228346;
        double r3228348 = log(r3228347);
        double r3228349 = z;
        double r3228350 = log(r3228349);
        double r3228351 = r3228348 + r3228350;
        double r3228352 = t;
        double r3228353 = r3228351 - r3228352;
        double r3228354 = a;
        double r3228355 = 0.5;
        double r3228356 = r3228354 - r3228355;
        double r3228357 = log(r3228352);
        double r3228358 = r3228356 * r3228357;
        double r3228359 = r3228353 + r3228358;
        return r3228359;
}

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

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))))