5 static void _distill(void);
7 // take expr and push all constant subexpr
11 // p2 independent variable (like x)
27 // is the entire expression constant?
29 if (find(p1
, p2
) == 0) {
31 //push(p1); // may need later for pushing both +a, -a
45 if (car(p1
) == symbol(MULTIPLY
)) {
50 // naive distill if not sum or product
66 // distill terms involving x
71 if (find(car(p3
), p2
)) {
79 // add together all constant terms
86 if (find(car(p3
), p2
) == 0)
96 negate(); // need both +a, -a for some integrals
101 distill_product(void)
105 // distill factors involving x
110 if (find(car(p3
), p2
)) {
118 // multiply together all constant factors
125 if (find(car(p3
), p2
) == 0)
131 multiply_all(tos
- h
);
132 //p3 = pop(); // may need later for pushing both +a, -a