Average Error: 0.1 → 0.1
Time: 13.9s
Precision: 64
$\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot x\right) \cdot x - 56 \cdot x$
$\left({x}^{4} - 7 \cdot {x}^{3}\right) + \left(28 \cdot x - 56\right) \cdot x$
\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot x\right) \cdot x - 56 \cdot x
\left({x}^{4} - 7 \cdot {x}^{3}\right) + \left(28 \cdot x - 56\right) \cdot x
double f(double x) {
double r152163 = x;
double r152164 = r152163 * r152163;
double r152165 = 7.0;
double r152166 = r152165 * r152163;
double r152167 = r152164 - r152166;
double r152168 = r152167 * r152163;
double r152169 = 28.0;
double r152170 = r152169 * r152163;
double r152171 = r152168 + r152170;
double r152172 = r152171 * r152163;
double r152173 = 56.0;
double r152174 = r152173 * r152163;
double r152175 = r152172 - r152174;
return r152175;
}


double f(double x) {
double r152176 = x;
double r152177 = 4.0;
double r152178 = pow(r152176, r152177);
double r152179 = 7.0;
double r152180 = 3.0;
double r152181 = pow(r152176, r152180);
double r152182 = r152179 * r152181;
double r152183 = r152178 - r152182;
double r152184 = 28.0;
double r152185 = r152184 * r152176;
double r152186 = 56.0;
double r152187 = r152185 - r152186;
double r152188 = r152187 * r152176;
double r152189 = r152183 + r152188;
return r152189;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.1

$\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot x\right) \cdot x - 56 \cdot x$
2. Simplified0.1

$\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot \left(x - 7\right) + 28\right) - 56\right)}$
3. Using strategy rm
4. Applied distribute-rgt-in0.1

$\leadsto x \cdot \left(\color{blue}{\left(\left(x \cdot \left(x - 7\right)\right) \cdot x + 28 \cdot x\right)} - 56\right)$
5. Applied associate--l+0.1

$\leadsto x \cdot \color{blue}{\left(\left(x \cdot \left(x - 7\right)\right) \cdot x + \left(28 \cdot x - 56\right)\right)}$
6. Applied distribute-rgt-in0.1

$\leadsto \color{blue}{\left(\left(x \cdot \left(x - 7\right)\right) \cdot x\right) \cdot x + \left(28 \cdot x - 56\right) \cdot x}$
7. Simplified0.1

$\leadsto \color{blue}{\left(x - 7\right) \cdot {x}^{3}} + \left(28 \cdot x - 56\right) \cdot x$
8. Taylor expanded around 0 0.1

$\leadsto \color{blue}{\left({x}^{4} - 7 \cdot {x}^{3}\right)} + \left(28 \cdot x - 56\right) \cdot x$
9. Final simplification0.1

$\leadsto \left({x}^{4} - 7 \cdot {x}^{3}\right) + \left(28 \cdot x - 56\right) \cdot x$

# Reproduce

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