When Sollya computes an approximation polynomial for a given function, degree and range, it also returns the approximation error (and the center of the interval as well).
Very often we want to solve a slightly different problem: for a given function, degree, lower bound and approximation error, computed the approximation polynomial and the upper bound of the interval comprised between it and the upper bound for which the approximation error stands.
Very often the idea is to break a given “large” into a collection of smaller intervals because for the given function-degree-error the initial interval is too large.
The naive approach is to:
In step 2 you may have to compute several polynomials until the computed error is below or equal to the expected error. You must not decrease the interval width too agressively since it multiplies the number of interval (and lengtens the subsequent manipulations that are made on each sub-interval).
In step 3 you probably unutily compute polynomials for too large interval and you could know it from the previous computations.
The whole idea is to reduce the number of polynomila computation and get the maximum width (compatibile with the expected approwimaiton error).
This process has different aspects:
For point 1, can something be done with the derivative at the upper bound or at the center point of the interval (also given by Sollya).
For point 2, can some type of data structure keep the informations (which ones ?) and allow for an efficient reuse.