upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

Interval arithmetic: incorrect results for min and max #218

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Consider the following operation:

a = iv.mpf([0,1])
b = 0.5

min(a,b)

Mpmath returns the range [0,1] though there is no posible value of a that can 
give a result greater than 0.5

The correct response is [0,0.5]

Original issue reported on code.google.com by brookes....@gmail.com on 28 Jan 2012 at 10:27

GoogleCodeExporter commented 9 years ago
This behavior is impossible to change since min is a Python function 
implemented in terms of comparison operators.

We could perhaps add new interval min/max functions to mpmath that behave this 
way?

Original comment by fredrik....@gmail.com on 29 Jan 2012 at 3:02