Average Error: 0.0 → 0.0
Time: 1.3s
Precision: binary64
\[\left(x \cdot y + x\right) + y\]
\[x \cdot \left(y + 1\right) + y\]
\left(x \cdot y + x\right) + y
x \cdot \left(y + 1\right) + y
double code(double x, double y) {
	return ((double) (((double) (((double) (x * y)) + x)) + y));
}
double code(double x, double y) {
	return ((double) (((double) (x * ((double) (y + 1.0)))) + 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 y + x\right) + y\]
  2. Using strategy rm
  3. Applied flip-+20.6

    \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right) - x \cdot x}{x \cdot y - x}} + y\]
  4. Simplified23.2

    \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot \left(x \cdot y\right) - x\right)}}{x \cdot y - x} + y\]
  5. Using strategy rm
  6. Applied *-un-lft-identity23.2

    \[\leadsto \frac{x \cdot \left(y \cdot \left(x \cdot y\right) - x\right)}{\color{blue}{1 \cdot \left(x \cdot y - x\right)}} + y\]
  7. Applied times-frac9.2

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y \cdot \left(x \cdot y\right) - x}{x \cdot y - x}} + y\]
  8. Simplified9.2

    \[\leadsto \color{blue}{x} \cdot \frac{y \cdot \left(x \cdot y\right) - x}{x \cdot y - x} + y\]
  9. Taylor expanded around 0 0.0

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

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

Reproduce

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