# Tag Info

0

So as I posted in the Edit, the initial problem was that I was trying to integrate a function of the form 1/x around 0. In this case, as I will describe later, it corresponds to integrating around the singularity given by b(qx^2+qy^2+qz^2) + w ==0. The integral diverges on each side and naively integrating doesn't work. We need some other method, like taking ...

5

First, in general, I would advise you not to trust numerical algorithms. If there are doubts about the outcomes then solve the same problem with different (numerical or not) methods and see do their results agree. For the integral in the question I assume you can evaluate it with several different invocations of the Monte Carlo method and compare the ...

1

One thing you can do is to use infinite precision numbers rather than finite. For example: q = Total[(-1)^Range[1000] Table[HarmonicNumber[n], {n, 1000}]] gives a very long fraction. Taking N[ ] of this gives 3.39641. Taking N[q,1000] gives it to 1000 digits, etc.

1

If you are interested in obtaining approximations of the zeros of that function, you don't really need to plot it to high precision. In this case, NSolve is able to give you numerical solutions for specific ranges of $x$, and it can do that at an arbitrary precision that you specify using the WorkingPrecision option: NSolve[f2 == 0 && 0 <= x ...

5

Most Mathematica functions have no side-effects. This means that SetPrecision returns a version of its input in which all numbers have been set to a certain precision, but it does not influence the precision of the arguments themselves. In other words, it is the output of SetPrecision that has the requested precision; you will want to e.g. explicitly save ...

Top 50 recent answers are included