On 10/14/11 8:00 PM, Raymond Toy wrote:
> Yes, definitely possible. I was lazy because qagp has one of the more
> complicated interfaces. But I know more know about this kind of
> interfacing than I did then.
>
> Could you add that as either feature request on maxima's bug tracker?
Never mind.
I've implemented the interface to qagp. You'll have to get to from git.
A couple of examples:
(%i17) quad_qags(abs(x-%pi/4)^(0.1),x,0,1);
(%o17) [.8642219419275866, 1.701761398464896e-9, 945, 0]
(%i18) quad_qagp(abs(x-%pi/4)^(0.1),x,0,1,[%pi/4]);
(%o18) [.8642219426699342, 9.594790991384431e-16, 462, 0]
Here, qagp is much more accurate and requires fewer evaluations.
(%i19) quad_qags(abs(x-1/3)^(0.1),x,0,1);
(%o19) [.8534810489167268, 9.475543115885799e-16, 189, 0]
(%i20) quad_qagp(abs(x-1/3)^(0.1),x,0,1,[1/3]);
(%o20) [.8534810489167265, 9.475543115885795e-16, 378, 0]
In this case, the accuracy is comparable, but qags is less work.
Finally,
(%i21) quad_qags(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3);
(%o21) [52.74074847951494, 4.088443219529836e-7, 1869, 0]
(%i22) quad_qagp(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3, [1,sqrt(2)]);
(%o22) [52.74074838347143, 2.6247632689546663e-7, 1029, 0]
Here, qagp is more accurate and a bit less work.
Ray