Average Error: 0.0 → 0.0
Time: 811.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 r41036 = x;
        double r41037 = y;
        double r41038 = 1.0;
        double r41039 = r41037 - r41038;
        double r41040 = r41036 * r41039;
        double r41041 = 0.5;
        double r41042 = r41037 * r41041;
        double r41043 = r41040 - r41042;
        double r41044 = 0.918938533204673;
        double r41045 = r41043 + r41044;
        return r41045;
}

double f(double x, double y) {
        double r41046 = y;
        double r41047 = x;
        double r41048 = 0.918938533204673;
        double r41049 = fma(r41046, r41047, r41048);
        double r41050 = 1.0;
        double r41051 = 0.5;
        double r41052 = r41046 * r41051;
        double r41053 = fma(r41047, r41050, r41052);
        double r41054 = r41049 - r41053;
        return r41054;
}

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