- 84 Views
- Uploaded on
- Presentation posted in: General

Testing COSY’s Taylor Model Arithmetic

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Testing COSY’s Taylor Model Arithmetic

Jun Yu and George F. CorlissMarquette University, Dec. 16, 2002

Supported by Martin Berz, MSU

What is “correct”?

Domain: X

Expression: f

COSY’s Taylor model expression of f: TM_F

COSY’s interval expression of f: INV_F

For all x X, f (x) TM_F ([x]).

For all [x] X, INV_F ([x]) intersects TM_F([x]) .

Goal

Find test cases when x X, f (x) TM_F ([x])

Or find test cases when [x] X, INV_F ([x]) and TM_F ([x]) are disjoint.

Verification Process

Process 1: Use COSY’s interval arithmetic to verify COSY’s Taylor model arithmetic.

Process 2: Use Maple as a referee.

Verification process 1

Evaluate the function f in Taylor model arithmetic over a domain.E.g., f = COS (3.14 + 1.57 * X), domain [-1, 1].

Construct the Taylor model expression of f (TM_EXPR) in COSYTM_EXPR := COS(-3.14 * TM_ONE + (1.57 * TM_ONE) * TM_INDEP)

Construct the interval expression of f (INL_EXPR) in COSY.IVL_EXPR := COS(INTV(-3.14, -3.14) + INTV(1.57, 1.57) * VAR1)

Pick a point , say A, inside the domain and convert it to a tight interval [A].

Evaluate the polynomial part of TM_EXPR on [A] and add the remainder bound.

Evaluate IVL_EXPR on [A].

Compare the results of 5 and 6. If the intervals are disjoint, there is an error.

Verification process 2

Follow the first four steps of verification process 1.

Output the information about Taylor model expression in binary form.

In Maple, we code the function f.

Read the binary information of the Taylor model expression.

Evaluate f at the challenge point. If the point result of f is not in the interval result of Taylor model expression, we have a violation of containment.

Testing Scope

Test cases are designed to evaluate the COSY operations of addition, subtraction, multiplication, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, log, exp, sqrt, sqr, isqrt, unary +, unary -.

We test Taylor models at

dimension 1: order 1, 7, 15, 17, and 20

dimension 2: order 1, 7, 15, 17, and 18

dimension 7: order 1, 2, 3, and 4

COSY Driver

Error Report

Using process 1 (all in COSY)

Observations: (For all the test cases we ran)

1. Errors are found in 3 functions: COS, SIN, and ASIN.

2. The COS and the SIN errors only occur at order 17 of dimension 1 or dimension 2.

3. The ACOS errors only occur at order 1 of dimension 1 and dimension 2, and order 1 or order 3 of dimension 7.

Error 1 (cos):

IMD: 0

Dimension: 1

Order: 17

TM_EXPR := COS(-3.141592653590006 * TM_ONE

+ (1.570796326794687 * TM_ONE) * TM_INDEP (1));

Point value: [-0.9999990000000004, -0.9999989999999995]

ERROR: Lower bd of expression > upper bd of Taylor model

Lower bound of expression: -0.1570796328686757E-05

Upper bound of Taylor model: -0.1570796816860323E-05

Difference: 0.4881735668679223E-12

Error 2 (cos):

IMD: 1

Dimension: 2

Order: 17

TM_EXPR := COS(-3.141592653590006 * TM_ONE

+ (1.570796326794687 * TM_ONE) * TM_INDEP (1));

Point value: [0.9999899999999996, 0.9999900000000005]

Point value: [0.9999899999999996, 0.9999900000000005]

ERROR: Lower bd of expression > upper bd of Taylor model

Lower bound of expression: -0.1570796369223327E-04

Upper bound of Taylor model: -0.1570796418440198E-04

Difference: 0.4921687142306775E-12

Error 3 (cos):

IMD: 1

Dimension: 2

Order: 17

TM_EXPR := COS(-3.141592653589796 * TM_ONE + (0.7853981633974484 * TM_ONE) * TM_INDEP(1) + (0.7853981633974484 * TM_ONE) * TM_INDEP(2));

Point value: [-0.9999900000000005, -0.9999899999999996]

Point value: [-0.9999900000000005, -0.9999899999999996]

