Average Error: 0.0 → 0.0
Time: 869.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 r41143 = x;
        double r41144 = y;
        double r41145 = 1.0;
        double r41146 = r41144 - r41145;
        double r41147 = r41143 * r41146;
        double r41148 = 0.5;
        double r41149 = r41144 * r41148;
        double r41150 = r41147 - r41149;
        double r41151 = 0.918938533204673;
        double r41152 = r41150 + r41151;
        return r41152;
}

double f(double x, double y) {
        double r41153 = y;
        double r41154 = x;
        double r41155 = 0.918938533204673;
        double r41156 = fma(r41153, r41154, r41155);
        double r41157 = 1.0;
        double r41158 = 0.5;
        double r41159 = r41153 * r41158;
        double r41160 = fma(r41154, r41157, r41159);
        double r41161 = r41156 - r41160;
        return r41161;
}

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