Average Error: 0.0 → 0.0
Time: 807.0ms
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\[\mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003
\mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)
double f(double x, double y) {
        double r48434 = x;
        double r48435 = y;
        double r48436 = 1.0;
        double r48437 = r48435 - r48436;
        double r48438 = r48434 * r48437;
        double r48439 = 0.5;
        double r48440 = r48435 * r48439;
        double r48441 = r48438 - r48440;
        double r48442 = 0.918938533204673;
        double r48443 = r48441 + r48442;
        return r48443;
}

double f(double x, double y) {
        double r48444 = y;
        double r48445 = x;
        double r48446 = 0.918938533204673;
        double r48447 = fma(r48444, r48445, r48446);
        double r48448 = 1.0;
        double r48449 = 0.5;
        double r48450 = r48444 * r48449;
        double r48451 = fma(r48445, r48448, r48450);
        double r48452 = r48447 - r48451;
        return r48452;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)}\]
  3. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)\]

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (* x (- y 1)) (* y 0.5)) 0.918938533204673))