Average Error: 0.0 → 0.0
Time: 794.0ms
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\[\mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003
\mathsf{fma}\left(y, x, 0.918938533204673003\right) - \mathsf{fma}\left(x, 1, y \cdot 0.5\right)
double f(double x, double y) {
        double r74984 = x;
        double r74985 = y;
        double r74986 = 1.0;
        double r74987 = r74985 - r74986;
        double r74988 = r74984 * r74987;
        double r74989 = 0.5;
        double r74990 = r74985 * r74989;
        double r74991 = r74988 - r74990;
        double r74992 = 0.918938533204673;
        double r74993 = r74991 + r74992;
        return r74993;
}

double f(double x, double y) {
        double r74994 = y;
        double r74995 = x;
        double r74996 = 0.918938533204673;
        double r74997 = fma(r74994, r74995, r74996);
        double r74998 = 1.0;
        double r74999 = 0.5;
        double r75000 = r74994 * r74999;
        double r75001 = fma(r74995, r74998, r75000);
        double r75002 = r74997 - r75001;
        return r75002;
}

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.918938533204673003\]
  2. Simplified0.0

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

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

Reproduce

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