Average Error: 0.3 → 0.3
Time: 43.1s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\left(\log \left(x + y\right) + \log z\right) - \mathsf{fma}\left(0.5 - a, \log t, t\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\left(\log \left(x + y\right) + \log z\right) - \mathsf{fma}\left(0.5 - a, \log t, t\right)
double f(double x, double y, double z, double t, double a) {
        double r2106080 = x;
        double r2106081 = y;
        double r2106082 = r2106080 + r2106081;
        double r2106083 = log(r2106082);
        double r2106084 = z;
        double r2106085 = log(r2106084);
        double r2106086 = r2106083 + r2106085;
        double r2106087 = t;
        double r2106088 = r2106086 - r2106087;
        double r2106089 = a;
        double r2106090 = 0.5;
        double r2106091 = r2106089 - r2106090;
        double r2106092 = log(r2106087);
        double r2106093 = r2106091 * r2106092;
        double r2106094 = r2106088 + r2106093;
        return r2106094;
}

double f(double x, double y, double z, double t, double a) {
        double r2106095 = x;
        double r2106096 = y;
        double r2106097 = r2106095 + r2106096;
        double r2106098 = log(r2106097);
        double r2106099 = z;
        double r2106100 = log(r2106099);
        double r2106101 = r2106098 + r2106100;
        double r2106102 = 0.5;
        double r2106103 = a;
        double r2106104 = r2106102 - r2106103;
        double r2106105 = t;
        double r2106106 = log(r2106105);
        double r2106107 = fma(r2106104, r2106106, r2106105);
        double r2106108 = r2106101 - r2106107;
        return r2106108;
}

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

    \[\leadsto \color{blue}{\log \left(y + x\right) + \left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right)}\]
  3. Using strategy rm
  4. Applied associate-+r-0.3

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

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

Reproduce

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