Average Error: 0.0 → 0.0
Time: 826.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 r72588 = x;
        double r72589 = y;
        double r72590 = 1.0;
        double r72591 = r72589 - r72590;
        double r72592 = r72588 * r72591;
        double r72593 = 0.5;
        double r72594 = r72589 * r72593;
        double r72595 = r72592 - r72594;
        double r72596 = 0.918938533204673;
        double r72597 = r72595 + r72596;
        return r72597;
}

double f(double x, double y) {
        double r72598 = y;
        double r72599 = x;
        double r72600 = 0.918938533204673;
        double r72601 = fma(r72598, r72599, r72600);
        double r72602 = 1.0;
        double r72603 = 0.5;
        double r72604 = r72598 * r72603;
        double r72605 = fma(r72599, r72602, r72604);
        double r72606 = r72601 - r72605;
        return r72606;
}

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