Average Error: 0 → 0
Time: 561.0ms
Precision: binary64
\[\left(2 \cdot x + x\right) + x\]
\[x \cdot \left(2 + 2\right)\]
\left(2 \cdot x + x\right) + x
x \cdot \left(2 + 2\right)
double code(double x) {
	return ((double) (((double) (((double) (2.0 * x)) + x)) + x));
}
double code(double x) {
	return ((double) (x * ((double) (2.0 + 2.0))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[\left(2 \cdot x + x\right) + x\]
  2. Simplified0

    \[\leadsto \color{blue}{x \cdot \left(2 + 2\right)}\]
  3. Final simplification0

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

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(+ (+ (* 2 x) x) x)"
  :precision binary64
  (+ (+ (* 2.0 x) x) x))