Re: A trap: TWO HOWLERS in Mathematica 6 making a dangerous match
- From: Daniel Lichtblau <danl@xxxxxxxxxxx>
- Date: Sat, 16 Jun 2007 21:31:46 -0700
On Jun 16, 7:57 pm, Vladimir Bondarenko <v...@xxxxxxxxxxxxxxx> wrote:
(* A freshman - or a biologist etc - tries to calculate a
divergent integral not realizing that it diverges... *)
Integrate[(1+z) Sin[z]/z, {z, 0, Infinity}]
(* Mathematica 6 returns an invalid answer, - but without
any warning message, the first defect. *)
(2+Pi)/2
%//N
2.5708
(* The customer has heard about some Vladimir and his VM
machine and realizes already that computer algebra systems
tend to have bugs, so he or she tries to verify the above
result via a quadrature... *)
NIntegrate[(1+z) Sin[z]/z,{z,0,Infinity}]
(* ... and encounters yet another Mathematica 6 eerie defect
- not a only a finite number is given - again without any
warning message which is itself a bug... - but this number
coincides identically with the approximation of the exact
answer... nothing to add. *)
2.5708
This is, I think, an interesting phenomenon from the point of view of
both symbolic and numeric calculus. I don't claim to fully understand
it but, having encountered it over the years, I can say a bit. The
first trouble, for both symbolic and numeric integration, is the
failure to detect divergence. But why do such disparate methods then
give numerically equivalent results? This is because some singularity-
crushing quadrature schemes have the effect, in cases of divergent
integrals, of giving a finite result that agrees with the generalized
integral (that is, the result of removing singular parts e.g via
series expansion).
I guess this feature of quadrature can be a blessing or a curse. It
depends on whether you are striving for a numerical evaluation of a
generalized integral, or trying to double-check your symbolic result
and wanting to know if in fact it diverges (or using a symbolic
computation to check your numeric routine).
While I'd not refer to the problems indicated herein as howlers, it is
generally acknowledged that this phenomenon can be a dangerous match.
I hope I'm stating the obvious here.
Best wishes,
Vladimir Bondarenko
VM and GEMM architect
Co-founder, CEO, Mathematical Director
http://www.cybertester.com/ Cyber Tester, LLChttp://maple.bug-list.org/ Maple Bugs Encyclopaediahttp://www.CAS-testing.org/ CAS Testing
P.S.
Hummm... shouldn't I give a call to Wolfram Research
and offer them to rely upon my famous VM machine?
It would be quite redundant. I'm fairly certain (I'll verify when I
have more time) that this is a simple failure of the convergence
testing code. The deficiencies therein are vast, at least where
growing and oscillatory factors coexist. About all I'll say is I think
it has improved over time. I wouldn't even put money on that.
The point is not to further test what we know is held together by spit
and frayed bailing wire; we have testing a-plenty to tell us this. The
point is to figure out the algorithms, or, failing that, better
heuristics, to improve on the current status.
P.P.S.
Guess... how many Mathematica 6 defects the VM machine
has already calculated? :-)
P.P.P.S.
My birthday, Jun 19, is closer and closer...
Daniel Lichtblau
Wolfram Research
.
- Follow-Ups:
- Prev by Date: Re: big exponents in rational functions [Re: Yet another Maple regression bug, 2000--2007--? (trivial integral)]
- Next by Date: Re: something to chat about, lisp and Mathematica for list processing.
- Previous by thread: something to chat about, lisp and Mathematica for list processing.
- Next by thread: Re: A trap: TWO HOWLERS in Mathematica 6 making a dangerous match
- Index(es):
Relevant Pages
|
|