Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\[\mathsf{fma}\left(x, y - 1, 0.918938533204673003\right) - y \cdot 0.5\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003
\mathsf{fma}\left(x, y - 1, 0.918938533204673003\right) - y \cdot 0.5
double code(double x, double y) {
	return ((double) (((double) (((double) (x * ((double) (y - 1.0)))) - ((double) (y * 0.5)))) + 0.918938533204673));
}
double code(double x, double y) {
	return ((double) (((double) fma(x, ((double) (y - 1.0)), 0.918938533204673)) - ((double) (y * 0.5))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \mathsf{fma}\left(y, x, 0.918938533204673003\right) - \color{blue}{\left(x \cdot 1 + y \cdot 0.5\right)}\]
  5. Applied associate--r+0.0

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

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

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

Reproduce

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