Average Error: 0.2 → 0.2
Time: 13.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(\log t, a - 0.5, \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(\log t, a - 0.5, \log z - t\right)
double f(double x, double y, double z, double t, double a) {
        double r57910 = x;
        double r57911 = y;
        double r57912 = r57910 + r57911;
        double r57913 = log(r57912);
        double r57914 = z;
        double r57915 = log(r57914);
        double r57916 = r57913 + r57915;
        double r57917 = t;
        double r57918 = r57916 - r57917;
        double r57919 = a;
        double r57920 = 0.5;
        double r57921 = r57919 - r57920;
        double r57922 = log(r57917);
        double r57923 = r57921 * r57922;
        double r57924 = r57918 + r57923;
        return r57924;
}

double f(double x, double y, double z, double t, double a) {
        double r57925 = x;
        double r57926 = y;
        double r57927 = r57925 + r57926;
        double r57928 = log(r57927);
        double r57929 = t;
        double r57930 = log(r57929);
        double r57931 = a;
        double r57932 = 0.5;
        double r57933 = r57931 - r57932;
        double r57934 = z;
        double r57935 = log(r57934);
        double r57936 = r57935 - r57929;
        double r57937 = fma(r57930, r57933, r57936);
        double r57938 = r57928 + r57937;
        return r57938;
}

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.2

    \[\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.2

    \[\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.2

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

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

Reproduce

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