Rev 20 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 20 | Rev 16136 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | # Standardized expression simplification. |
1 | # Standardized expression simplification. |
| 2 | # Input are lines. |
2 | # Input are lines. |
| 3 | # Output are lines, in $out. |
3 | # Output are lines, in $out. |
| 4 | 4 | ||
| 5 | !if nosimplify iswordof $m_options |
5 | !if nosimplify iswordof $m_options |
| 6 | out=!translate internal $ $ to $ $ in $wims_read_parm |
6 | out=!translate internal $ $ to $ $ in $wims_read_parm |
| 7 | !exit |
7 | !exit |
| 8 | !endif |
8 | !endif |
| 9 | 9 | ||
| 10 | I__=!nonempty lines $wims_read_parm |
10 | I__=!nonempty lines $wims_read_parm |
| 11 | n__=!linecnt $I__ |
11 | n__=!linecnt $I__ |
| 12 | !reset out,p__ |
12 | !reset out,p__ |
| 13 | !for i__=1 to $n__ |
13 | !for i__=1 to $n__ |
| 14 | l__=!line $i__ of $I__ |
14 | l__=!line $i__ of $I__ |
| 15 | l__=$maximasimp($l__) |
15 | l__=$maximasimp($l__) |
| 16 | !if expand iswordof $m_options |
16 | !if expand iswordof $m_options |
| 17 | l__=expand($l__) |
17 | l__=expand($l__) |
| 18 | !endif |
18 | !endif |
| 19 | !if factor iswordof $m_options |
19 | !if factor iswordof $m_options |
| 20 | l__=factor($l__) |
20 | l__=factor($l__) |
| 21 | !endif |
21 | !endif |
| 22 | p__=!append line $l__; to $p__ |
22 | p__=!append line $l__; to $p__ |
| 23 | !next i__ |
23 | !next i__ |
| 24 | 24 | ||
| 25 | out=!exec maxima $p__ |
25 | out=!exec maxima $p__ |
| 26 | - | ||