Re: Bug ??????
- To: mathgroup at smc.vnet.net
- Subject: [mg105346] Re: Bug ??????
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 29 Nov 2009 05:08:57 -0500 (EST)
On 11/28/09 at 1:07 AM, wkfkh056 at yahoo.co.jp (ynb) wrote:
>F[x_]:=34880228747203264624081936 - 464212176939061350196344960*x^2
>+ 4201844995162976506469882880*x^4 -
>26387316917169915527289585290460*x^18 + ...
<rest of definition snipped>
>(* Bug ?; F[Sqrt[Sqrt + 3^(1/3)] + 1/Sqrt[3^(1/3) + 5^(1/5)]]
>=3.828176627860558*^38<---Bug ? *)
>(* =0? *)
This is not a bug. It is inherent when converting things to
Your definition of F is an alternating sum of large powers of x.
The function N converts each subterm to machine precision then
computes the sum. Loss of precision is inevitable when such a
large dynamic range exists in the terms to be summed as is the
Note, this is not a Mathematica issue. Rather it is inherent to
floating point arithmetic used on any computer system.
To get a simple numerical answer to this problem, there are
several possible approaches. The simplest I can think of would
=46[Sqrt[Sqrt + 3^(1/3)] + 1/Sqrt[3^(1/3) + 5^(1/5)]]//Simplify//N
N[F[Sqrt[Sqrt + 3^(1/3)] + 1/Sqrt[3^(1/3) + 5^(1/5)]], 100]
Note neither of these as written above is guaranteed to work.
Usage of Simplify will work *if* the structure of the terms to
be added result in cancellations giving a much simpler prior to
be converted to machine precision.
The second approach will work if the second argument to N is
made sufficiently large.
Prev by Date:
Re: Replacement rules that contain function arguments
Next by Date:
piecewice pdf, problems with cdf
Previous by thread:
Re: Bug ??????
Next by thread:
Re: Re: Bug ??????