Testing COSY’s Taylor Model Arithmetic
description
Transcript of Testing COSY’s Taylor Model Arithmetic
![Page 1: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/1.jpg)
1
Testing COSY’s Taylor Model Arithmetic
Jun Yu and George F. CorlissMarquette University, Dec. 16, 2002
Supported by Martin Berz, MSU
![Page 2: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/2.jpg)
2
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]) .
![Page 3: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/3.jpg)
3
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.
![Page 4: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/4.jpg)
4
Verification Process
Process 1: Use COSY’s interval arithmetic to verify COSY’s Taylor model arithmetic.
Process 2: Use Maple as a referee.
![Page 5: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/5.jpg)
5
Verification process 1
1. Evaluate the function f in Taylor model arithmetic over a domain.E.g., f = COS (3.14 + 1.57 * X), domain [-1, 1].
2. Construct the Taylor model expression of f (TM_EXPR) in COSYTM_EXPR := COS(-3.14 * TM_ONE + (1.57 * TM_ONE) * TM_INDEP)
3. Construct the interval expression of f (INL_EXPR) in COSY.IVL_EXPR := COS(INTV(-3.14, -3.14) + INTV(1.57, 1.57) * VAR1)
4. Pick a point , say A, inside the domain and convert it to a tight interval [A].
5. Evaluate the polynomial part of TM_EXPR on [A] and add the remainder bound.
6. Evaluate IVL_EXPR on [A].
7. Compare the results of 5 and 6. If the intervals are disjoint, there is an error.
![Page 6: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/6.jpg)
6
Verification process 2
1. Follow the first four steps of verification process 1.
2. Output the information about Taylor model expression in binary form.
3. In Maple, we code the function f.
4. Read the binary information of the Taylor model expression.
5. 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.
![Page 7: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/7.jpg)
7
Testing Scope
1. 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 -.
2. 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
![Page 8: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/8.jpg)
8
Considerations for test cases• Order • Dimension• Normalization• domain• Challenge point• Sparsity• Oscillation• Simplicity• Algorithm• Special number
![Page 9: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/9.jpg)
9
COSY Driver OneCOSY Driver
![Page 10: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/10.jpg)
10
Maple Driver
![Page 11: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/11.jpg)
11
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.
![Page 12: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/12.jpg)
12
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
![Page 13: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/13.jpg)
13
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
![Page 14: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/14.jpg)
14
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
![Page 15: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/15.jpg)
15
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
![Page 16: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/16.jpg)
16
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
![Page 17: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/17.jpg)
17
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
![Page 18: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/18.jpg)
18
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
![Page 19: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/19.jpg)
19
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
![Page 20: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/20.jpg)
20
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
![Page 21: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/21.jpg)
21
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
![Page 22: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/22.jpg)
22
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
![Page 23: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/23.jpg)
23
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.
![Page 24: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/24.jpg)
24
Concerns
• The right way to evaluate a TM
•The right way to construct a TM
![Page 25: Testing COSY’s Taylor Model Arithmetic](https://reader036.fdocuments.us/reader036/viewer/2022070416/568151b1550346895dbfdd78/html5/thumbnails/25.jpg)
25
Questions?