Average Error: 0.0 → 0.0
Time: 807.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 r44344 = x;
        double r44345 = y;
        double r44346 = 1.0;
        double r44347 = r44345 - r44346;
        double r44348 = r44344 * r44347;
        double r44349 = 0.5;
        double r44350 = r44345 * r44349;
        double r44351 = r44348 - r44350;
        double r44352 = 0.918938533204673;
        double r44353 = r44351 + r44352;
        return r44353;
}

double f(double x, double y) {
        double r44354 = 0.918938533204673;
        double r44355 = x;
        double r44356 = y;
        double r44357 = 1.0;
        double r44358 = 0.5;
        double r44359 = r44358 * r44356;
        double r44360 = fma(r44357, r44355, r44359);
        double r44361 = -r44360;
        double r44362 = fma(r44355, r44356, r44361);
        double r44363 = r44354 + r44362;
        return r44363;
}

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