Average Error: 0.3 → 0.3
Time: 38.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(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(x + y\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 r60264 = x;
        double r60265 = y;
        double r60266 = r60264 + r60265;
        double r60267 = log(r60266);
        double r60268 = z;
        double r60269 = log(r60268);
        double r60270 = r60267 + r60269;
        double r60271 = t;
        double r60272 = r60270 - r60271;
        double r60273 = a;
        double r60274 = 0.5;
        double r60275 = r60273 - r60274;
        double r60276 = log(r60271);
        double r60277 = r60275 * r60276;
        double r60278 = r60272 + r60277;
        return r60278;
}

double f(double x, double y, double z, double t, double a) {
        double r60279 = x;
        double r60280 = y;
        double r60281 = r60279 + r60280;
        double r60282 = log(r60281);
        double r60283 = a;
        double r60284 = 0.5;
        double r60285 = r60283 - r60284;
        double r60286 = t;
        double r60287 = log(r60286);
        double r60288 = z;
        double r60289 = log(r60288);
        double r60290 = r60289 - r60286;
        double r60291 = fma(r60285, r60287, r60290);
        double r60292 = r60282 + r60291;
        return r60292;
}

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

Reproduce

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