Average Error: 0.0 → 0.0
Time: 11.2s
Precision: 64
$\left(x - 1\right) \cdot x$
$\left(x \cdot x - x\right) \cdot 1$
\left(x - 1\right) \cdot x
\left(x \cdot x - x\right) \cdot 1
double f(double x) {
double r54521457 = x;
double r54521458 = 1.0;
double r54521459 = r54521457 - r54521458;
double r54521460 = r54521459 * r54521457;
return r54521460;
}


double f(double x) {
double r54521461 = x;
double r54521462 = r54521461 * r54521461;
double r54521463 = r54521462 - r54521461;
double r54521464 = 1.0;
double r54521465 = r54521463 * r54521464;
return r54521465;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(x - 1\right) \cdot x$
2. Using strategy rm
3. Applied flip3--7.2

$\leadsto \color{blue}{\frac{{x}^{3} - {1}^{3}}{x \cdot x + \left(1 \cdot 1 + x \cdot 1\right)}} \cdot x$
4. Applied associate-*l/10.8

$\leadsto \color{blue}{\frac{\left({x}^{3} - {1}^{3}\right) \cdot x}{x \cdot x + \left(1 \cdot 1 + x \cdot 1\right)}}$
5. Simplified10.8

$\leadsto \frac{\color{blue}{x \cdot \left(\left(x \cdot x\right) \cdot x - \left(1 \cdot 1\right) \cdot 1\right)}}{x \cdot x + \left(1 \cdot 1 + x \cdot 1\right)}$
6. Taylor expanded around 0 0.0

$\leadsto \color{blue}{1 \cdot {x}^{2} - 1 \cdot x}$
7. Simplified0.0

$\leadsto \color{blue}{1 \cdot \left(x \cdot x - x\right)}$
8. Final simplification0.0

$\leadsto \left(x \cdot x - x\right) \cdot 1$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(x-1)*x"
(* (- x 1.0) x))