Average Error: 0.3 → 0.3
Time: 38.2s
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 r60437 = x;
        double r60438 = y;
        double r60439 = r60437 + r60438;
        double r60440 = log(r60439);
        double r60441 = z;
        double r60442 = log(r60441);
        double r60443 = r60440 + r60442;
        double r60444 = t;
        double r60445 = r60443 - r60444;
        double r60446 = a;
        double r60447 = 0.5;
        double r60448 = r60446 - r60447;
        double r60449 = log(r60444);
        double r60450 = r60448 * r60449;
        double r60451 = r60445 + r60450;
        return r60451;
}

double f(double x, double y, double z, double t, double a) {
        double r60452 = x;
        double r60453 = y;
        double r60454 = r60452 + r60453;
        double r60455 = log(r60454);
        double r60456 = a;
        double r60457 = 0.5;
        double r60458 = r60456 - r60457;
        double r60459 = t;
        double r60460 = log(r60459);
        double r60461 = z;
        double r60462 = log(r60461);
        double r60463 = r60462 - r60459;
        double r60464 = fma(r60458, r60460, r60463);
        double r60465 = r60455 + r60464;
        return r60465;
}

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