Average Error: 0.0 → 0.0
Time: 896.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 r61694 = x;
        double r61695 = y;
        double r61696 = 1.0;
        double r61697 = r61695 - r61696;
        double r61698 = r61694 * r61697;
        double r61699 = 0.5;
        double r61700 = r61695 * r61699;
        double r61701 = r61698 - r61700;
        double r61702 = 0.918938533204673;
        double r61703 = r61701 + r61702;
        return r61703;
}

double f(double x, double y) {
        double r61704 = y;
        double r61705 = x;
        double r61706 = 0.918938533204673;
        double r61707 = fma(r61704, r61705, r61706);
        double r61708 = 1.0;
        double r61709 = 0.5;
        double r61710 = r61704 * r61709;
        double r61711 = fma(r61705, r61708, r61710);
        double r61712 = r61707 - r61711;
        return r61712;
}

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))