Polynomial is a C++ class facilitating the evaluation of polynomials of a single indeterminate.
example1.cpp evaluates f(x) = 2x3 - 3x2 + 4x + 1 for values of x between -10 and 10.
example2.cpp evaluates f(x) = x4 + 2x3 - 3x2 + 4x + 1 and its derivative for values of x between -10 and 10.
See test.cpp for more examples.
To build the examples:
$ mkdir build $ cd build $ cmake .. $ make
To run examples:
$ ./example1 $ ./example2
To build the tests:
$ mkdir build $ cd build $ cmake .. $ make
To run the tests:
./test