## Name:

dirtyfindzeros gives a list of numerical values listing the zeros of a function on an interval.

## Library name:

sollya_obj_t sollya_lib_dirtyfindzeros(sollya_obj_t, sollya_obj_t)

## Usage:

dirtyfindzeros(f,I) : (function, range) -> list

## Parameters:

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

## Description:

• 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.
• The user should be aware that the list returned by dirtyfindzeros may contain a certain floating-point number twice. These repetitions reflect the existence of different zeros of the function the value of which rounds to the same floating-point number in the current working precision. In this case, increasing the working precision will end up making the two zeros distinguishable even in rounded floating-point arithmetic.

## Example 1:

> dirtyfindzeros(sin(x),[-5;5]);
[|-3.1415926535897932384626433832795028841971693993751, 0, 3.1415926535897932384626433832795028841971693993751|]

## Example 2:

> L1=dirtyfindzeros(x^2*sin(1/x),[0;1]);
> points=1000!;
> L2=dirtyfindzeros(x^2*sin(1/x),[0;1]);
> length(L1); length(L2);
18
25