How do you write this in lisp



For example this for loop for takes

for i : 1 thru 13 do define(dc(x), pwdefint(dc(p)*p(x-p),p,minf,inf))$
Evaluation took 95.7500 seconds (95.7500 elapsed)

and

p(x):=(3*b*x^2+3*c)*(signum(x+a)-signum(x-a))/2/(6*a*c+2*a^3*b)$
define(dc(x), pwdefint(p(p)*p(x-p),p,minf,inf))$
for i : 1 thru 13 do define(dc(x), pwdefint(dc(p)*p(x-p),p,minf,inf))$
Evaluation took 55.5000 seconds (55.5000 elapsed)





--------------------------------------------------
From: "Richard Hennessy" <rich.hennessy at verizon.net>
Sent: Tuesday, April 06, 2010 12:31 AM
To: "Stavros Macrakis" <macrakis at alum.mit.edu>; "Barton Willis" <willisb at unk.edu>; "Maxima List" 
<maxima at math.utexas.edu>
Subject: Re: [Maxima] How do you write this in lisp

> I am computing repeated convolutions of piecewise functions like:
>
> p(x):=((3*b*x^2+3*c)*between(x,-a,a))/(6*a*c+2*a^3*b)$
> define(dc(x), pwdefint(p(p)*p(x-p),p,minf,inf))$
> for i : 1 thru 10 do define(dc(x), pwdefint(dc(p)*p(x-p),p,minf,inf))$
>
> What is compbx?
>
> Rich
>
>
> --------------------------------------------------
> From: "Stavros Macrakis" <macrakis at alum.mit.edu>
> Sent: Monday, April 05, 2010 11:13 PM
> To: "Richard Hennessy" <rich.hennessy at verizon.net>; "Barton Willis" <willisb at unk.edu>; "Maxima List" 
> <maxima at math.utexas.edu>
> Subject: Re: [Maxima] How do you write this in lisp
>
>> Well, it will depend on how often the conditions are true or false. If
>> that's the issue, you can set compbx only on demand.
>>
>> How are you measuring speed?
>>
>>          -s
>>
>> On 2010-04-05, Richard Hennessy <rich.hennessy at verizon.net> wrote:
>>> Hi,
>>>
>>> Actually this was a bad idea.  I tried making between a regular function and
>>> it breaks a lot of code that I have
>>> written.  It has to be a simplifying function or I can't integrate
>>> expressions that contain it.
>>>
>>> I have posted the newest pw.mac at my site.  It can use between or signum.
>>> I have to update the help now.  You can get
>>> it here.  http://mysite.verizon.net/res11w2yb/pw.mac.txt  BTW I have tried
>>> using sign() in the definition of simpbetween
>>> but it is slower that using the relational operators.  Maybe I am going
>>> about it the right way.
>>>
>>> Rich
>>>
>>>
>>> --------------------------------------------------
>>> From: "Richard Hennessy" <rich.hennessy at verizon.net>
>>> Sent: Monday, April 05, 2010 10:05 PM
>>> To: "Barton Willis" <willisb at unk.edu>; <macrakis at alum.mit.edu>
>>> Cc: "Maxima List" <maxima at math.utexas.edu>
>>> Subject: Re: [Maxima] How do you write this in lisp
>>>
>>>> "simplification--how much is too much".
>>>>
>>>> Maybe between should not be a simplifying function at all.  I could make
>>>> the body of simpbetween with some possibly
>>>> necessary changes the body of a regular user function called between.  I
>>>> am not sure I like simplifying functions that
>>>> much.  Maybe that would work out better.  I can't make up my mind on this
>>>> yet.  I am going to try experimenting with
>>>> both ways
>>>> of doing it.
>>>>
>>>> Rich
>>>>
>>>>
>>>> --------------------------------------------------
>>>> From: "Barton Willis" <willisb at unk.edu>
>>>> Sent: Monday, April 05, 2010 9:17 PM
>>>> To: <macrakis at alum.mit.edu>
>>>> Cc: "Richard Hennessy" <rich.hennessy at verizon.net>; "Maxima List"
>>>> <maxima at math.utexas.edu>
>>>> Subject: Re: [Maxima] How do you write this in lisp
>>>>
>>>>> It would be great if there was a definitive guide to writing simplifying
>>>>> functions.
>>>>> There are plenty of examples, but no how-to manual that I know of; some
>>>>> topics
>>>>> that come to mind:
>>>>>
>>>>> (1) nouns and verbs,
>>>>> (2) autoloading simplifying functions,
>>>>> (3) simplification--how much is too much,
>>>>> (4) reflection rules,
>>>>> (5) binary64 & bigfloat evaluation,
>>>>> (6) extras: gradef, conjugates, limits, TeX properties, antiderivatives,
>>>>> (7) declaring function properties (complex, ...),
>>>>> (8) domain and wrong number of argument errors,
>>>>>
>>>>> --Barton
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Maxima mailing list
>>>> Maxima at math.utexas.edu
>>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>>
>>>
>>>
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>