ERROR: Lower bd of expression > upper bd of Taylor model

Lower bound of expression: -0.1570796327002688E-04

Upper bound of Taylor model: -0.1570796373588637E-04

Difference: 0.4658594880300668E-12

Error 4 (sin):

IMD: 0

Dimension: 1

Order: 17

TM_EXPR := SIN(-4.712388980384691 * TM_ONE

+ (1.570796326794690 * TM_ONE) * TM_INDEP(1));

Point value: [-0.9999990000000004, -0.9999989999999995]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: 0.1570796538419324E-05

Lower bound of Taylor model: 0.1570797020611943E-05

Difference: -0.4821926187347235E-12

Error 5 (sin):

IMD: 1

Dimension: 2

Order: 17

TM_EXPR := SIN(-4.712388980384691 * TM_ONE

+ (1.570796326794690 * TM_ONE) * TM_INDEP(1));

Point value: [-0.9999900000000005, -0.9999899999999996]

Point value: [-0.5000000000000002, -0.4999999999999998]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: 0.1570796347887127E-04

Lower bound of Taylor model: 0.1570796396102999E-04

Difference: -0.4821587160292514E-12

Error 6 (sin):

IMD: 1

Dimension: 2

Order: 17

TM_EXPR := SIN(4.712388980384691 * TM_ONE

+ (0.7853981633974483 * TM_ONE) * TM_INDEP (1)

+ (0.7853981633974483 * TM_ONE)* TM_INDEP (2));

Point value: [0.9999899999999996, 0.9999900000000005]

Point value: [0.9999899999999996, 0.9999900000000005]

ERROR: Lower bd of expression > upper bd of Taylor model

Lower bound of expression: -0.1570796327370206E-04

Upper bound of Taylor model: -0.1570796373932624E-04

Difference: 0.4656241856654513E-12

Error 7 (asin):

IMD: 0

Dimension: 1

Order: 1

TM_EXPR := ASIN((0.9999999999999983E-03 * TM_ONE)

* TM_INDEP(1));

Point value: [-0.9999990000000004, -0.9999989999999995]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: -0.9999991666662369E-03

Lower bound of Taylor model: -0.9999990000000064E-03

Difference: -0.1666662305128269E-09

Error 8 (asin):

IMD: 0

Dimension: 1

Order: 1

TM_EXPR := ASIN(-0.4935 * TM_ONE + (0.3499999999999997E-02

* TM_ONE) * TM_INDEP(1));

Point value: [-0.9999990000000004, -0.9999989999999995]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: -0.5201381202432389

Lower bound of Taylor model: -0.5201381145553354

Difference: -0.5687903481543799E-08

Error 9 (asin):

IMD: 0

Dimension: 2

Order: 1

TM_EXPR := ASIN((0.4999999999999991E-03 * TM_ONE)

* TM_INDEP(1) + (0.4999999999999991E-03

* TM_ONE) * TM_INDEP (2));}

Point value: [-0.9999900000000005, -0.9999899999999996]

Point value: [-0.9999900000000005, -0.9999899999999996]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: -0.9999901666617370E-03

Lower bound of Taylor model: -0.9999900000000064E-03

Difference: -0.1666617306401302E-09

Error 10 (asin):

IMD: 1

Dimension: 7

Order: 1

TM_EXPR := ASIN((-0.4935 * TM_ONE) * TM_INDEP(1));

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [-0.5000000000000002, -0.4999999999999998]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [-0.5000000000000002, -0.4999999999999998]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: -0.2493251165458725

Lower bound of Taylor model: -0.2467500000000038

Difference: -0.2575116545868672E-02

Error 11 (asin):

IMD: 1

Dimension: 7

Order: 3

TM_EXPR := ASIN((-0.4935 * TM_ONE) * TM_INDEP(1));

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

Point value: [0.4999999999999998, 0.5000000000000002]

ERROR: Upper bd of expression < lower bd of Taylor model

Upper bound of expression: -0.2493251165458725

Lower bound of Taylor model: -0.2492539187578167

Difference: -0.7119778805578236E-04

Using verification process 2 (Maple as referee)

Observation: (For all the test cases we ran)

Verification process 2 detects the exactly the same errors we have detected in verification process 1.