google / autobound

AutoBound automatically computes upper and lower bounds on functions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement trigonometric functions

clemisch opened this issue · comments

Sine and cosine are not implemented, as you state in the paper:

For example, we do not currently have a way to compute sharp Taylor enclosures for periodic functions, such as sine or cosine.

I only skimmed the paper, but I assume periodic functions are a non-trivial limitation?

Coming up with sharp (i.e., optimal) bounds for sine and cosine would require proving some new theorems. However, it wouldn't be too much work to implement non-sharp bounds based on the range of the kth derivative, and these bounds should still be pretty good in practice.

Just now coming back to this.

Does autobound have an interface for

non-sharp bounds based on the range of the kth derivative

? Or would I have to read the paper and implement it by hand?

Good question. The main thing that would need to be done is to modify the get_range() function in elementwise_functions.py so that it can compute the range of sin or cos, as well as the range of their derivatives:

def get_range(function_id: FunctionId,

This could be done by first normalizing the trust_region so that its endpoints are in the interval [-pi, pi], then using the existing _get_range() function which takes a list of local minima / maxima within the trust region. Let me know if any of this is unclear!

After that there is some boilerplate to hook things up, which I'd be happy to add.