Yep:

integrationQagp(x+->x^3*log(abs((x^2-1)*(x^2-2))),[0.0,1.0,sqrt(2.0),3.0])

returns the answer

[result= 52.74074838347258,abserr= 1.3130161420349395e-6]
                        Type: Record(result: DoubleFloat,abserr:
DoubleFloat)

which is correct.  Note that the absolute error is set in GSLL to be
1.0e-5, which is quite large (but on the other hand almost always ensures
convergence), so unless you allow the user to enter an error value, the
result will only be accurate to that value.

-Alasdair

On Tue, Nov 3, 2015 at 12:43 PM, Bill Page <bill.p...@newsynthesis.org>
wrote:

> On 2 November 2015 at 18:51, Alasdair McAndrew <amc...@gmail.com> wrote:
> >
> > Very nice!  I have been trying to extend your (Bill's) original programs
> (with
> > "pretend Integer") but these seem much nicer -
>
> Although there is no explicit use of 'pretend' there is still some
> implicit "pretending" going on behind the scenes.  The main point
> however is to try to do most of the work in Spad without pretend so
> that things are as type-safe and representation independent as
> possible.
>
> > although I don't fully understand how they work (nothing like starting
> from
> > the bottom, is there?).
>
> I very much appreciate every time you ask a question...
>
> > You can also implement qagp - which requires a user-given list of
> > singularities - with something like:
> >
> > (defun gslintegration gagp (per f a b S)
> > (let* A (grid:make-foreign-array 'double-float :dimensions (length S)
> :initial-contents S))
> > (apply (|mkLispFunction2| per)
> > (multiple-value-list (gsl:integration-qagp (|mkLispFunction1| f) a b
> A))))
> >
>
> Please is the slightly revised code for integrationQagp at
> https://github.com/billpage/gsla
>
> > I haven't tested this yet, but I've tested its components.  You can also
> include optional
> > parameters (abserr, relerr etc).
>
> Can I leave that for you to do based on the example that I sent in
> another email? :)
>
> > By the way, where is "per" defined?
> >
>
> The function that is passed to the parameter 'per' is defined in the Spad
> code.
>
> Cheers,
> Bill Page.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/fricas-devel/q18Av7P3jnM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> fricas-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to fricas-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/fricas-devel.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[image: http://www.facebook.com/alasdair.mcandrew]
<http://www.facebook.com/alasdair.mcandrew> [image:
https://plus.google.com/+AlasdairMcAndrew/posts]
<https://plus.google.com/+AlasdairMcAndrew/posts> [image:
https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108]
<https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108> [image:
https://twitter.com/amca01] <https://twitter.com/amca01> [image:
http://numbersandshapes.net] <http://numbersandshapes.net>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to