Average Error: 0.0 → 0.0
Time: 974.0ms
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931\]
\[\mathsf{fma}\left(y, x, 0.9189385332046730026078762421093415468931\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931
\mathsf{fma}\left(y, x, 0.9189385332046730026078762421093415468931\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)
double f(double x, double y) {
        double r58286 = x;
        double r58287 = y;
        double r58288 = 1.0;
        double r58289 = r58287 - r58288;
        double r58290 = r58286 * r58289;
        double r58291 = 0.5;
        double r58292 = r58287 * r58291;
        double r58293 = r58290 - r58292;
        double r58294 = 0.918938533204673;
        double r58295 = r58293 + r58294;
        return r58295;
}

double f(double x, double y) {
        double r58296 = y;
        double r58297 = x;
        double r58298 = 0.918938533204673;
        double r58299 = fma(r58296, r58297, r58298);
        double r58300 = 1.0;
        double r58301 = 0.5;
        double r58302 = r58296 * r58301;
        double r58303 = fma(r58297, r58300, r58302);
        double r58304 = r58299 - r58303;
        return r58304;
}

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.9189385332046730026078762421093415468931\]
  2. Simplified0.0

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

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

Reproduce

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