Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

find_root does not fulfill tolerance

In Sage 7.3 the result of:

find_root((4*x^4-x^2).function(x),-0.25,0.4,xtol=1e-13,rtol=1e-13)

is

1.6619679287440101e-10

One would expect that the error with the exact solution (x=0) would be lower than 1e-13. I imagine that the multiplicity of the root produces this effect. Does somebody know the numerical algorithm behind find_root?

Thanks in advance.

find_root does not fulfill tolerance

In Sage 7.3 the result of:

find_root((4*x^4-x^2).function(x),-0.25,0.4,xtol=1e-13,rtol=1e-13)

is

1.6619679287440101e-10

One would expect that the error with the exact solution (x=0) would be lower than 1e-13. I imagine that the multiplicity of the root produces this effect. Does somebody know the numerical algorithm behind find_root?

Thanks in advance.

UPDATE: Thanks to @kcrisman, I see that find_root calls brentq. The documentation of such function says:

Safer algorithms are brentq, brenth, ridder, and bisect, but they all require that the root first be bracketed in an interval where the function changes sign. The brentq algorithm is recommended for general use in one dimensional problems when such an interval has been found.

Since 4x^4-x^2 has a root in 0 with multiplicity 2, this condition is not fulfilled. Is there any other command in Sage different from find_root to numerically calculate roots for general functions that can handle with roots with multiplicity bigger than 1?