Ask Your Question
1

polynomial and interval arithmetic

asked 2013-03-31 16:41:35 +0200

vdelecroix gravatar image

Hi,

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()
0.117647058823529
sage: print (x0 * (1-x0)).absolute_diameter()
0.117647058823529
sage: P = PolynomialRing(RIF, 'x')('x - x^2')
sage: P(x0).absolute_diameter()
0.117647058823529

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()
0.117647058823529

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()
0.0622837370242214

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

Vincent

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-31 08:38:23 +0200

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

Stats

Asked: 2013-03-31 16:41:35 +0200

Seen: 662 times

Last updated: Oct 31 '13