Average Error: 0.0 → 0.0
Time: 1.9s
Precision: binary64
\[x \cdot \left(y + y\right)\]
\[\left(x \cdot 2\right) \cdot y\]
x \cdot \left(y + y\right)
\left(x \cdot 2\right) \cdot y
double code(double x, double y) {
	return ((double) (x * ((double) (y + y))));
}
double code(double x, double y) {
	return ((double) (((double) (x * 2.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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020182 
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:simpson  from integration-0.2.1"
  :precision binary64
  (* x (+ y y)))