Average Error: 0.3 → 0.3
Time: 41.6s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\log \left(\sqrt{x + y}\right) + \left(\log \left(\sqrt{x + y}\right) + \left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\log \left(\sqrt{x + y}\right) + \left(\log \left(\sqrt{x + y}\right) + \left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r2753012 = x;
        double r2753013 = y;
        double r2753014 = r2753012 + r2753013;
        double r2753015 = log(r2753014);
        double r2753016 = z;
        double r2753017 = log(r2753016);
        double r2753018 = r2753015 + r2753017;
        double r2753019 = t;
        double r2753020 = r2753018 - r2753019;
        double r2753021 = a;
        double r2753022 = 0.5;
        double r2753023 = r2753021 - r2753022;
        double r2753024 = log(r2753019);
        double r2753025 = r2753023 * r2753024;
        double r2753026 = r2753020 + r2753025;
        return r2753026;
}

double f(double x, double y, double z, double t, double a) {
        double r2753027 = x;
        double r2753028 = y;
        double r2753029 = r2753027 + r2753028;
        double r2753030 = sqrt(r2753029);
        double r2753031 = log(r2753030);
        double r2753032 = z;
        double r2753033 = log(r2753032);
        double r2753034 = 0.5;
        double r2753035 = a;
        double r2753036 = r2753034 - r2753035;
        double r2753037 = t;
        double r2753038 = log(r2753037);
        double r2753039 = fma(r2753036, r2753038, r2753037);
        double r2753040 = r2753033 - r2753039;
        double r2753041 = r2753031 + r2753040;
        double r2753042 = r2753031 + r2753041;
        return r2753042;
}

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 add-sqr-sqrt0.3

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

    \[\leadsto \color{blue}{\left(\log \left(\sqrt{y + x}\right) + \log \left(\sqrt{y + x}\right)\right)} + \left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right)\]
  6. Applied associate-+l+0.3

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

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

Reproduce

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