Average Error: 0.3 → 0.3
Time: 33.7s
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) + \left(\log t \cdot \left(a - 0.5\right) - 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) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
double f(double x, double y, double z, double t, double a) {
        double r63462 = x;
        double r63463 = y;
        double r63464 = r63462 + r63463;
        double r63465 = log(r63464);
        double r63466 = z;
        double r63467 = log(r63466);
        double r63468 = r63465 + r63467;
        double r63469 = t;
        double r63470 = r63468 - r63469;
        double r63471 = a;
        double r63472 = 0.5;
        double r63473 = r63471 - r63472;
        double r63474 = log(r63469);
        double r63475 = r63473 * r63474;
        double r63476 = r63470 + r63475;
        return r63476;
}

double f(double x, double y, double z, double t, double a) {
        double r63477 = x;
        double r63478 = y;
        double r63479 = r63477 + r63478;
        double r63480 = log(r63479);
        double r63481 = z;
        double r63482 = log(r63481);
        double r63483 = r63480 + r63482;
        double r63484 = t;
        double r63485 = log(r63484);
        double r63486 = a;
        double r63487 = 0.5;
        double r63488 = r63486 - r63487;
        double r63489 = r63485 * r63488;
        double r63490 = r63489 - r63484;
        double r63491 = r63483 + r63490;
        return r63491;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 sub-neg0.3

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

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

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

    \[\leadsto \left(\log \left(x + y\right) + \log z\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\]

Reproduce

herbie shell --seed 2019305 
(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))))