Average Error: 0.3 → 0.2
Time: 9.7s
Precision: 64
\[\left(x \cdot x - 3 \cdot x\right) \cdot x + 6 \cdot {x}^{2}\]
\[\left(x \cdot \left(3 + x\right)\right) \cdot x\]
\left(x \cdot x - 3 \cdot x\right) \cdot x + 6 \cdot {x}^{2}
\left(x \cdot \left(3 + x\right)\right) \cdot x
double f(double x) {
        double r253725 = x;
        double r253726 = r253725 * r253725;
        double r253727 = 3.0;
        double r253728 = r253727 * r253725;
        double r253729 = r253726 - r253728;
        double r253730 = r253729 * r253725;
        double r253731 = 6.0;
        double r253732 = 2.0;
        double r253733 = pow(r253725, r253732);
        double r253734 = r253731 * r253733;
        double r253735 = r253730 + r253734;
        return r253735;
}

double f(double x) {
        double r253736 = x;
        double r253737 = 3.0;
        double r253738 = r253737 + r253736;
        double r253739 = r253736 * r253738;
        double r253740 = r253739 * r253736;
        return r253740;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\left(x \cdot x - 3 \cdot x\right) \cdot x + 6 \cdot {x}^{2}\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {x}^{2} + {x}^{3}}\]
  3. Simplified0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(3 + x\right)}\]
  4. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {x}^{2} + {x}^{3}}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{\left(x \cdot \left(3 + x\right)\right) \cdot x}\]
  6. Final simplification0.2

    \[\leadsto \left(x \cdot \left(3 + x\right)\right) \cdot x\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "(x*x-3*x)*x+6*pow(x,2)"
  :precision binary64
  (+ (* (- (* x x) (* 3 x)) x) (* 6 (pow x 2))))