Average Error: 0.3 → 0.3
Time: 10.9s
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(\log t, a - 0.5, \log \left(x + y\right) + \left(\log z - t\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(\log t, a - 0.5, \log \left(x + y\right) + \left(\log z - t\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r70504 = x;
        double r70505 = y;
        double r70506 = r70504 + r70505;
        double r70507 = log(r70506);
        double r70508 = z;
        double r70509 = log(r70508);
        double r70510 = r70507 + r70509;
        double r70511 = t;
        double r70512 = r70510 - r70511;
        double r70513 = a;
        double r70514 = 0.5;
        double r70515 = r70513 - r70514;
        double r70516 = log(r70511);
        double r70517 = r70515 * r70516;
        double r70518 = r70512 + r70517;
        return r70518;
}

double f(double x, double y, double z, double t, double a) {
        double r70519 = t;
        double r70520 = log(r70519);
        double r70521 = a;
        double r70522 = 0.5;
        double r70523 = r70521 - r70522;
        double r70524 = x;
        double r70525 = y;
        double r70526 = r70524 + r70525;
        double r70527 = log(r70526);
        double r70528 = z;
        double r70529 = log(r70528);
        double r70530 = r70529 - r70519;
        double r70531 = r70527 + r70530;
        double r70532 = fma(r70520, r70523, r70531);
        return r70532;
}

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}{\mathsf{fma}\left(\log t, a - 0.5, \left(\log \left(x + y\right) + \log z\right) - t\right)}\]
  3. Using strategy rm
  4. Applied associate--l+0.3

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

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

Reproduce

herbie shell --seed 2020060 +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))))