|
FAUST compiler
0.9.9.6b8
|

Go to the source code of this file.
Typedefs | |
| typedef map< Tree, mterm > | SM |
Functions | |
| static Tree | simplifyingAdd (Tree t1, Tree t2) |
| Add two terms trying to simplify the result. | |
| static Tree simplifyingAdd | ( | Tree | t1, |
| Tree | t2 | ||
| ) | [static] |
Add two terms trying to simplify the result.
Definition at line 33 of file aterm.cpp.
References addNums(), isNum(), isZero(), and sigAdd().
Referenced by aterm::normalizedTree().
{
assert(t1!=0);
assert(t2!=0);
if (isNum(t1) && isNum(t2)) {
return addNums(t1,t2);
} else if (isZero(t1)) {
return t2;
} else if (isZero(t2)) {
return t1;
} else if (t1 <= t2) {
return sigAdd(t1, t2);
} else {
return sigAdd(t2, t1);
}
}


1.8.0