Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Search for

# test_simplify.cpp

    00001
    00002 #include <FunDef.h>
    00003
    00004 using namespace std;
    00005
    00006 int main() {
    00007
    00008     Sym c1 = SymConst(0.4);
    00009     Sym c2 = SymConst(0.3);
    00010     Sym v1 = SymVar(0);
    00011
    00012     Sym expr = (c1 + c2) * ( (c1 + c2) * v1);
    00013
    00014     cout << expr << endl;
    00015     cout << simplify(expr) << endl;
    00016
    00017     Sym dv = differentiate( exp(expr) , v1.token());
    00018     cout << dv << endl;
    00019     cout << simplify(dv) << endl;
    00020 }
    00021