Average Error: 0.3 → 0.3
Time: 37.5s
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 r2493181 = x;
        double r2493182 = y;
        double r2493183 = r2493181 + r2493182;
        double r2493184 = log(r2493183);
        double r2493185 = z;
        double r2493186 = log(r2493185);
        double r2493187 = r2493184 + r2493186;
        double r2493188 = t;
        double r2493189 = r2493187 - r2493188;
        double r2493190 = a;
        double r2493191 = 0.5;
        double r2493192 = r2493190 - r2493191;
        double r2493193 = log(r2493188);
        double r2493194 = r2493192 * r2493193;
        double r2493195 = r2493189 + r2493194;
        return r2493195;
}

double f(double x, double y, double z, double t, double a) {
        double r2493196 = y;
        double r2493197 = x;
        double r2493198 = r2493196 + r2493197;
        double r2493199 = log(r2493198);
        double r2493200 = a;
        double r2493201 = 0.5;
        double r2493202 = r2493200 - r2493201;
        double r2493203 = t;
        double r2493204 = log(r2493203);
        double r2493205 = z;
        double r2493206 = log(r2493205);
        double r2493207 = r2493206 - r2493203;
        double r2493208 = fma(r2493202, r2493204, r2493207);
        double r2493209 = r2493199 + r2493208;
        return r2493209;
}

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