Average Error: 0.1 → 0.1
Time: 6.7s
Precision: 64
$x \cdot \left(\left(x \cdot x + x\right) + x\right)$
$\left(\left(x + 2\right) \cdot x\right) \cdot x$
x \cdot \left(\left(x \cdot x + x\right) + x\right)
\left(\left(x + 2\right) \cdot x\right) \cdot x
double f(double x) {
double r1403656 = x;
double r1403657 = r1403656 * r1403656;
double r1403658 = r1403657 + r1403656;
double r1403659 = r1403658 + r1403656;
double r1403660 = r1403656 * r1403659;
return r1403660;
}


double f(double x) {
double r1403661 = x;
double r1403662 = 2.0;
double r1403663 = r1403661 + r1403662;
double r1403664 = r1403663 * r1403661;
double r1403665 = r1403664 * r1403661;
return r1403665;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.1

$x \cdot \left(\left(x \cdot x + x\right) + x\right)$
2. Simplified0.1

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

$\leadsto \left(\left(x + 2\right) \cdot x\right) \cdot x$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(x * (x * x + x+ x))"
:precision binary64
(* x (+ (+ (* x x) x) x)))