Average Error: 0.3 → 0.3
Time: 40.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(y + x\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(y + x\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 r2481875 = x;
        double r2481876 = y;
        double r2481877 = r2481875 + r2481876;
        double r2481878 = log(r2481877);
        double r2481879 = z;
        double r2481880 = log(r2481879);
        double r2481881 = r2481878 + r2481880;
        double r2481882 = t;
        double r2481883 = r2481881 - r2481882;
        double r2481884 = a;
        double r2481885 = 0.5;
        double r2481886 = r2481884 - r2481885;
        double r2481887 = log(r2481882);
        double r2481888 = r2481886 * r2481887;
        double r2481889 = r2481883 + r2481888;
        return r2481889;
}

double f(double x, double y, double z, double t, double a) {
        double r2481890 = y;
        double r2481891 = x;
        double r2481892 = r2481890 + r2481891;
        double r2481893 = log(r2481892);
        double r2481894 = a;
        double r2481895 = 0.5;
        double r2481896 = r2481894 - r2481895;
        double r2481897 = t;
        double r2481898 = log(r2481897);
        double r2481899 = z;
        double r2481900 = log(r2481899);
        double r2481901 = r2481900 - r2481897;
        double r2481902 = fma(r2481896, r2481898, r2481901);
        double r2481903 = r2481893 + r2481902;
        return r2481903;
}

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(y + x\right) + \mathsf{fma}\left(a - 0.5, \log t, \log z - t\right)\]

Reproduce

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