Average Error: 0.0 → 0.0
Time: 961.0ms
Precision: binary64
\[\left(\left(\left(x + 2 \cdot x\right) - 3 \cdot x\right) - x\right) + {x}^{2}\]
\[{x}^{2} + x \cdot \left(2 - 3\right)\]
\left(\left(\left(x + 2 \cdot x\right) - 3 \cdot x\right) - x\right) + {x}^{2}
{x}^{2} + x \cdot \left(2 - 3\right)
double code(double x) {
	return ((double) (((double) (((double) (((double) (x + ((double) (2.0 * x)))) - ((double) (3.0 * x)))) - x)) + ((double) pow(x, 2.0))));
}
double code(double x) {
	return ((double) (((double) pow(x, 2.0)) + ((double) (x * ((double) (2.0 - 3.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.0

    \[\left(\left(\left(x + 2 \cdot x\right) - 3 \cdot x\right) - x\right) + {x}^{2}\]
  2. Simplified0.0

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

    \[\leadsto {x}^{2} + x \cdot \left(2 - 3\right)\]

Reproduce

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