Ask Your Question

polynomial and interval arithmetic

asked 2013-03-31 09:41:35 -0500

vdelecroix gravatar image


I would like to evaluate a polynomial on a real interval (an element of RIF). My problem is the following. I take the polynomial x(1-x) which is increasing on (0,1/2). Hence, if I have an interval (l,u) in (0,1/2) and I apply this polynomial, I would like to get an answer close to (l(1-l), u(1-u)) up to rounding error. But what I get is (l(1-u), u(1-l)) which is twice bigger! The following code illustrates the behavior:

sage: l = 3/17
sage: u  = 5/17
sage: x0 = RIF((l,u))
sage: print x0.absolute_diameter()
sage: print (x0 * (1-x0)).absolute_diameter()
sage: P = PolynomialRing(RIF, 'x')('x - x^2')
sage: P(x0).absolute_diameter()

And we can check that this diameter is (l(1-u), u(1-l)):

sage: x1_l = l * (1-u)
sage: x1_u = u * (1-l)
sage: print (x1_u - x1_l).n()

which is much bigger than (l(1-l), u(1-u)):

sage: x2_l = l * (1-l)
sage: x2_u = u * (1-u)
sage: print (x2_u - x2_l).n()

Is there a cleaner way to evaluate a polynomial on an element of RIF ?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-31 02:38:23 -0500

Richard Fateman gravatar image

Quadratic polynomials like yours can be rephrased as Single Use Expressions by completing the square. General polynomials not so easy unless you can factor. Use google to search for terms in this answer that might not be familiar. Richard Fateman

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-31 09:41:35 -0500

Seen: 259 times

Last updated: Oct 31 '13