Average Error: 0.0 → 0.0
Time: 986.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 r53893 = x;
        double r53894 = y;
        double r53895 = 1.0;
        double r53896 = r53894 - r53895;
        double r53897 = r53893 * r53896;
        double r53898 = 0.5;
        double r53899 = r53894 * r53898;
        double r53900 = r53897 - r53899;
        double r53901 = 0.918938533204673;
        double r53902 = r53900 + r53901;
        return r53902;
}

double f(double x, double y) {
        double r53903 = y;
        double r53904 = x;
        double r53905 = 0.918938533204673;
        double r53906 = fma(r53903, r53904, r53905);
        double r53907 = 1.0;
        double r53908 = 0.5;
        double r53909 = r53903 * r53908;
        double r53910 = fma(r53904, r53907, r53909);
        double r53911 = r53906 - r53910;
        return r53911;
}

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