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

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.8
Cost776
\[\begin{array}{l} \mathbf{if}\;x \leq -30191952.726829603 \lor \neg \left(x \leq 156.28846301531888\right):\\ \;\;\;\;0.918938533204673 + \left(y \cdot x - x\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 + y \cdot \left(-0.5 + x\right)\\ \end{array}\]
Alternative 2
Error1.0
Cost1090
\[\begin{array}{l} \mathbf{if}\;x \leq -41721232.55595331:\\ \;\;\;\;x \cdot \left(y - 1\right)\\ \mathbf{elif}\;x \leq 69329.01949494769:\\ \;\;\;\;0.918938533204673 + y \cdot \left(-0.5 + x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x - x\\ \end{array}\]
Alternative 3
Error1.5
Cost962
\[\begin{array}{l} \mathbf{if}\;x \leq -0.7439831696747088:\\ \;\;\;\;x \cdot \left(y - 1\right)\\ \mathbf{elif}\;x \leq 0.5337376683324252:\\ \;\;\;\;0.918938533204673 + y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x - x\\ \end{array}\]
Alternative 4
Error1.5
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -0.7439831696747088 \lor \neg \left(x \leq 0.6282717143699204\right):\\ \;\;\;\;y \cdot x - x\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 + y \cdot -0.5\\ \end{array}\]
Alternative 5
Error1.6
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3534290142820549 \lor \neg \left(y \leq 1.5457092694642443\right):\\ \;\;\;\;y \cdot \left(-0.5 + x\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array}\]
Alternative 6
Error9.9
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -30191952.726829603 \lor \neg \left(x \leq 5.403764690913501 \cdot 10^{-09}\right):\\ \;\;\;\;0.918938533204673 - x\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 + y \cdot -0.5\\ \end{array}\]
Alternative 7
Error26.7
Cost192
\[0.918938533204673 - x\]
Alternative 8
Error58.4
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673\]
  2. Simplified0.0

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

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

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

Reproduce

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