Mathematica issue

  • Mathematica
  • Thread starter ehrenfest
  • Start date
  • #1
2,012
1

Main Question or Discussion Point

[SOLVED] mathematica issue

This is from Mathematica 6.0. Is this a bug in Mathematica? Supposedly the second output is precise to 100 digits!

In[46]:= x = 0.00004

Out[46]= 0.00004

In[45]:= N[(1 + x)^(1/3) - 1 - x/3 + (x^2)/9 - 5 (x^3)/81, 100]

Out[45]= 1.18826*10^-16

In[44]:= FullSimplify[(1 + y)^(1/3) - 1 - y/3 + y^2/9 < 5 y^3/81,
Assumptions -> y > 0]

Out[44]= True
 
Last edited:

Answers and Replies

  • #2
FredGarvin
Science Advisor
5,066
7
I think you are running into a machine precision issue with the way your equation is entered. Take a look in the help files in 3.1.6.

When you do calculations with arbitrary‐precision numbers, as discussed in the previous section, Mathematica always keeps track of the precision of your results, and gives only those digits which are known to be correct, given the precision of your input. When you do calculations with machine‐precision numbers, however, Mathematica always gives you a machine‐precision result, whether or not all the digits in the result can, in fact, be determined to be correct on the basis of your input.
 
  • #3
2,012
1
Hmmm...I thought the N[ ] function caused the expression to be evaluated in arbitrary precision mode. How can I get that expression in arbitrary precision mode?
 
  • #4
alphysicist
Homework Helper
2,238
1
Hi ehrenfest,

I believe the problem occurs when you give the value to x; at that point machine precision is used for x which carries over to the rest of the calculation. If you want 100 digits in arbitrary precision, you could use:

x=0.00004`100

and then calculate

N[(1 + x)^(1/3) - 1 - x/3 + (x^2)/9 - 5 (x^3)/81, 100]
 
  • #5
2,012
1
Hi ehrenfest,

I believe the problem occurs when you give the value to x; at that point machine precision is used for x which carries over to the rest of the calculation. If you want 100 digits in arbitrary precision, you could use:

x=0.00004`100

and then calculate

N[(1 + x)^(1/3) - 1 - x/3 + (x^2)/9 - 5 (x^3)/81, 100]
problem solved!
 

Related Threads for: Mathematica issue

Replies
5
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
1
Views
1K
Replies
4
Views
2K
Replies
4
Views
2K
Replies
0
Views
2K
Replies
1
Views
2K
Replies
0
Views
1K
Top