Average Error: 0.3 → 0.3
Time: 36.2s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\left(\log z - t\right) + \mathsf{fma}\left(a - 0.5, \log t, \log \left(x + y\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\left(\log z - t\right) + \mathsf{fma}\left(a - 0.5, \log t, \log \left(x + y\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r2042092 = x;
        double r2042093 = y;
        double r2042094 = r2042092 + r2042093;
        double r2042095 = log(r2042094);
        double r2042096 = z;
        double r2042097 = log(r2042096);
        double r2042098 = r2042095 + r2042097;
        double r2042099 = t;
        double r2042100 = r2042098 - r2042099;
        double r2042101 = a;
        double r2042102 = 0.5;
        double r2042103 = r2042101 - r2042102;
        double r2042104 = log(r2042099);
        double r2042105 = r2042103 * r2042104;
        double r2042106 = r2042100 + r2042105;
        return r2042106;
}

double f(double x, double y, double z, double t, double a) {
        double r2042107 = z;
        double r2042108 = log(r2042107);
        double r2042109 = t;
        double r2042110 = r2042108 - r2042109;
        double r2042111 = a;
        double r2042112 = 0.5;
        double r2042113 = r2042111 - r2042112;
        double r2042114 = log(r2042109);
        double r2042115 = x;
        double r2042116 = y;
        double r2042117 = r2042115 + r2042116;
        double r2042118 = log(r2042117);
        double r2042119 = fma(r2042113, r2042114, r2042118);
        double r2042120 = r2042110 + r2042119;
        return r2042120;
}

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

    \[\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.2

    \[\leadsto \log \left(x + y\right) + \color{blue}{\mathsf{fma}\left(\log t, a - 0.5, \log z - t\right)}\]
  6. Using strategy rm
  7. Applied fma-udef0.2

    \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\log t \cdot \left(a - 0.5\right) + \left(\log z - t\right)\right)}\]
  8. Applied associate-+r+0.3

    \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right) + \left(\log z - t\right)}\]
  9. Simplified0.3

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

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

Reproduce

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