Incorrect interval for sin(x)*x
delta-v1 opened this issue · 2 comments
delta-v1 commented
I am unable to compute the correct interval for sin(x) * x
. I'm using the following code:
from interval import interval, imath
x = interval([-0.5, 0.5])
y = imath.sin(x) * x
print(y) # [-0.2397, 0.2397]
import numpy as np
X = np.linspace(-0.5, 0.5, 100)
Y = np.sin(X) * X
print(Y.min(), Y.max()) # [0, 0.2397]
The correct bound should be [0, 0.2397]
, but pyinterval evaluates to [-0.2397, 0.2397]
. Is there something I am missing?
markcampanelli commented
At first glance, I think this is due to the fact that interval analysis methods typically do not consider the "connection" between the same variable appearing in two/more "independent" locations in the expression (here the import connection is the sign of the x and the sign of sin(x)).
delta-v1 commented
Thanks Mark! That makes sense.
It's reasonable that pyinterval would over-estimate the range, which seems to be a well-known problem in interval arithmetic.