# How can I obtain more significant digits? [duplicate]

I type

f1[x_] := 12 x^5 - 975 x^4 + 28000 x^3 - 345000 x^2 + 1800000 x
N[f1[15.5], 15]


and obtain 3.74112*10^6

BUT It´s not true!!! the result is larger than this solution, I think... BACAUSE...

 RealDigits[f1[15.5]]


gives me, the result {{3, 7, 4, 1, 1, 2, 0, 6, 8, 7, 5, 0, 0, 0, 0, 0}, 7}

So,... I can´t understand that I tell Mathematica that I want to view 15 significative digits, and Mathematica DON´T show me 15 sgnificative digits!!!, only 6!!

How I can obtain more digits???? with N[...] or with //N ???

I can´t understand any differneces in precision with Mathematica

m1 = {15, 4, 8, 23, 10, 9, 5, 18, 30, 21}
m2 = {159, 49, 89, 239, 109, 99, 59, 189, 309, 219}
f1[x_] := 12 x^5 - 975 x^4 + 28000 x^3 - 345000 x^2 + 1800000 x
x0 = f1[m1]
x1 = N[f1[m1], 9]
x2 = N[f1[m2], 9]


In the last element of x_ you can see diferrences, and... I don´t know what is the best way to obtain an an result with a concrete number os significative digits.

In x2, I tell Mathematica that I want 9 significative digits but the result is different from the last element of x1 and x0

and

I don´t know what result is the correct!

What´s the best way to obtain the good result with a given precision??, in this concrete situation?

If you replace in the las line of code in x2 9 for 12 or 15, you obtain the same result!! I can´t understand the behaivour!!

-

## marked as duplicate by Mr.Wizard♦Mar 25 at 11:13

Simple way: N[f1[15 + 1/2], 15]. See e.g., here (and references cited) for why: mathematica.stackexchange.com/questions/43714/… –  ciao Mar 16 '14 at 22:07
@rasher I´m gratefull to you for the link. But... I think that is a simple question that is not simply explained in the documentation. Almost, for me. I have read about that issue and... the only solution I encoutered is use a higeher number in precsion but still can´t understand the behaivour of Mathematica in this sense. I supose that the precision is use in all the process of calculations so... I reach after trying examples that I still must read a message about a red box rounded a result with text "No significantiv.." and still trying to understand. But... Thank you reasher for the link –  Mika Ike Mar 18 '14 at 11:14
Related: (10624), (55292), (72454) –  Mr.Wizard Mar 25 at 11:13

The problem lies with your 15.5 which has a small precision. Mathematica won't try to add digits beyond machine precision for this. Mathematica by default only displays 6 digits of precision unless otherwise specified. To view all the digits, wrap the output in InputForm.

To specify your precision, try this:

N[f1[15.515],15]


Or even this:

N[f1[Rationalize[15.5]],15]


Compare the differences in these three inputs:

Precision[15.5]

Precision[15.515]

Precision[Rationalize[15.5](*or 31/2*)]

-
Ok, for 15 works well, but... N[f1[15.54], 4] dont give me 4 significantive digits! ONLY 2! and N[f1[15.55], 5] ONLY 3 digits! –  Mika Ike Mar 17 '14 at 5:23
$f1[Rationalize[123.456789]]=\frac{41327339867286004045456962819021417698847}{25‌​0000000000000000000000000000}$ –  Claude Leibovici Mar 17 '14 at 8:00