Rev 539 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
539 | bpr | 1 | !goto $wims_read_parm |
2 | |||
3 | :def |
||
4 | title=Substitution |
||
5 | synonyme=substitue, fonction composee, fonction substitution |
||
6 | input=function |
||
7 | !exit |
||
8 | |||
9 | :proc |
||
10 | formula2=!trim $formula2 |
||
11 | !if $formula2=$empty |
||
14899 | bpr | 12 | error=empty_data |
13 | !exit |
||
539 | bpr | 14 | !endif |
15 | !exchange formula, formula2 |
||
16 | !read input/function |
||
17 | !if $error!=$empty |
||
14899 | bpr | 18 | !exit |
539 | bpr | 19 | !endif |
20 | !exchange formula, formula2 |
||
21 | formula=!item 1 of $formula |
||
22 | formula2=!item 1 of $formula2 |
||
23 | variable=!items2words $variable |
||
24 | variable=!word 1 of $variable |
||
25 | !if $variable=$empty |
||
14899 | bpr | 26 | list=!varlist nofn $formula |
27 | list=!sort nocase items $list |
||
28 | variable=!item -1 of $list |
||
539 | bpr | 29 | !endif |
30 | !default variable=x |
||
31 | result=!exec maxima expand(subst($formula2,$variable,$formula)); |
||
32 | !exit |
||
33 | |||
34 | :output |
||
35 | If |
||
36 | !htmlmath f(x) = $formula |
||
37 | <p> |
||
38 | Then |
||
39 | !htmlmath f($formula2) = $result |
||
40 | . |
||
41 | !exit |