I confess that I don't know much about Series, so I don't know what to expect with the iterator {x,Infinity,20}
. Also, this could very well depend on how your F
is actually defined. But leaving aside those caveats, I don't think this approach will get you want you want.
The function N
cannot actually add any precision. If you try N[1.5,50]
, you'll notice that it has no effect. On the other hand N[3/2,50]
does have an effect, with the result being a number with ~50 digits of precision. So, when you do
s2 = N[s1, 50]
if s1
has precision less than 50 digits, s2
will end up just being the same as s1
.
Regarding your questions about SetPrecision
... SetPrecision
will indeed result in a number with the specified precision, however it cannot know what the original number was supposed to be, so it won't actually improve the accuracy of your calculations. Whatever error there was before you applied SetPrecision
will still be there. You'll just have a bunch of garbage digits. So, at the moment you apply SetPrecision
, you must somehow know that the new, high precision number is "correct" for using in the subsequent calculations.
For example, compare
SetPrecision[N[Pi, 10], 100]
to
SetPrecision[Pi, 100]
Any subsequent calculations with each of those might indeed maintain 100 digits of precision (depending on the calculations), but the results with the former will be much less "correct" than the results with the latter.
Many built-in functions that do numerical calculations take options like AccuracyGoal
, PrecisionGoal
, and WorkingPrecision
. Using those functions (e.g. NIntegrate
) with those options is probably the safest way to get the level of precision/accuracy you're after. You also need to take care not to pollute your computations by mixing lower precision numbers with higher precision ones. The precision of the result will be limited by the lowest precision involved in the calculation. So, start your calculations with infinitely precise quantities (integers, special symbols like Pi
, etc) or quantities with sufficiently high precision (you'll have to figure out what that should be), and then never pollute your intermediate results with low-precision quantities (e.g. things like 1.5
will automatically have machine precision, about 15 digits).