Average Error: 0.0 → 0.0
Time: 857.0ms
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931\]
\[\mathsf{fma}\left(x, y, -\mathsf{fma}\left(1, x, 0.5 \cdot y\right)\right) + 0.9189385332046730026078762421093415468931\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931
\mathsf{fma}\left(x, y, -\mathsf{fma}\left(1, x, 0.5 \cdot y\right)\right) + 0.9189385332046730026078762421093415468931
double f(double x, double y) {
        double r62229 = x;
        double r62230 = y;
        double r62231 = 1.0;
        double r62232 = r62230 - r62231;
        double r62233 = r62229 * r62232;
        double r62234 = 0.5;
        double r62235 = r62230 * r62234;
        double r62236 = r62233 - r62235;
        double r62237 = 0.918938533204673;
        double r62238 = r62236 + r62237;
        return r62238;
}

double f(double x, double y) {
        double r62239 = x;
        double r62240 = y;
        double r62241 = 1.0;
        double r62242 = 0.5;
        double r62243 = r62242 * r62240;
        double r62244 = fma(r62241, r62239, r62243);
        double r62245 = -r62244;
        double r62246 = fma(r62239, r62240, r62245);
        double r62247 = 0.918938533204673;
        double r62248 = r62246 + r62247;
        return r62248;
}

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. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{\left(x \cdot y - \left(1 \cdot x + 0.5 \cdot y\right)\right)} + 0.9189385332046730026078762421093415468931\]
  3. Simplified0.0

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

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

Reproduce

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