Average Error: 0.0 → 0.0
Time: 43.1s
Precision: binary64
Cost: 448
\[\left(x \cdot y + x\right) + y\]
\[y + \left(x + y \cdot x\right)\]
\left(x \cdot y + x\right) + y
y + \left(x + y \cdot x\right)
(FPCore (x y) :precision binary64 (+ (+ (* x y) x) y))
(FPCore (x y) :precision binary64 (+ y (+ x (* y x))))
double code(double x, double y) {
	return ((x * y) + x) + y;
}
double code(double x, double y) {
	return y + (x + (y * 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.9
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.007520315792716 \lor \neg \left(y \leq 0.005718177372860409\right):\\ \;\;\;\;y + y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array}\]
Alternative 2
Error9.6
Cost192
\[y + x\]
Alternative 3
Error61.8
Cost64
\[1\]

Error

Time

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + x\right) + y\]
  2. Using strategy rm
  3. Applied +-commutative_binary64_71690.0

    \[\leadsto \color{blue}{\left(x + x \cdot y\right)} + y\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021040 
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))