![]() |
Interval Arithmetic - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Interval Arithmetic (/thread-19340.html) |
Interval Arithmetic - Eddie W. Shore - 12-24-2022 07:43 PM The arithmetic functions for intervals are defined as: [a, b] + [c, d] = [a + c, b + d] [a, b] - [c, d] = [a - d, b - c] [a, b] × [c, d] = [min(a × c, a × d, b × c, b × d), max(a × c, a × d, b × c, b × d)] [a, b] ÷ [c, d] = [min(a/c, a/d, b/c, b/d), max(a/c, a/d, b/c, b/d)] INTERVALHELP: help screen for interval arithmetic functions INTERVALADD: adding two intervals INTERVALSUB: subtracting two intervals INTERVALMUL: multiply two intervals INTERVALDIV: divide two intervals In the Home mode, use the curly brackets (used for lists { }), to type the intervals. For example, the interval [ 81.8, 82.2 ] would be typed {81.8,82.2}. Code: EXPORT INTERVALHELP() Code: EXPORT INTERVALADD(v1,v2) Code: EXPORT INTERVALSUB(v1,v2) Code: EXPORT INTERVALMUL(v1,v2) Code: EXPORT INTERVALDIV(v1,v2) Example Interval 1 = {13, 29} Interval 2 = {10, 14} Add: {23, 43} Subtract: {-1, 19} Multiply: {130, 406} Divide: {0.928571428572, 2.9} Source Moore, Ramon E. Mathematical Elements of Scientific Computing Holt, Rinehart, and Winston, Inc: New York. 1975. ISBN 0-03-088125-0 Download a zip file here: https://drive.google.com/file/d/1L8mmnm3xx58PVjavDROCiZAafBOCsH9o/view?usp=share_link |