Average Error: 0.0 → 0.0
Time: 819.0ms
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931\]
\[0.9189385332046730026078762421093415468931 + \mathsf{fma}\left(x, y, -\mathsf{fma}\left(1, x, 0.5 \cdot y\right)\right)\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.9189385332046730026078762421093415468931
0.9189385332046730026078762421093415468931 + \mathsf{fma}\left(x, y, -\mathsf{fma}\left(1, x, 0.5 \cdot y\right)\right)
double f(double x, double y) {
        double r30670 = x;
        double r30671 = y;
        double r30672 = 1.0;
        double r30673 = r30671 - r30672;
        double r30674 = r30670 * r30673;
        double r30675 = 0.5;
        double r30676 = r30671 * r30675;
        double r30677 = r30674 - r30676;
        double r30678 = 0.918938533204673;
        double r30679 = r30677 + r30678;
        return r30679;
}

double f(double x, double y) {
        double r30680 = 0.918938533204673;
        double r30681 = x;
        double r30682 = y;
        double r30683 = 1.0;
        double r30684 = 0.5;
        double r30685 = r30684 * r30682;
        double r30686 = fma(r30683, r30681, r30685);
        double r30687 = -r30686;
        double r30688 = fma(r30681, r30682, r30687);
        double r30689 = r30680 + r30688;
        return r30689;
}

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. Using strategy rm
  3. Applied prod-diff0.0

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, y - 1, -0.5 \cdot y\right) + \mathsf{fma}\left(-0.5, y, 0.5 \cdot y\right)\right)} + 0.9189385332046730026078762421093415468931\]
  4. Simplified0.0

    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(x, y, -\mathsf{fma}\left(1, x, 0.5 \cdot y\right)\right)} + \mathsf{fma}\left(-0.5, y, 0.5 \cdot y\right)\right) + 0.9189385332046730026078762421093415468931\]
  5. Simplified0.0

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

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

Reproduce

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