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

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. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto \left(x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - y \cdot 0.5\right) + 0.918938533204673003\]
  4. Applied distribute-lft-in0.0

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

    \[\leadsto \color{blue}{\left(x \cdot y + \left(x \cdot \left(-1\right) - y \cdot 0.5\right)\right)} + 0.918938533204673003\]
  6. Applied associate-+l+0.0

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

    \[\leadsto x \cdot y + \color{blue}{\left(0.918938533204673003 - \left(1 \cdot x + 0.5 \cdot y\right)\right)}\]
  8. Using strategy rm
  9. Applied associate-+r-0.0

    \[\leadsto \color{blue}{\left(x \cdot y + 0.918938533204673003\right) - \left(1 \cdot x + 0.5 \cdot y\right)}\]
  10. Final simplification0.0

    \[\leadsto \left(x \cdot y + 0.918938533204673003\right) - \left(1 \cdot x + 0.5 \cdot y\right)\]

Reproduce

herbie shell --seed 2020100 
(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))