Average Error: 0.1 → 0.1
Time: 13.6s
Precision: 64
\[\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot x\right) \cdot x - 56 \cdot x\right) \cdot x + x\]
\[x + x \cdot \left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right)\right)\]
\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot x\right) \cdot x - 56 \cdot x\right) \cdot x + x
x + x \cdot \left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right)\right)
double f(double x) {
        double r160359 = x;
        double r160360 = r160359 * r160359;
        double r160361 = 7.0;
        double r160362 = r160361 * r160359;
        double r160363 = r160360 - r160362;
        double r160364 = r160363 * r160359;
        double r160365 = 28.0;
        double r160366 = r160365 * r160359;
        double r160367 = r160364 + r160366;
        double r160368 = r160367 * r160359;
        double r160369 = 56.0;
        double r160370 = r160369 * r160359;
        double r160371 = r160368 - r160370;
        double r160372 = r160371 * r160359;
        double r160373 = r160372 + r160359;
        return r160373;
}

double f(double x) {
        double r160374 = x;
        double r160375 = 28.0;
        double r160376 = r160375 * r160374;
        double r160377 = 2.0;
        double r160378 = pow(r160374, r160377);
        double r160379 = 7.0;
        double r160380 = r160374 - r160379;
        double r160381 = r160378 * r160380;
        double r160382 = r160376 + r160381;
        double r160383 = 56.0;
        double r160384 = r160382 - r160383;
        double r160385 = r160374 * r160384;
        double r160386 = r160374 * r160385;
        double r160387 = r160374 + r160386;
        return r160387;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

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

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

    \[\leadsto \left(x \cdot \left(\color{blue}{\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right)} - 56\right) + 1\right) \cdot x\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.1

    \[\leadsto \color{blue}{\left(1 \cdot \left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right) + 1\right)\right)} \cdot x\]
  7. Applied associate-*l*0.1

    \[\leadsto \color{blue}{1 \cdot \left(\left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right) + 1\right) \cdot x\right)}\]
  8. Simplified0.1

    \[\leadsto 1 \cdot \color{blue}{\left(x + x \cdot \left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right)\right)\right)}\]
  9. Final simplification0.1

    \[\leadsto x + x \cdot \left(x \cdot \left(\left(28 \cdot x + {x}^{2} \cdot \left(x - 7\right)\right) - 56\right)\right)\]

Reproduce

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