Average Error: 0.2 → 0.2
Time: 18.3s
Precision: 64
\[\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x\]
\[\left(\left({x}^{4} - 35 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x\]
\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x
\left(\left({x}^{4} - 35 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x
double f(double x) {
        double r366399 = x;
        double r366400 = r366399 * r366399;
        double r366401 = 7.0;
        double r366402 = r366401 * r366399;
        double r366403 = r366400 - r366402;
        double r366404 = r366403 * r366399;
        double r366405 = 28.0;
        double r366406 = 2.0;
        double r366407 = pow(r366399, r366406);
        double r366408 = r366405 * r366407;
        double r366409 = r366404 + r366408;
        double r366410 = r366409 * r366399;
        double r366411 = 56.0;
        double r366412 = 3.0;
        double r366413 = pow(r366399, r366412);
        double r366414 = r366411 * r366413;
        double r366415 = r366410 - r366414;
        double r366416 = r366415 * r366399;
        double r366417 = 70.0;
        double r366418 = 4.0;
        double r366419 = pow(r366399, r366418);
        double r366420 = r366417 * r366419;
        double r366421 = r366416 + r366420;
        double r366422 = r366421 * r366399;
        return r366422;
}

double f(double x) {
        double r366423 = x;
        double r366424 = 4.0;
        double r366425 = pow(r366423, r366424);
        double r366426 = 35.0;
        double r366427 = 3.0;
        double r366428 = pow(r366423, r366427);
        double r366429 = r366426 * r366428;
        double r366430 = r366425 - r366429;
        double r366431 = r366430 * r366423;
        double r366432 = 70.0;
        double r366433 = 4.0;
        double r366434 = pow(r366423, r366433);
        double r366435 = r366432 * r366434;
        double r366436 = r366431 + r366435;
        double r366437 = r366436 * r366423;
        return r366437;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \left(\left(\color{blue}{\left(21 \cdot {x}^{2} + {x}^{3}\right)} \cdot x - 56 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x\]
  3. Simplified0.2

    \[\leadsto \left(\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(21 + x\right)\right)} \cdot x - 56 \cdot {x}^{3}\right) \cdot x + 70 \cdot {x}^{4}\right) \cdot x\]
  4. Taylor expanded around 0 0.2

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

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

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "((((x*x-7*x)*x+28*pow(x,2))*x - 56*pow(x,3))*x + 70*pow(x,4))*x"
  :precision binary64
  (* (+ (* (- (* (+ (* (- (* x x) (* 7 x)) x) (* 28 (pow x 2))) x) (* 56 (pow x 3))) x) (* 70 (pow x 4))) x))