Average Error: 0.3 → 0.3
Time: 14.0s
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 r61906 = x;
        double r61907 = y;
        double r61908 = r61906 + r61907;
        double r61909 = log(r61908);
        double r61910 = z;
        double r61911 = log(r61910);
        double r61912 = r61909 + r61911;
        double r61913 = t;
        double r61914 = r61912 - r61913;
        double r61915 = a;
        double r61916 = 0.5;
        double r61917 = r61915 - r61916;
        double r61918 = log(r61913);
        double r61919 = r61917 * r61918;
        double r61920 = r61914 + r61919;
        return r61920;
}

double f(double x, double y, double z, double t, double a) {
        double r61921 = x;
        double r61922 = y;
        double r61923 = r61921 + r61922;
        double r61924 = log(r61923);
        double r61925 = t;
        double r61926 = log(r61925);
        double r61927 = a;
        double r61928 = 0.5;
        double r61929 = r61927 - r61928;
        double r61930 = z;
        double r61931 = log(r61930);
        double r61932 = r61931 - r61925;
        double r61933 = fma(r61926, r61929, r61932);
        double r61934 = r61924 + r61933;
        return r61934;
}

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(\log t, a - 0.5, \log z - t\right)}\]
  6. Final simplification0.3

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

Reproduce

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