Re: baffled by //N bug in mathematica, WHY?



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.)
.



Relevant Pages

  • si(x) in Maxima (Was: Mathematica vs. Lisp)
    ... and I also need the small-k series expansions of those expressions, ... yield the end result in a usable form, ... If I were doing this in Mathematica, ... does anyone have an example of using a Maxima result for a lambda ...
    (comp.lang.lisp)
  • si(x) in Maxima (Was: Mathematica vs. Lisp)
    ... and I also need the small-k series expansions of those expressions, ... yield the end result in a usable form, ... If I were doing this in Mathematica, ... does anyone have an example of using a Maxima result for a lambda ...
    (sci.math.symbolic)
  • Re: Languages similar to Mathematica?
    ... and matching works just like matching in ML-family languages. ... data in Mathematica is simply code whose evaluation gets ... Mathematica -- I am not familiar with the other languages). ... expressions which are evaluated until no more transformation rules ...
    (comp.lang.functional)
  • Re: Polynomial Formulas
    ... the expressions get progressively more complicated until they ... nth power. ... Because if mathematica cannot do it, then I should see what I could do ... Prev by Date: ...
    (sci.math)