Average Error: 0.2 → 0.2
Time: 12.6s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\mathsf{fma}\left(\log t, a - 0.5, \mathsf{fma}\left(1, \log \left(x + y\right) + \log z, -t\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(\log t, a - 0.5, \mathsf{fma}\left(1, \log \left(x + y\right) + \log z, -t\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r60245 = x;
        double r60246 = y;
        double r60247 = r60245 + r60246;
        double r60248 = log(r60247);
        double r60249 = z;
        double r60250 = log(r60249);
        double r60251 = r60248 + r60250;
        double r60252 = t;
        double r60253 = r60251 - r60252;
        double r60254 = a;
        double r60255 = 0.5;
        double r60256 = r60254 - r60255;
        double r60257 = log(r60252);
        double r60258 = r60256 * r60257;
        double r60259 = r60253 + r60258;
        return r60259;
}

double f(double x, double y, double z, double t, double a) {
        double r60260 = t;
        double r60261 = log(r60260);
        double r60262 = a;
        double r60263 = 0.5;
        double r60264 = r60262 - r60263;
        double r60265 = 1.0;
        double r60266 = x;
        double r60267 = y;
        double r60268 = r60266 + r60267;
        double r60269 = log(r60268);
        double r60270 = z;
        double r60271 = log(r60270);
        double r60272 = r60269 + r60271;
        double r60273 = -r60260;
        double r60274 = fma(r60265, r60272, r60273);
        double r60275 = fma(r60261, r60264, r60274);
        return r60275;
}

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log t, a - 0.5, \left(\log \left(x + y\right) + \log z\right) - t\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.2

    \[\leadsto \mathsf{fma}\left(\log t, a - 0.5, \color{blue}{1 \cdot \left(\log \left(x + y\right) + \log z\right)} - t\right)\]
  5. Applied fma-neg0.2

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

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

Reproduce

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