Average Error: 0.3 → 0.3
Time: 11.1s
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 r69707 = x;
        double r69708 = y;
        double r69709 = r69707 + r69708;
        double r69710 = log(r69709);
        double r69711 = z;
        double r69712 = log(r69711);
        double r69713 = r69710 + r69712;
        double r69714 = t;
        double r69715 = r69713 - r69714;
        double r69716 = a;
        double r69717 = 0.5;
        double r69718 = r69716 - r69717;
        double r69719 = log(r69714);
        double r69720 = r69718 * r69719;
        double r69721 = r69715 + r69720;
        return r69721;
}

double f(double x, double y, double z, double t, double a) {
        double r69722 = t;
        double r69723 = log(r69722);
        double r69724 = a;
        double r69725 = 0.5;
        double r69726 = r69724 - r69725;
        double r69727 = x;
        double r69728 = y;
        double r69729 = r69727 + r69728;
        double r69730 = log(r69729);
        double r69731 = z;
        double r69732 = log(r69731);
        double r69733 = r69732 - r69722;
        double r69734 = r69730 + r69733;
        double r69735 = fma(r69723, r69726, r69734);
        return r69735;
}

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