Average Error: 0.3 → 0.3
Time: 17.8s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\log \left(x + y\right) + \mathsf{fma}\left(a - 0.5, \log t, \log z - t\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\log \left(x + y\right) + \mathsf{fma}\left(a - 0.5, \log t, \log z - t\right)
double f(double x, double y, double z, double t, double a) {
        double r75375 = x;
        double r75376 = y;
        double r75377 = r75375 + r75376;
        double r75378 = log(r75377);
        double r75379 = z;
        double r75380 = log(r75379);
        double r75381 = r75378 + r75380;
        double r75382 = t;
        double r75383 = r75381 - r75382;
        double r75384 = a;
        double r75385 = 0.5;
        double r75386 = r75384 - r75385;
        double r75387 = log(r75382);
        double r75388 = r75386 * r75387;
        double r75389 = r75383 + r75388;
        return r75389;
}

double f(double x, double y, double z, double t, double a) {
        double r75390 = x;
        double r75391 = y;
        double r75392 = r75390 + r75391;
        double r75393 = log(r75392);
        double r75394 = a;
        double r75395 = 0.5;
        double r75396 = r75394 - r75395;
        double r75397 = t;
        double r75398 = log(r75397);
        double r75399 = z;
        double r75400 = log(r75399);
        double r75401 = r75400 - r75397;
        double r75402 = fma(r75396, r75398, r75401);
        double r75403 = r75393 + r75402;
        return r75403;
}

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. Using strategy rm
  3. Applied associate--l+0.3

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

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

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

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

Reproduce

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