Post Reply 
(34S) Integration (using the double-exponential method)
03-31-2017, 09:57 AM
Post: #24
RE: (WP-34S) Integration (using the double-exponential method)
(03-31-2017 06:24 AM)Paul Dale Wrote:  What is the rationale behind setting the D flag irrespective of the user's wishes?

It is, more or less, explained in the header. The goal is not to stop the computation with an error (getting a corrupted stack and with the local registers allocated) in case the evaluation of the integrand fails. This may happen frequently because the integrand may be evaluated at really big/small numbers. E.g.
\[\int_{-1}^\infty{\ln(x^3+1)\over x^2+1}dx\]
may raise an error as, when the integrand is evaluated at 1e+199, the 3rd power will overflow (although the integral is convergent and the program, in its current form, seems to compute it correctly at \(\approx2.73777317\ldots\)

In case the integration limits are finite (tanh-sinh method), the integrand will be evaluated very near the limits (care was taken for the correct computation of tm, if such computation is correct, the integrand may be evaluated at the neighbour of the limits, but not at the limits). If the integrand goes to infinity at one limit, it is possible for it to also evaluate as infinity in the neighbour, raising an error.

In both cases, and if the integral is convergent, the weight applied to such abscissa will "probably" be low enough for the product of the integrand and the weight to be negligible, so there's low error (or no error at all) discarding such point.

The user's D flag is restored at program end.

Regards.

EDIT. The above example is only explanatory, but I've not tested if evaluating such integral does indeed evaluate the integrand at 1e199. Perhaps the algorithm has decided, prior to that, that is has reached convergence and has stopped with a solution.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (WP-34S) Integration (using the double-exponential method) - emece67 - 03-31-2017 09:57 AM



User(s) browsing this thread: 1 Guest(s)