       Re: Simple question or how Mathematica getting on my nerves.

• To: mathgroup at smc.vnet.net
• Subject: [mg45791] Re: Simple question or how Mathematica getting on my nerves.
• Date: Sun, 25 Jan 2004 03:04:45 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```On 1/24/04 at 12:36 AM, gtsavdar at auth.gr (George) wrote:

> Although the 2 results must be the same they aren't. WHY???????
> And not only this, but they differ by 10^21!!!!!! WHY????????

> Please copy and paste this to Mathematica (i tried 5.0 and 4.2) to
> understand what i mean:

> \!\(k[f_] :=
>     2687176093959399272413585923303421161600\ *\((1 - f)\)\^67\ *
>       f\^61\[IndentingNewLine]
>   N[\[Integral]\_\(6214\/10000\)\%\(5242\/10000\)k[
>           f] \[DifferentialD]f]\[IndentingNewLine]
>   N[\[Integral]\_0.6214\%0.5242 k[f] \[DifferentialD]f]\)

In one case you are using exact numbers throughout the computation and converting the final answer to an inexact number and in the other case you are using machine precision numbers. The problem is the lower precision numbers used in high degree polynomials.

Beyond this a couple of observations.

You don't need the operator N to convert the integral to machine precision if you supply machine precision limits. That is

N[Integrate[k[f],{f, .6214, .5242}] gets the same result as

Integrate[k[f]], {f, .6214, .5243]

As far as I know, Mathematica never returns an exact result when at least one of the parameters is inexact.

Also, if you want a machine precision result to an exact integral you would do better to us NIntegrate instead of Integrate
--
To reply via email subtract one hundred and four

```

• Prev by Date: GridPlot
• Next by Date: Re: Simple question or how Mathematica getting on my nerves.
• Previous by thread: Re: Simple question or how Mathematica getting on my nerves.
• Next by thread: Re: Simple question or how Mathematica getting on my nerves.