Re: baffled by //N bug in mathematica, WHY?
- From: Ronald Bruck <bruck@xxxxxxxxxxxx>
- Date: Mon, 11 Jul 2005 00:49:04 GMT
In article <DKgAe.99$Rv7.85@xxxxxxxxxxxxxxxxxxxxxxxxxx>, symbio
<symbio@xxxxxxx> wrote:
> In[243]:=
> \!\(\(Cosh[\(43\ \[Pi]\)\/\@2] + \((1 - Cosh[43\ \@2\ \[Pi]])\)\ Csch[
> 43\ \@2\ \[Pi]]\ Sinh[\(43\ \[Pi]\)\/\@2] // FullSimplify\) //
> N\[IndentingNewLine]
> Cosh[\(43\ \[Pi]\)\/\@2] + \((1 - Cosh[43\ \@2\ \[Pi]])\)\ Csch[
> 43\ \@2\ \[Pi]]\ Sinh[\(43\ \[Pi]\)\/\@2] // N\)
> Out[243]=
> \!\(6.551787517854307`*^-42\)
> Out[244]=
> \!\(\(-1.9342813113834067`*^25\)\)
>
Two comments:
a. This is the wrong forum for this problem. You should have posted
to comp.soft-sys.math.mathematica. Personally, I think this is
nitpicking, but others take the protocols more seriously than I.
b. You should send us the result of "InputForm" of your expressions.
That will give us something READABLE. I couldn't "copy and paste" your
expressions into Mathematica, I had to deconstruct them.
To answer your question, your problem is numeric roundoff.
Essentially, you're trying to compute
1.0791 10^29 - 1.0791 10^29 * 9.26698 * 10^-30 * 1.071 * 10^29.
But not all those 1.0791 10^29's are equal, and there's your problem.
The differences are critical to an exact answer, but are drowning in
the huge vats surrounding them.
On second thought, this would also have been a good post to
sci.math.num-analysis. They routinely handle roundoff problems like
this. (How do you solve a quadratic equation? Hint: it may NOT be
(-b \pm \sqrt{b^2 - 4ac})/(2a).)
--Ron Bruck
PS. Also: it's just superstition, and Mathematica handles it
correctly, as would most any other CAS I can think of (even C!), but I
don't think it's wise to write 43 Pi/2 in one place and 43/2 Pi in
another. As I say, just superstition. Excuse me while I go sacrifice
a lamb.
Yum. Whoever invented curry was a genius. (That's to get the SPCA off
my back.)
.
- Follow-Ups:
- Re: baffled by //N bug in mathematica, WHY?
- From: David W . Cantrell
- Re: baffled by //N bug in mathematica, WHY?
- References:
- baffled by //N bug in mathematica, WHY?
- From: symbio
- baffled by //N bug in mathematica, WHY?
- Prev by Date: Re: Simple nonlinear PDE. Please help?
- Next by Date: Re: Simple problem
- Previous by thread: baffled by //N bug in mathematica, WHY?
- Next by thread: Re: baffled by //N bug in mathematica, WHY?
- Index(es):
Relevant Pages
|