This is how intnum works with my module:
>>> import pari >>> def f(x): ... return x^2 ... >>> pari.intnum(0,1,f) 0.3333333333333333333333333333
Actually it works faster than in the standard PARI shell. The reason, I think, is that every time PARI wants to compute the value of the function we integrate it parses the string defining the function. In my case I simply do a function call which is faster.
Hi Anton,
I just stumbled on your blog through an unrelated Google search. The reason
you give for PARI’s intnum slowness *was* correct. The current ‘testing’
release, aka ‘development’, aka ‘unstable’, include a standard parser,
bytecode compiler / evaluator. So I suspect it is no longer the case.
Nice to see Fermigier’s work being revived in a different guise,
with different goals and scope than SAGE. I’ll link to it.
It would be nice if everything “just worked”. Let me know if current
‘testing’ releases break something. (They probably do.)
Cheers.
Comment by K.B — November 26, 2008 @ 9:35 am |