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

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.918938533204673 \]
  2. Applied sub-neg_binary640.0

    \[\leadsto \left(x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - y \cdot 0.5\right) + 0.918938533204673 \]
  3. Applied distribute-rgt-in_binary640.0

    \[\leadsto \left(\color{blue}{\left(y \cdot x + \left(-1\right) \cdot x\right)} - y \cdot 0.5\right) + 0.918938533204673 \]
  4. Applied associate--l+_binary640.0

    \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(-1\right) \cdot x - y \cdot 0.5\right)\right)} + 0.918938533204673 \]
  5. Applied associate-+l+_binary640.0

    \[\leadsto \color{blue}{y \cdot x + \left(\left(\left(-1\right) \cdot x - y \cdot 0.5\right) + 0.918938533204673\right)} \]
  6. Simplified0.0

    \[\leadsto y \cdot x + \color{blue}{\left(0.918938533204673 - \mathsf{fma}\left(y, 0.5, x\right)\right)} \]
  7. Applied fma-def_binary640.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, 0.918938533204673 - \mathsf{fma}\left(y, 0.5, x\right)\right)} \]
  8. Final simplification0.0

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

Reproduce

herbie shell --seed 2022125 
(FPCore (x y)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))