Average Error: 0.3 → 0.3
Time: 10.3s
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 r61091 = x;
        double r61092 = y;
        double r61093 = r61091 + r61092;
        double r61094 = log(r61093);
        double r61095 = z;
        double r61096 = log(r61095);
        double r61097 = r61094 + r61096;
        double r61098 = t;
        double r61099 = r61097 - r61098;
        double r61100 = a;
        double r61101 = 0.5;
        double r61102 = r61100 - r61101;
        double r61103 = log(r61098);
        double r61104 = r61102 * r61103;
        double r61105 = r61099 + r61104;
        return r61105;
}

double f(double x, double y, double z, double t, double a) {
        double r61106 = x;
        double r61107 = y;
        double r61108 = r61106 + r61107;
        double r61109 = log(r61108);
        double r61110 = t;
        double r61111 = log(r61110);
        double r61112 = a;
        double r61113 = 0.5;
        double r61114 = r61112 - r61113;
        double r61115 = z;
        double r61116 = log(r61115);
        double r61117 = r61116 - r61110;
        double r61118 = fma(r61111, r61114, r61117);
        double r61119 = r61109 + r61118;
        return r61119;
}

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