First time here? Check out the FAQ!

Ask Your Question
1

polynomial and interval arithmetic

asked 12 years ago

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 11 years ago

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

Preview: (hide)
link

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: 12 years ago

Seen: 1,053 times

Last updated: Oct 31 '13