- f is a function.
- I is an interval.

- dirtyfindzeros(f,I) returns a list containing some zeros of f in the interval I. The values in the list are numerical approximation of the exact zeros. The precision of these approximations is approximately the precision stored in prec. If f does not have two zeros very close to each other, it can be expected that all zeros are listed. However, some zeros may be forgotten. This command should be considered as a numerical algorithm and should not be used if safety is critical.
- More precisely, the algorithm relies on global variables prec and points and it performs the following steps:
let n be the value of variable points and t be the value
of variable prec.
- Evaluate |f| at n evenly distributed points in the interval I. The working precision to be used is automatically chosen in order to ensure that the sign is correct.
- Whenever f changes its sign for two consecutive points, find an approximation x of its zero with precision t using Newton's algorithm. The number of steps in Newton's iteration depends on t: the precision of the approximation is supposed to be doubled at each step.
- Add this value to the list.

[|-3.14159265358979323846264338327950288419716939937508, 0, 3.14159265358979323846264338327950288419716939937508|]

> points=1000!;

> L2=dirtyfindzeros(x^2*sin(1/x),[0;1]);

> length(L1); length(L2);

18

25