Average Error: 0.0 → 0.0
Time: 1.2s
Precision: 64
$\left|x\right| \le 1$
$\left(2 \cdot x\right) \cdot x - 1$
$\left(x \cdot 2\right) \cdot x - 1$
\left(2 \cdot x\right) \cdot x - 1
\left(x \cdot 2\right) \cdot x - 1
double f(double x) {
double r58343764 = 2.0;
double r58343765 = x;
double r58343766 = r58343764 * r58343765;
double r58343767 = r58343766 * r58343765;
double r58343768 = 1.0;
double r58343769 = r58343767 - r58343768;
return r58343769;
}


double f(double x) {
double r58343770 = x;
double r58343771 = 2.0;
double r58343772 = r58343770 * r58343771;
double r58343773 = r58343772 * r58343770;
double r58343774 = 1.0;
double r58343775 = r58343773 - r58343774;
return r58343775;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(2 \cdot x\right) \cdot x - 1$
2. Final simplification0.0

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

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "2*x*x-1"
:pre (<= (fabs x) 1.0)
(- (* (* 2.0 x) x) 1.0))