/usr/share/doc/octave-interval/manual.html is in octave-interval-doc 3.1.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for the GNU Octave interval package, version 3.1.0.
Copyright (C) 2015–2017 Oliver Heimlich
Copyright (C) 2017 Joel Dahne
Copyright (C) 2008-2009 Simone Pernice
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or any later version published by the Free Software Foundation. A copy of the license is included in GNU General Public License. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GNU Octave Interval Package Manual</title>
<meta name="description" content="GNU Octave Interval Package Manual">
<meta name="keywords" content="GNU Octave Interval Package Manual">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
/*
This is part of the GNU Octave Interval Package Manual.
Copyright 2015-2017 Oliver Heimlich.
See the file manual.texinfo for copying conditions.
*/
/* Use custom fonts */
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
code, kbd, samp, tt, pre { font-family: 'Fantasque Sans Mono', 'Consolas', monospace; }
code, kbd, samp, tt { font-style: italic; padding: 0 0.1ex; /* slightly increase margin to surrounding text */ }
body, span.sansserif { font-family: 'Lato', 'Roboto Condensed', 'Calibri', sans-serif; }
h1, h2, h3, h4, h5, span.roman, pre.menu-comment, pre.menu-preformatted { font-family: 'Lato', 'Roboto Condensed', 'Calibri', serif; }
/*
Use colors from the solarized color theme (sparsely),
the main text will remain in default colors for optimal readability (black on white).
*/
pre.example, .header, .float-caption, hr
{
/* base00 ~ body text in light solarized theme */
color: #657b83;
border-color: #657b83;
}
pre.example
{
/* base3 ~ background color in light solarized theme */
background-color: #fdf6e3;
padding: 0.5em;
}
a { color: #268bd2; /* blue */ }
a:visited { color: #d33682; /* magenta */ }
/* Center floating tables and images */
.float table, .float img, .float object { margin-left: auto; margin-right: auto; }
/* Decrease table width, but not on small screens */
.float table { max-width: 38em; }
/* Use horizontal lines: above/below tables and after table headers (Chicago Style) */
.float table, .float th { border-collapse: collapse; border-top: 1px solid black; border-bottom: 1px solid black; }
.float th, .float td { padding: 0.5em; }
/* Use horizontal ruler with double lines */
hr { border-width: 0; border-top-width: 3px; border-style: double; }
/* Smaller gap between subsequent @group blocks */
.example { margin-bottom: 1em; }
.example + .example { margin-top: -0.5em }
/* Smaller gap between definition and its description */
dd > p:first-child { margin-top: 0.5em; }
/* Limit maximum body width such that text is easier to read */
body { max-width: 42em; margin-left: 0.5em; margin-right: 0.5em; }
/* On small screens don't indent the code examples to prevent overflow */
div.example { margin-left: auto; max-width: 38.8em; }
/*
Use left margin such that text is easier to read,
but don't sacrifice space on small screens.
*/
@media screen and (min-width: 43em)
{
/* Smooth transition for screens between 43em and 57em */
body { margin-left: auto; margin-right: auto; }
@media (min-width: 57em)
{
body { margin-left: 7.5em; }
}
}
/*
Workaround for missing support of alpha lists and lists starting from zero in Texinfo's HTML output.
FIXME: This should be fixed upstream.
*/
div.alpha-list + ol { list-style-type:lower-alpha; }
div.zero-list + ol { counter-reset: item -1; }
div.zero-list + ol > li { display:block; }
div.zero-list + ol > li:before { content: counter(item) "."; counter-increment: item; display:inline-block; margin-left: -2.5em; min-width: 2em; margin-right: 0.2em; text-align: right; }
/*
Improve display of large graphics.
FIXME: This should go into Octave's CSS file.
*/
div.float img, body > img { display: block; max-width: 42em; }
object { max-width: 100% }
-->
</style>
</head>
<body lang="en">
<h1 class="settitle" align="center">GNU Octave Interval Package Manual</h1>
<p>This manual is for the GNU Octave interval package, version 3.1.0.
</p>
<p>Copyright © 2015–2017 Oliver Heimlich
Copyright © 2017 Joel Dahne
Copyright © 2008-2009 Simone Pernice
</p>
<p>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or any later version published by the Free Software Foundation. A copy of the license is included in <a href="#GNU-General-Public-License">GNU General Public License</a>.
</p>
<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#Preface" accesskey="n" rel="next">Preface</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="SEC_Top"></a>
<table class="menu" border="0" cellspacing="0">
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">How to install and use the interval package for GNU Octave
</pre></th></tr><tr><td align="left" valign="top">• <a href="#Preface" accesskey="1">Preface</a>:</td><td> </td><td align="left" valign="top">Background information before usage
</td></tr>
<tr><td align="left" valign="top">• <a href="#Getting-Started" accesskey="2">Getting Started</a>:</td><td> </td><td align="left" valign="top">Quick-start guide for the basics
</td></tr>
<tr><td align="left" valign="top">• <a href="#Introduction-to-Interval-Arithmetic" accesskey="3">Introduction to Interval Arithmetic</a>:</td><td> </td><td align="left" valign="top">Fundamental concepts
</td></tr>
<tr><td align="left" valign="top">• <a href="#Examples" accesskey="4">Examples</a>:</td><td> </td><td align="left" valign="top">Showcase of use cases
</td></tr>
<tr><td align="left" valign="top">• <a href="#Advanced-Topics" accesskey="5">Advanced Topics</a>:</td><td> </td><td align="left" valign="top">Get the most out of it
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Appendix
</pre></th></tr><tr><td align="left" valign="top">• <a href="#IEEE-Std-1788_002d2015" accesskey="6">IEEE Std 1788-2015</a>:</td><td> </td><td align="left" valign="top">IEEE standard for interval arithmetic
</td></tr>
<tr><td align="left" valign="top">• <a href="#GNU-General-Public-License" accesskey="7">GNU General Public License</a>:</td><td> </td><td align="left" valign="top">The license for this software and its manual
</td></tr>
</table>
<img border="0" src="image/interval-sombrero.m.png" alt="Interval sombrero" />
<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a name="toc-Preface-1" href="#Preface">Preface</a>
<ul class="no-bullet">
<li><a name="toc-Acknowledgments-1" href="#Acknowledgments">Acknowledgments</a></li>
<li><a name="toc-Philosophy-1" href="#Philosophy">Philosophy</a></li>
<li><a name="toc-Distribution-and-Development-1" href="#Distribution-and-Development">Distribution and Development</a></li>
<li><a name="toc-Getting-Help-1" href="#Getting-Help">Getting Help</a></li>
</ul></li>
<li><a name="toc-Getting-Started-1" href="#Getting-Started">1 Getting Started</a>
<ul class="no-bullet">
<li><a name="toc-Installation" href="#Installation">1.1 Installation</a></li>
<li><a name="toc-Set_002dbased-Interval-Arithmetic" href="#Set_002dbased-Interval-Arithmetic">1.2 Set-based Interval Arithmetic</a></li>
<li><a name="toc-Input-and-Output" href="#Input-and-Output">1.3 Input and Output</a>
<ul class="no-bullet">
<li><a name="toc-Interval-Vectors_002c-Matrices-and-Arrays" href="#Interval-Vectors_002c-Matrices-and-Arrays">1.3.1 Interval Vectors, Matrices and Arrays</a></li>
</ul></li>
<li><a name="toc-Arithmetic-Operations" href="#Arithmetic-Operations">1.4 Arithmetic Operations</a></li>
<li><a name="toc-Numerical-Operations" href="#Numerical-Operations">1.5 Numerical Operations</a></li>
<li><a name="toc-Boolean-Operations" href="#Boolean-Operations">1.6 Boolean Operations</a></li>
<li><a name="toc-Matrix-and-Array-Operations" href="#Matrix-and-Array-Operations">1.7 Matrix and Array Operations</a>
<ul class="no-bullet">
<li><a name="toc-Notes-on-Linear-Systems" href="#Notes-on-Linear-Systems">1.7.1 Notes on Linear Systems</a></li>
</ul></li>
<li><a name="toc-Plotting" href="#Plotting">1.8 Plotting</a></li>
</ul></li>
<li><a name="toc-Introduction-to-Interval-Arithmetic-1" href="#Introduction-to-Interval-Arithmetic">2 Introduction to Interval Arithmetic</a>
<ul class="no-bullet">
<li><a name="toc-Motivation" href="#Motivation">2.1 Motivation</a></li>
<li><a name="toc-Error-bounds-in-real-life" href="#Error-bounds-in-real-life">2.2 Error bounds in real life</a></li>
<li><a name="toc-Pros-and-Cons" href="#Pros-and-Cons">2.3 Pros and Cons</a></li>
<li><a name="toc-Theory" href="#Theory">2.4 Theory</a></li>
</ul></li>
<li><a name="toc-Examples-1" href="#Examples">3 Examples</a>
<ul class="no-bullet">
<li><a name="toc-Arithmetic-with-System_002dindependent-Accuracy" href="#Arithmetic-with-System_002dindependent-Accuracy">3.1 Arithmetic with System-independent Accuracy</a></li>
<li><a name="toc-Prove-the-Existence-of-a-Fixed-Point" href="#Prove-the-Existence-of-a-Fixed-Point">3.2 Prove the Existence of a Fixed Point</a></li>
<li><a name="toc-Floating_002dpoint-Numbers-1" href="#Floating_002dpoint-Numbers">3.3 Floating-point Numbers</a></li>
<li><a name="toc-Root-Finding-1" href="#Root-Finding">3.4 Root Finding</a>
<ul class="no-bullet">
<li><a name="toc-Interval-Newton-Method" href="#Interval-Newton-Method">3.4.1 Interval Newton Method</a></li>
<li><a name="toc-Bisection" href="#Bisection">3.4.2 Bisection</a></li>
</ul></li>
<li><a name="toc-Parameter-Estimation-1" href="#Parameter-Estimation">3.5 Parameter Estimation</a>
<ul class="no-bullet">
<li><a name="toc-Small-Search-Space" href="#Small-Search-Space">3.5.1 Small Search Space</a></li>
<li><a name="toc-Larger-Search-Space" href="#Larger-Search-Space">3.5.2 Larger Search Space</a></li>
<li><a name="toc-Combination-of-Functions" href="#Combination-of-Functions">3.5.3 Combination of Functions</a></li>
</ul></li>
<li><a name="toc-Path-Planning-1" href="#Path-Planning">3.6 Path Planning</a></li>
</ul></li>
<li><a name="toc-Advanced-Topics-1" href="#Advanced-Topics">4 Advanced Topics</a>
<ul class="no-bullet">
<li><a name="toc-Error-Handling" href="#Error-Handling">4.1 Error Handling</a></li>
<li><a name="toc-Decorations" href="#Decorations">4.2 Decorations</a></li>
<li><a name="toc-Specialized-interval-constructors" href="#Specialized-interval-constructors">4.3 Specialized interval constructors</a></li>
<li><a name="toc-Reverse-Arithmetic-Operations" href="#Reverse-Arithmetic-Operations">4.4 Reverse Arithmetic Operations</a></li>
<li><a name="toc-Tips-and-Tricks" href="#Tips-and-Tricks">4.5 Tips and Tricks</a></li>
<li><a name="toc-Validation" href="#Validation">4.6 Validation</a></li>
</ul></li>
<li><a name="toc-IEEE-Std-1788_002d2015-1" href="#IEEE-Std-1788_002d2015">Appendix A IEEE Std 1788-2015</a>
<ul class="no-bullet">
<li><a name="toc-Function-Names-1" href="#Function-Names">A.1 Function Names</a>
<ul class="no-bullet">
<li><a name="toc-Interval-constants" href="#Interval-constants">A.1.1 Interval constants</a></li>
<li><a name="toc-Constructors" href="#Constructors">A.1.2 Constructors</a></li>
<li><a name="toc-Required-functions" href="#Required-functions">A.1.3 Required functions</a></li>
<li><a name="toc-Recommended-functions" href="#Recommended-functions">A.1.4 Recommended functions</a></li>
<li><a name="toc-Operations-on_002fwith-decorations" href="#Operations-on_002fwith-decorations">A.1.5 Operations on/with decorations</a></li>
<li><a name="toc-Reduction-operations" href="#Reduction-operations">A.1.6 Reduction operations</a></li>
<li><a name="toc-Input" href="#Input">A.1.7 Input</a></li>
<li><a name="toc-Output" href="#Output">A.1.8 Output</a></li>
<li><a name="toc-Exact-text-representation" href="#Exact-text-representation">A.1.9 Exact text representation</a></li>
<li><a name="toc-Interchange-representation-and-encoding" href="#Interchange-representation-and-encoding">A.1.10 Interchange representation and encoding</a></li>
</ul></li>
<li><a name="toc-Conformance-Claim-1" href="#Conformance-Claim">A.2 Conformance Claim</a></li>
<li><a name="toc-Conformance-Questionnaire" href="#Conformance-Questionnaire">A.3 Conformance Questionnaire</a></li>
</ul></li>
<li><a name="toc-GNU-General-Public-License-1" href="#GNU-General-Public-License">Appendix B GNU General Public License</a></li>
</ul>
</div>
<hr>
<a name="Preface"></a>
<div class="header">
<p>
Next: <a href="#Getting-Started" accesskey="n" rel="next">Getting Started</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Preface-1"></a>
<h2 class="unnumbered">Preface</h2>
<p>Welcome to the user manual of the <em>interval package</em> for GNU Octave. This chapter presents background information and may safely be skipped. First-time users who want to cut right to the chase should read <a href="#Getting-Started">Getting Started</a>, which teaches basic concepts and first steps with the package. Users who are not familiar with interval arithmetic should read <a href="#Introduction-to-Interval-Arithmetic">Introduction to Interval Arithmetic</a> first. Still feeling undecided? Look at the <a href="#Examples">Examples</a> and see how easy you can put this software to great use!
</p>
<p>Development of the GNU Octave Interval Package started in September 2014. The IEEE standard for interval arithmetic, IEEE Std 1788-2015, had been drafted by its working group until July 2014 and was about to enter the balloting process. In January 2015 a first package release could be made, which contained the full set of functions required by the standard’s draft. On June 11 the standard finally became approved and this interval package can be seen as the first ever completed standard conforming interval arithmetic library.
</p>
<p>The creation of the interval package has been straightforward, although the author had no previous experience with Octave. Octave is a great environment for getting things done and its active community helps a lot. In this spirit, the interval package wants to be an easy to use tool for experimenting with and quick prototyping of interval arithmetic algorithms and applications.
</p>
<p>Originally it was intended to only implement the operations required by the standard document, but support for fundamental concepts of Octave as well as interval vectors and interval matrices have soon been added. Today the package contains many useful interval analysis algorithms and solvers, which, together with basic arithmetic functions, form a powerful and versatile library.
</p>
<p>In 2017 the Google Summer of Code (GSoC) program has lead to <a href="https://gsocinterval.blogspot.com/">support for N-dimensional arrays of intervals</a>.
</p>
<img border="0" src="image/octave-interval.svg.png" alt="GNU Octave Interval Pun" />
<p>Like Octave, the interval package has nothing to do with music. Above picture is a pun and shows an “octave interval” between the notes d’ and d”. The frequencies of these notes can be enclosed by an interval which is a subset of [293, 588] Hz.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Acknowledgments" accesskey="1">Acknowledgments</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Philosophy" accesskey="2">Philosophy</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Distribution-and-Development" accesskey="3">Distribution and Development</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Getting-Help" accesskey="4">Getting Help</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Acknowledgments"></a>
<div class="header">
<p>
Next: <a href="#Philosophy" accesskey="n" rel="next">Philosophy</a>, Up: <a href="#Preface" accesskey="u" rel="up">Preface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Acknowledgments-1"></a>
<h3 class="section">Acknowledgments</h3>
<p>The GNU Octave interval package is build upon great third-party software.
</p>
<ul>
<li> Most correctly rounded arithmetic operations are based on the <a href="http://www.mpfr.org/">GNU MPFR library</a> by Guillaume Hanrot, Vincent Lefèvre, Patrick Pélissier, Philippe Théveny and Paul Zimmermann.
</li><li> Several correctly rounded arithmetic operations are based on the <a href="http://lipforge.ens-lyon.fr/www/crlibm/">correctly rounded math library</a> by Jean-Michel Muller, Florent de Dinechin, Christoph Lauter, David Defour, Catherine Daramy-Loirat, Matthieu Gallet, and Nicolas Gast.
</li><li> Jiří Rohn has published his comprehensive verification toolbox <a href="http://uivtx.cs.cas.cz/~rohn/matlab/">VERSOFT</a> as free software on July 26, 2016. On November 24 he has fully disclosed the source code and several high-level functions could be included in the interval package with minor adjustments, e. g., <a href="https://octave.sourceforge.io/interval/function/@infsup/chol.html">@infsup/chol</a>, <a href="https://octave.sourceforge.io/interval/function/vereigvec.html">vereigvec</a>, and <a href="https://octave.sourceforge.io/interval/function/verlinprog.html">verlinprog</a>. Also, many thanks to Vladik Kreinovich who has helped to clear the licensing issue with VERSOFT.
</li><li> A linear system solver <a href="https://octave.sourceforge.io/interval/function/@infsup/mldivide.html">@infsup/mldivide</a> and a polynomial evaluation algorithm <a href="https://octave.sourceforge.io/interval/function/@infsup/polyval.html">@infsup/polyval</a> for bare intervals are derived from routines developed for <a href="http://www2.math.uni-wuppertal.de/~xsc/">C-XSC</a> at University of Wuppertal, Germany.
</li><li> <a href="#Introduction-to-Interval-Arithmetic">Introduction to Interval Arithmetic</a> is partly based on the documentation for the former SIMP package for Octave by Simone Pernice.
</li><li> A French translation of the package description has been made by Rodéric Moitié.
</li><li> In the <a href="#Examples">Examples</a> for finding root enclosures a function and code by Helmut Podhaisky has been used.
</li><li> The <a href="http://iamooc.ensta-bretagne.fr/">online course on interval analysis</a> by Luc Jaulin and Jordan Ninin at ENSTA-Bretagne has inspired me to implement the set inversion algorithms in <a href="https://octave.sourceforge.io/interval/function/@infsup/fsolve.html">@infsup/fsolve</a>.
</li><li> I have gained access to scientific literature thanks to the <a href="https://www.hswt.de/about-us/central-facilities/library.html">Weihenstephan-Triesdorf University of Applied Sciences</a>.
</li><li> Most unit tests are written in portable ITL format and converted into GNU Octave test cases with the <a href="https://github.com/nehmeier/ITF1788">Interval Testing Framework for IEEE 1788</a>. The framework has been developed by Maximilian Kiesner and Marco Nehmeier, Chair of Software Engineering, Department of Computer Science, University of Würzburg, Germany.
</li><li> Several unit tests are derived from <a href="https://github.com/nehmeier/libieeep1788">libieeep1788</a>, a C++ implementation of IEEE Std 1788-2015, IEEE standard for interval arithmetic. The library contains several unit tests for its IEEE 754 flavor, which is compatible with the arithmetic of the GNU Octave interval package. I have converted nearly 6000 of these test cases into portable ITL format for verification of this package.
<blockquote class="indentedblock">
<pre class="verbatim">libieeep1788
============
Copyright 2013 - 2015
Marco Nehmeier (nehmeier@informatik.uni-wuerzburg.de)
Department of Computer Science,
University of Wuerzburg, Germany
This product includes software developed at
Chair of Software Engineering,
Department of Computer Science,
University of Wuerzburg, Germany
http://se.informatik.uni-wuerzburg.de/
</pre></blockquote>
</li><li> Several unit tests are derived from <a href="http://perso.ens-lyon.fr/nathalie.revol/software.html">MPFI</a>, a C++ interval arithmetic library based on GNU MPFR. The library contains several unit tests for binary64 numbers, which are compatible with the arithmetic of the GNU Octave interval package. I have converted nearly 1500 of these test cases into portable ITL format for verification of this package.
</li><li> Several unit tests are derived from <a href="http://www2.math.uni-wuppertal.de/wrswt/software/filib.html">FI_LIB</a>, an ANSI-C interval arithmetic library based on binary64 numbers. The library contains several unit tests, which are compatible with the arithmetic of the GNU Octave interval package. I have converted 800 of these test cases into portable ITL format for verification of this package.
</li><li> Some unit tests are derived from <a href="http://www2.math.uni-wuppertal.de/~xsc/xsc/cxsc_new.html">C-XSC</a>, a C++ class library for interval arithmetic. The library contains some unit tests, which are compatible with the arithmetic of the GNU Octave interval package. I have converted 160 of these test cases into portable ITL format for verification of this package.
</li><li> Fast matrix multiplication (see <a href="https://octave.sourceforge.io/interval/function/@infsup/mtimes.html">@infsup/mtimes</a>) as well as the linear system solver (see <a href="https://octave.sourceforge.io/interval/function/@infsup/mldivide.html">@infsup/mldivide</a>) use BLAS routines with directed rounding. An OCT-file interface for setting the rounding mode has been developed by Kai Torben Ohlus, Institute for Reliable Computing, Hamburg University of Technology, Germany.
</li></ul>
<p>Last, but not least, many thanks to everybody who has contributed to the success of free software!
</p>
<hr>
<a name="Philosophy"></a>
<div class="header">
<p>
Next: <a href="#Distribution-and-Development" accesskey="n" rel="next">Distribution and Development</a>, Previous: <a href="#Acknowledgments" accesskey="p" rel="prev">Acknowledgments</a>, Up: <a href="#Preface" accesskey="u" rel="up">Preface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Philosophy-1"></a>
<h3 class="section">Philosophy</h3>
<p>Features
</p><ul>
<li> Free software licensed under the terms of the GNU General Public License (Version 3 or later)
</li><li> Many interval arithmetic functions with high, system-independent accuracy
</li><li> Conforming to IEEE Std 1788-2015, IEEE standard for interval arithmetic
</li><li> Support for interval vectors, interval matrices and N-dimensional interval arrays
<ul>
<li> very accurate vector sum, vector dot and matrix multiplication (correctly rounded)
</li><li> fast matrix multiplication and fast solver for dense linear systems (BLAS routines)
</li><li> vectorized function evaluation
</li></ul>
</li><li> Easy usage
<ul>
<li> GNU Octave function names
</li><li> convenient interval constructors
</li><li> broadcasting
</li></ul>
</li></ul>
<p>Limitations
</p><ul>
<li> No complex numbers
</li><li> No sparse matrices (maybe in the future, if requested by users)
</li></ul>
<p>The interval arithmetic provided by the interval package focuses on easy usage, accuracy and correctness. It is rather slow compared to other arithmetic libraries.
</p>
<p>If accurate type checking during compile time—a substantial feature for verified computing—is needed, the user is advised to try third-party interval libraries for strongly typed programming languages like C/C++. The interval package for GNU Octave can nonetheless be used for prototyping of interval algorithms.
</p>
<p><em>Why is the interval package slow?</em> All arithmetic interval operations are simulated in high-level Octave language using C99 or multi-precision floating-point routines, which is a lot slower than a <a href="https://books.google.com/books?id=JTc4XdXFnQIC&pg=PA61">hardware implementation</a>. Building interval arithmetic operations from floating-point routines is easy for simple monotonic functions, e. g., addition and subtraction, but is complex for others, e. g., interval power function, atan2, or reverse functions.
</p>
<p>For some interval operations it is not even possible to rely on floating-point routines, since not all required routines are available in C99 or BLAS. For example, accurate multiplication of matrices with many elements becomes unfeasible as it takes a lot of time.
</p>
<div class="float"><a name="tab_003aruntime"></a>
<table>
<thead><tr><th></th><th><code>plus</code></th><th><code>log</code></th><th><code>pow</code></th><th><code>mtimes</code></th><th><code>mtimes</code></th><th><code>inv</code></th></tr></thead>
<tr><td>Interval<br>matrix size</td><td>tightest<br>accuracy</td><td>tightest<br>accuracy</td><td>tightest<br>accuracy</td><td>valid<br>accuracy</td><td>tightest<br>accuracy</td><td>valid<br>accuracy</td></tr>
<tr><td>10 × 10</td><td>< 0.001</td><td>0.001</td><td>0.008</td><td>0.001</td><td>0.002</td><td>0.025</td></tr>
<tr><td>100 × 100</td><td>0.003</td><td>0.055</td><td>0.61</td><td>0.012</td><td>0.53</td><td>0.30</td></tr>
<tr><td>500 × 500</td><td>0.060</td><td>1.3</td><td>15</td><td>0.30</td><td>63</td><td>4.2</td></tr>
</table>
<div class="float-caption"><p><strong>Table 1: </strong>Approximate runtime for certain functions (wall clock time in seconds) — Results have been produced with GNU Octave 3.8.2 and Interval package 0.1.4 on an Intel Core i5-4340M CPU (2.9–3.6 GHz)</p></div></div>
<p><em>Why is the interval package accurate?</em> The GNU Octave built-in floating-point routines are not useful for interval arithmetic: Their results depend on hardware, system libraries and compilation options. The interval package handles all arithmetic functions with the help of the GNU MPFR library. With MPFR it is possible to compute system-independent, valid and tight enclosures of the correct results for most functions. However, it should be noted that some reverse operations and matrix operations do not exists in GNU MPFR and therefore cannot be computed with the same accuracy.
</p>
<p>It is possible to use faster (BLAS based) routines during computation of the matrix multiplication <a href="https://octave.sourceforge.io/interval/function/@infsup/mtimes.html">@infsup/mtimes</a>, because correctly rounded matrix multiplication could be considered too slow for certain applications. However, this is not the default behavior and must be explicitly activated by the user.
</p>
<hr>
<a name="Distribution-and-Development"></a>
<div class="header">
<p>
Next: <a href="#Getting-Help" accesskey="n" rel="next">Getting Help</a>, Previous: <a href="#Philosophy" accesskey="p" rel="prev">Philosophy</a>, Up: <a href="#Preface" accesskey="u" rel="up">Preface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Distribution-and-Development-1"></a>
<h3 class="section">Distribution and Development</h3>
<p>The interval package is free software: Everyone is encouraged to use it, copy it and redistribute it, as well as to make changes under the terms of the GNU General Public License.
</p>
<p>The interval package is part of Octave Forge, a sibling of the GNU Octave project. Official releases are published at <a href="https://octave.sourceforge.io/">https://octave.sourceforge.io/</a>.
</p>
<p>The <a href="https://sourceforge.net/p/octave/interval/ci/default/tree/">source code repository</a> is located at Octave Forge and contains the latest development version. Information for developers can be found on the <a href="https://wiki.octave.org/Interval_package">package’s page at Octave wiki</a>.
</p>
<p>Bug reports and feature requests for either the software or this manual may be posted under the <a href="https://savannah.gnu.org/projects/octave">Octave Project at Savannah</a>.
</p>
<p>Contributions to the software and this manual are highly appreciated.
</p>
<hr>
<a name="Getting-Help"></a>
<div class="header">
<p>
Previous: <a href="#Distribution-and-Development" accesskey="p" rel="prev">Distribution and Development</a>, Up: <a href="#Preface" accesskey="u" rel="up">Preface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Getting-Help-1"></a>
<h3 class="section">Getting Help</h3>
<p>The interval package contains online help for every function, which can be accessed with the <code>help</code> command from Octave. The interval arithmetic is implemented with specialized data types, which override standard functions. Whilst the command <code>help <var>function name</var></code> shows the documentation for core Octave functions, the interval variants of these functions can be requested with the command <code>help @infsup/<var>function name</var></code>.
</p>
<p>Further help can be seeked at the <a href="https://lists.gnu.org/mailman/listinfo/help-octave">Octave Help mailing list</a>.
</p>
<hr>
<a name="Getting-Started"></a>
<div class="header">
<p>
Next: <a href="#Introduction-to-Interval-Arithmetic" accesskey="n" rel="next">Introduction to Interval Arithmetic</a>, Previous: <a href="#Preface" accesskey="p" rel="prev">Preface</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Getting-Started-1"></a>
<h2 class="chapter">1 Getting Started</h2>
<p>This chapter takes you by the hand and gives a quick overview on the interval packages basic capabilities. More detailed information can usually be found in the functions’ documentation.
</p>
<a name="Installation"></a>
<h3 class="section">1.1 Installation</h3>
<p>It is recommended to install the package from specialized distributors for the particular platform, e. g., <a href="https://tracker.debian.org/pkg/octave-interval">Debian GNU/Linux</a>, <a href="https://trac.macports.org/browser/trunk/dports/math/octave-interval">MacPorts (for Mac OS X)</a>, <a href="http://www.freshports.org/math/octave-forge-interval/">FreshPorts (for FreeBSD)</a>, and so on. Since Octave version 4.0.1 the package is included in the <a href="https://ftp.gnu.org/gnu/octave/windows/">official installer for Microsoft Windows</a> and is installed automatically on that platform.
</p>
<p>In any case, the interval package can alternatively be installed with the <code>pkg</code> command from within Octave. Latest release versions are published at Octave Forge and can be automatically downloaded with the <samp>-forge</samp> option.
</p>
<div class="example">
<pre class="example">pkg install -forge interval
-| For information about changes from previous versions
-| of the interval package, run 'news interval'.
</pre></div>
<p>During this kind of installation parts of the interval package are compiled for the target system, which requires development libraries for GNU Octave (version ≥ 3.8.0) and GNU MPFR (version ≥ 3.1.0) to be installed. It might be necessary to install packages “liboctave-dev” and “libmpfr-dev”, which are provided by most GNU distributions (names may vary).
</p>
<p>In order to use the interval package during an Octave session, it must have been <em>loaded</em>, i. e., added to the path. In the following parts of the manual it is assumed that the package has been loaded, which can be accomplished with the <code>pkg load interval</code> command. It is recommended to add this command at the beginning of script files, especially if script files are published or shared. Automatic loading of the interval package can be activated by adding the line <code>pkg load interval</code> to your <samp>.octaverc</samp> file located in your user folder, for more information see <a href="https://www.gnu.org/software/octave/doc/interpreter/Startup-Files.html#Startup-Files">Startup Files</a> in <cite>GNU Octave manual</cite>.
</p>
<p>That’s it. The package is ready to be used within Octave.
</p>
<a name="Set_002dbased-Interval-Arithmetic"></a>
<h3 class="section">1.2 Set-based Interval Arithmetic</h3>
<p>The most important and fundamental concepts in the context of the interval package are:
</p><ul>
<li> Intervals are closed, connected subsets of the real numbers. Intervals may be unbound (in either or both directions) or empty. In special cases <code>+inf</code> and <code>-inf</code> are used to denote boundaries of unbound intervals, but any member of the interval is a <em>finite</em> real number.
</li><li> Classical functions are extended to interval functions as follows: The result of function <var>f</var> evaluated on interval <var>x</var> is an interval enclosure of all possible values of <var>f</var> over <var>x</var> where the function is defined. Most interval arithmetic functions in this package manage to produce a very accurate such enclosure.
</li><li> The result of an interval arithmetic function is an interval in general. It might happen, that the mathematical range of a function consist of several intervals, but their union will be returned, e. g., 1 / [-1, 1] = [Entire].
</li></ul>
<p>More details can be found in <a href="#Introduction-to-Interval-Arithmetic">Introduction to Interval Arithmetic</a>.
</p>
<a name="Input-and-Output"></a>
<h3 class="section">1.3 Input and Output</h3>
<p>Before exercising interval arithmetic, interval objects must be created from non-interval data. There are interval constants <a href="https://octave.sourceforge.io/interval/function/empty.html">empty</a> and <a href="https://octave.sourceforge.io/interval/function/entire.html">entire</a> and the interval constructors <a href="https://octave.sourceforge.io/interval/function/@infsupdec/infsupdec.html">@infsupdec/infsupdec</a> (create an interval from boundaries), <a href="https://octave.sourceforge.io/interval/function/midrad.html">midrad</a> (create an interval from midpoint and radius) and <a href="https://octave.sourceforge.io/interval/function/hull.html">hull</a> (create an interval enclosure for a list of mixed arguments: numbers, intervals or interval literals). The constructors are very sophisticated and can be used with several kinds of parameters: Interval boundaries can be given by numeric values or string values with decimal numbers.
</p>
<p>Create intervals for performing interval arithmetic
</p><div class="example">
<pre class="example">## Interval with a single number
infsupdec (1)
⇒ ans = [1]_com
</pre></div>
<div class="example">
<pre class="example">## Interval defined by lower and upper bound
infsupdec (1, 2)
⇒ ans = [1, 2]_com
</pre></div>
<div class="example">
<pre class="example">## Boundaries are converted from strings
infsupdec ("3", "4")
⇒ ans = [3, 4]_com
</pre></div>
<div class="example">
<pre class="example">## Decimal number
infsupdec ("1.1")
⇒ ans ⊂ [1.0999, 1.1001]_com
</pre></div>
<div class="example">
<pre class="example">## Decimal number with scientific notation
infsupdec ("5.8e-17")
⇒ ans ⊂ [5.7999e-17, 5.8001e-17]_com
</pre></div>
<div class="example">
<pre class="example">## Interval around 12 with uncertainty of 3
midrad (12, 3)
⇒ ans = [9, 15]_com
</pre></div>
<div class="example">
<pre class="example">## Again with decimal numbers
midrad ("4.2", "1e-3")
⇒ ans ⊂ [4.1989, 4.2011]_com
</pre></div>
<div class="example">
<pre class="example">## Interval members with arbitrary order
hull (3, 42, "19.3", "-2.3")
⇒ ans ⊂ [-2.3001, +42]_com
</pre></div>
<div class="example">
<pre class="example">## Symbolic numbers
hull ("pi", "e")
⇒ ans ⊂ [2.7182, 3.1416]_com
</pre></div>
<p><strong>Warning:</strong> In above examples decimal fractions are passed as a string to the constructor. Otherwise it is possible, that GNU Octave introduces conversion errors when the numeric literal is converted into a floating-point number <em>before</em> it is passed to the constructor. The interval construction is a critical process, but after this the interval package takes care of any further conversion errors, representational errors, round-off errors and inaccurate numeric functions.
</p>
<p>Beware of the conversion pitfall
</p><div class="example">
<pre class="example">## The numeric constant 0.3 is an approximation of the
## decimal number 0.3. An interval around this approximation
## will not contain the decimal number 0.3.
output_precision (17)
infsupdec (0.3)
⇒ ans ⊂ [0.29999999999999998, 0.29999999999999999]_com
</pre></div>
<div class="example">
<pre class="example">## However, passing the decimal number 0.3 as a string
## to the interval constructor will create an interval which
## actually encloses the decimal number.
format short
infsupdec ("0.3")
⇒ ans ⊂ [0.29999, 0.30001]_com
</pre></div>
<p>For maximum portability it is recommended to use interval literals, which are standardized by IEEE Std 1788-2015. Both interval boundaries are then given as a string in the form <code>[<var>l</var>, <var>u</var>]</code>. The output in the examples above gives examples of several interval literals.
</p>
<div class="example">
<pre class="example">## Interval literal
infsupdec ("[20, 4.2e10]")
⇒ ans = [20, 4.2e+10]_com
</pre></div>
<p>The default text representation of intervals is not guaranteed to be exact, because this would massively spam console output. For example, the exact text representation of <code>realmin</code> would be over 700 decimal places long! However, the output is correct as it guarantees to contain the actual boundaries: a displayed lower (upper) boundary is always less (greater) than or equal to the actual boundary.
</p>
<a name="Interval-Vectors_002c-Matrices-and-Arrays"></a>
<h4 class="subsection">1.3.1 Interval Vectors, Matrices and Arrays</h4>
<p>Vectors, matrices and arrays of intervals can be created by passing numerical arrays, string or cell arrays to the interval constructors. With cell arrays it is also possible to mix several types of boundaries.
</p>
<p>Interval arrays behave like normal arrays in GNU Octave and can be used for broadcasting and vectorized function evaluation. Vectorized function evaluation usually is the key to create very fast programs.
</p>
<p>Create interval arrays
</p><div class="example">
<pre class="example">M = infsupdec (magic (3))
⇒ M = 3×3 interval matrix
[8]_com [1]_com [6]_com
[3]_com [5]_com [7]_com
[4]_com [9]_com [2]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec (magic (3), magic (3) + 1)
⇒ ans = 3×3 interval matrix
[8, 9]_com [1, 2]_com [6, 7]_com
[3, 4]_com [5, 6]_com [7, 8]_com
[4, 5]_com [9, 10]_com [2, 3]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("0.1; 0.2; 0.3; 0.4; 0.5")
⇒ ans ⊂ 5×1 interval vector
[0.099999, 0.10001]_com
[0.19999, 0.20001]_com
[0.29999, 0.30001]_com
[0.39999, 0.40001]_com
[0.5]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("1 [2, 3]; 4, 5, 6")
⇒ ans = 2×3 interval matrix
[1]_com [2, 3]_com [Empty]_trv
[4]_com [5]_com [6]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ({1; eps; "4/7"; "pi"}, {2; 1; "e"; "0xff"})
⇒ ans ⊂ 4×1 interval vector
[1, 2]_com
[2.2204e-16, 1]_com
[0.57142, 2.7183]_com
[3.1415, 255]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec (ones (2, 2, 2))
⇒ ans = 2×2×2 interval array
ans(:,:,1) =
[1]_com [1]_com
[1]_com [1]_com
ans(:,:,2) =
[1]_com [1]_com
[1]_com [1]_com
</pre></div>
<p>Strings can easily be used to create vectors and matrices of intervals, <code>,</code> and <code>;</code> are used to denote the next element in the row or a new row. Octave does however not have way of representing arrays with three or more dimensions using strings in the same way. Therefore you can only create such arrays by passing numerical matrices or cells to the constructor. Alternatively you can build it up in steps.
</p>
<div class="example">
<pre class="example">A = infsupdec ("1 [2, 3]; 4, 5; 6, 7")
⇒ A = 3×2 interval matrix
[1]_com [2, 3]_com
[4]_com [5]_com
[6]_com [7]_com
A(:,:,2) = infsupdec ("0.1, 0.2; 0.3, 0.4; 0.5, 0.6")
⇒ A ⊂ 3×2×2 interval array
ans(:,:,1) =
[1]_com [2, 3]_com
[4]_com [5]_com
[6]_com [7]_com
ans(:,:,2) =
[0.099999, 0.10001]_com [0.19999, 0.20001]_com
[0.29999, 0.30001]_com [0.39999, 0.40001]_com
[0.5]_com [0.59999, 0.60001]_com
</pre></div>
<a name="Arithmetic-Operations"></a>
<h3 class="section">1.4 Arithmetic Operations</h3>
<p>The interval package comprises many interval arithmetic operations. A complete list can be found in its function reference. Function names match GNU Octave standard functions where applicable and follow recommendations by IEEE Std 1788-2015 otherwise, see <a href="#Function-Names">Function Names</a>.
</p>
<p>The interval arithmetic flavor used by this package is the “set-based” interval arithmetic and follows these rules: Intervals are sets. They are subsets of the set of real numbers. The interval version of an elementary function such as sin(x) is essentially the natural extension to sets of the corresponding point-wise function on real numbers. That is, the function is evaluated for each number in the interval where the function is defined and the result must be an enclosure of all possible values that may occur.
</p>
<p>By default arithmetic functions are computed with best possible accuracy (which is more than what is guaranteed by GNU Octave core functions). The result will therefore be a tight and very accurate enclosure of the true mathematical value in most cases. Details on each function’s accuracy can be found in its documentation, which is accessible with GNU Octave’s <code>help</code> command.
</p>
<p>Examples of using interval arithmetic functions
</p><div class="example">
<pre class="example">sin (infsupdec (0.5))
⇒ ans ⊂ [0.47942, 0.47943]_com
</pre></div>
<div class="example">
<pre class="example">power (infsupdec (2), infsupdec (3, 4))
⇒ ans = [8, 16]_com
</pre></div>
<div class="example">
<pre class="example">atan2 (infsupdec (1), infsupdec (1))
⇒ ans ⊂ [0.78539, 0.7854]_com
</pre></div>
<div class="example">
<pre class="example">midrad (magic (3), 0.5) * pascal (3)
⇒ ans = 3×3 interval matrix
[13.5, 16.5]_com [25, 31]_com [42, 52]_com
[13.5, 16.5]_com [31, 37]_com [55, 65]_com
[13.5, 16.5]_com [25, 31]_com [38, 48]_com
</pre></div>
<a name="Numerical-Operations"></a>
<h3 class="section">1.5 Numerical Operations</h3>
<p>Some interval functions do not return an interval enclosure, but a single number (in binary64 precision). Most important are <a href="https://octave.sourceforge.io/interval/function/@infsup/inf.html">@infsup/inf</a> and <a href="https://octave.sourceforge.io/interval/function/@infsup/sup.html">@infsup/sup</a>, which return the lower and upper interval boundaries.
</p>
<p>More such operations are <a href="https://octave.sourceforge.io/interval/function/@infsup/mid.html">@infsup/mid</a> (approximation of the interval’s midpoint), <a href="https://octave.sourceforge.io/interval/function/@infsup/wid.html">@infsup/wid</a> (approximation of the interval’s width), <a href="https://octave.sourceforge.io/interval/function/@infsup/rad.html">@infsup/rad</a> (approximation of the interval’s radius), <a href="https://octave.sourceforge.io/interval/function/@infsup/mag.html">@infsup/mag</a> (interval’s magnitude) and <a href="https://octave.sourceforge.io/interval/function/@infsup/mig.html">@infsup/mig</a> (interval’s mignitude).
</p>
<div class="example">
<pre class="example">## Enclosure of the decimal number 0.1 is not exact
## and results in an interval with a small uncertainty.
wid (infsupdec ("0.1"))
⇒ ans = 1.3878e-17
</pre></div>
<a name="Boolean-Operations"></a>
<h3 class="section">1.6 Boolean Operations</h3>
<p>Interval comparison operations produce boolean results. While some comparisons are especially for intervals (<a href="https://octave.sourceforge.io/interval/function/@infsup/subset.html">@infsup/subset</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/interior.html">@infsup/interior</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/ismember.html">@infsup/ismember</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/isempty.html">@infsup/isempty</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/disjoint.html">@infsup/disjoint</a>, …) others are interval extensions of simple numerical comparison. For example, the less-or-equal comparison is mathematically defined as ∀a ∃b a ≤ b ∧ ∀b ∃a a ≤ b.
</p>
<div class="example">
<pre class="example">infsup (1, 3) <= infsup (2, 4)
⇒ ans = 1
</pre></div>
<a name="Matrix-and-Array-Operations"></a>
<h3 class="section">1.7 Matrix and Array Operations</h3>
<p>Above mentioned operations can also be applied element-wise to interval vectors, matrices or arrays. Many operations use vectorization techniques.
</p>
<p>In addition, there are operations on interval matrices and arrays. These operations comprise: dot product, matrix multiplication, vector sums (all with tightest accuracy), matrix inversion, matrix powers, and solving linear systems (the latter are less accurate). As a result of missing hardware / low-level library support and missing optimizations, these operations are relatively slow compared to familiar operations in floating-point arithmetic.
</p>
<p>Examples of using interval matrix functions
</p><div class="example">
<pre class="example">A = infsupdec ([1, 2, 3; 4, 0, 0; 0, 0, 1]);
A (2, 3) = "[0, 6]"
⇒ A = 3×3 interval matrix
[1]_com [2]_com [3]_com
[4]_com [0]_com [0, 6]_com
[0]_com [0]_com [1]_com
</pre></div>
<div class="example">
<pre class="example">B = inv (A)
⇒ B = 3×3 interval matrix
[0]_trv [0.25]_trv [-1.5, 0]_trv
[0.5]_trv [-0.125]_trv [-1.5, -0.75]_trv
[0]_trv [0]_trv [1]_trv
</pre></div>
<div class="example">
<pre class="example">A * B
⇒ ans = 3×3 interval matrix
[1]_trv [0]_trv [-1.5, +1.5]_trv
[0]_trv [1]_trv [-6, +6]_trv
[0]_trv [0]_trv [1]_trv
</pre></div>
<div class="example">
<pre class="example">A = infsupdec (magic (3))
⇒ A = 3×3 interval matrix
[8]_com [1]_com [6]_com
[3]_com [5]_com [7]_com
[4]_com [9]_com [2]_com
</pre></div>
<div class="example">
<pre class="example">c = A \ [3; 4; 5]
⇒ c ⊂ 3×1 interval vector
[0.18333, 0.18334]_trv
[0.43333, 0.43334]_trv
[0.18333, 0.18334]_trv
</pre></div>
<div class="example">
<pre class="example">A * c
⇒ ans ⊂ 3×1 interval vector
[2.9999, 3.0001]_trv
[3.9999, 4.0001]_trv
[4.9999, 5.0001]_trv
</pre></div>
<a name="Notes-on-Linear-Systems"></a>
<h4 class="subsection">1.7.1 Notes on Linear Systems</h4>
<p>A system of linear equations in the form A<var>x</var> = b with intervals can be seen as a range of classical linear systems, which can be solved simultaneously. Whereas classical algorithms compute an approximation for a single solution of a single linear system, interval algorithms compute an enclosure for all possible solutions of (possibly several) linear systems. Some characteristics should definitely be known when linear interval systems are solved:
</p>
<ul>
<li> If the linear system is underdetermined and has infinitely many solutions, the interval solution will be unbound in at least one of its coordinates. Contrariwise, from an unbound result it can not be concluded whether the linear system is underdetermined or has solutions.
</li><li> If the interval result is empty in at least one of its coordinates, the linear system is guaranteed to be overdetermined and has no solutions. Contrariwise, from a non-empty result it can not be concluded whether all or some of the systems have solutions or not.
</li><li> Wide intervals within the matrix A can easily lead to a superposition of cases, where the rank of A is no longer unique. If the linear interval system contains cases of linear independent equations as well as linear dependent equations, the resulting enclosure of solutions will inevitably be very broad.
</li></ul>
<p>However, solving linear systems with interval arithmetic can produce useful results in many cases and automatically carries a guarantee for error boundaries. Additionally, it can give better information than the floating-point variants for some cases.
</p>
<p>Standard floating point arithmetic versus interval arithmetic on ill-conditioned linear systems
</p><div class="example">
<pre class="example">A = [1, 0; 2, 0];
## This linear system has no solutions
A \ [3; 0]
-| warning: ...matrix singular to machine precision...
⇒ ans =
0.60000
0.00000
</pre></div>
<div class="example">
<pre class="example">## This linear system has many solutions
A \ [4; 8]
⇒ ans =
4
0
</pre></div>
<div class="example">
<pre class="example">## The empty interval vector proves that there is no solution
infsup (A) \ [3; 0]
⇒ ans = 2×1 interval vector
[Empty]
[Empty]
</pre></div>
<div class="example">
<pre class="example">## The unbound interval vector indicates
## that there may be many solutions
infsup (A) \ [4; 8]
⇒ ans = 2×1 interval vector
[4]
[Entire]
</pre></div>
<a name="Plotting"></a>
<h3 class="section">1.8 Plotting</h3>
<p>Plotting of intervals in 2D and 3D can be achieved with the functions <a href="https://octave.sourceforge.io/interval/function/@infsup/plot.html">@infsup/plot</a> and <a href="https://octave.sourceforge.io/interval/function/@infsup/plot3.html">@infsup/plot3</a> respectively. However, some differences in comparison with classical plotting in Octave shall be noted.
</p>
<p>When plotting classical (non-interval) functions in Octave, one normally uses a vector and evaluates a function on that vector element-wise. The resulting X and Y (and possibly Z) coordinates are then drawn against each other, whilst coordinates can be connected using interpolated lines. The plot shows an approximation of the function’s graph and the accuracy (and smoothness of the graph) primarily depends on the number of coordinates where the function has been evaluated.
</p>
<p>Evaluating the same function on a single interval (e. g. the part of the function’s domain that is of interest) yields a single interval result which covers the actual range of the function. Plotting just two intervals, input and output, against each other is boring, because the plot would only show a single rectangle. Contrariwise, evaluating the function for many individual points (e. g. using <a href="https://octave.sourceforge.io/interval/function/@infsup/linspace.html">@infsup/linspace</a>) would hardly fit in the philosophy of interval arithmetic. Individual points of evaluation are not interconnected by the interval plotting functions, because that would introduce errors.
</p>
<p>The solution for plotting functions with interval arithmetic is called: “mincing”. The <a href="https://octave.sourceforge.io/interval/function/@infsup/mince.html">@infsup/mince</a> function divides an interval into many smaller adjacent subsets, which can be used for range evaluations of the function. As a result, one gets vectors of intervals, which produce a coverage of the function’s graph using rectangles. Please note, how the rectangles cover the sine function’s true range from -1 to 1 in the following example, whilst the interpolated lines make a poor approximation.
</p>
<div class="example">
<pre class="example">hold on
blue = [38 139 210] ./ 255;
shade = [238 232 213] ./ 255;
</pre><pre class="example">## Interval plotting
x = mince (2*infsup (0, "pi"), 6);
plot (x, sin (x), shade)
</pre><pre class="example">## Classical plotting
x = linspace (0, 2*pi, 7);
plot (x, sin (x), 'linewidth', 2, 'color', blue)
</pre><pre class="example">set (gca, 'XTick', 0 : pi : 2*pi)
set (gca, 'XTickLabel', {'0', 'pi', '2 pi'})
</pre></div>
<img border="0" src="image/interval-vs-normal-plot.m.png" alt="Plotting an interval function and a classic function" />
<p>For 3D plotting the Octave meshgrid function, as usual, becomes handy. The following example shows how two different ranges for X and Y coordinates are used to construct a grid, where the function <a href="https://octave.sourceforge.io/interval/function/@infsup/atan2.html">@infsup/atan2</a> is evaluated. In this particular case the interval grid has gaps, because X and Y coordinates have been constructed such that intervals do not intersect.
</p>
<div class="example">
<pre class="example">red = [220 50 47] ./ 255;
shade = [238 232 213] ./ 255;
</pre><pre class="example">x = midrad (1 : 6, 0.25);
y = midrad (-3 : 3, 0.25);
[x, y] = meshgrid (x, y);
z = atan2 (y, x);
plot3 (x, y, z, shade, red)
</pre><pre class="example">view ([-35, 30])
box off
set (gca, "xgrid", "on", "ygrid", "on", "zgrid", "on")
</pre></div>
<img border="0" src="image/interval-plot3.m.png" alt="Plotting 3D interval grid points" />
<hr>
<a name="Introduction-to-Interval-Arithmetic"></a>
<div class="header">
<p>
Next: <a href="#Examples" accesskey="n" rel="next">Examples</a>, Previous: <a href="#Getting-Started" accesskey="p" rel="prev">Getting Started</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Introduction-to-Interval-Arithmetic-1"></a>
<h2 class="chapter">2 Introduction to Interval Arithmetic</h2>
<blockquote>
<p>Give a digital computer a problem in arithmetic, and it will grind away methodically, tirelessly, at gigahertz speed, until ultimately it produces the wrong answer. … An interval computation yields a pair of numbers, an upper and a lower bound, which are guaranteed to enclose the exact answer. Maybe you still don’t know the truth, but at least you know how much you don’t know.
</p></blockquote>
<div align="center">— <em>Brian Hayes, <a href="http://dx.doi.org/10.1511/2003.6.484">DOI: 10.1511/2003.6.484</a></em>
</div>
<p>Interval arithmetic adds two unique features to ordinary computer arithmetic: (1) Functions can be evaluated over (connected) subsets of their domain, and (2) any computational errors are automatically considered and are accumulated in the final outcome. In conjunction they yield a <em>verified result enclosure</em> over a range of input values.
</p>
<p>These possibilities of interval arithmetic enable great new possibilities, but what is wrong with the well-known computer arithmetic in the first place?
</p>
<a name="Motivation"></a>
<h3 class="section">2.1 Motivation</h3>
<p>Floating-point arithmetic, as specified by <a href="http://en.wikipedia.org/wiki/IEEE_floating_point">IEEE Std 754</a>, is available in almost every computer system today. It is wide-spread, implemented in common hardware and integral part in programming languages. For example, the binary64 format (a.k.a. double-precision) is the default numeric data type in GNU Octave. Benefits are obvious: The results of arithmetic operations are (mostly) well-defined and comparable between different systems and computation is highly efficient.
</p>
<p>However, there are some downsides of floating-point arithmetic in practice, which will eventually produce errors in computations. Generally speaking, most of these problems occur in any arithmetic with finite precision.
</p>
<ul>
<li> Floating-point arithmetic is often used mindlessly by developers. <a href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html">http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html</a> <a href="http://www.cs.berkeley.edu/~wkahan/Mindless.pdf">http://www.cs.berkeley.edu/~wkahan/Mindless.pdf</a> <a href="http://www.ima.umn.edu/~arnold/disasters/">http://www.ima.umn.edu/~arnold/disasters/</a>
</li><li> The binary (base-2) data types categorically are not suitable for doing financial computations. Very often representational errors are introduced when using “real world” decimal numbers. <a href="http://en.wikipedia.org/wiki/Decimal_computer">http://en.wikipedia.org/wiki/Decimal_computer</a>
</li><li> Even if the developer would be proficient, most developing environments / technologies limit floating-point arithmetic capabilities to a very limited subset of IEEE Std 754: Only one or two data types, no rounding modes, missing functions, … <a href="http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf">http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf</a>
</li><li> Results are <a href="https://hal.archives-ouvertes.fr/hal-00128124/en/">hardly predictable</a>. All operations produce the best possible accuracy at runtime, this is how a floating point works. Contrariwise, financial computer systems typically use a <a href="http://en.wikipedia.org/wiki/Fixed-point_arithmetic">fixed-point arithmetic</a> (COBOL, PL/I, …), where overflow and rounding can be precisely predicted at <em>compile-time</em>.
</li><li> Results are system dependent. All but the most basic floating-point operations are <a href="http://www.gnu.org/software/libc/manual/html_node/Errors-in-Math-Functions.html#Errors-in-Math-Functions">not guaranteed to be accurate</a> and produce different results depending on low level libraries and <a href="http://developer.amd.com/tools-and-sdks/cpu-development/libm/">hardware</a>.
</li><li> If you do not know the technical details (cf. first bullet) you ignore the fact that the computer lies to you in many situations. For example, when looking at numerical output and the computer says “<code>ans = 0.1</code>,” this is not absolutely correct. In fact, the value is only close enough to the value 0.1. Additionally, many functions produce limit values (∞ × −∞ = −∞, ∞ ÷ 0 = ∞, ∞ ÷ −0 = −∞, log (0) = −∞), which is sometimes (but not always!) useful when overflow and underflow occur.
</li></ul>
<p>Interval arithmetic addresses above problems in its very special way. It accepts the fact that numbers cannot be stored or computed with infinite precision and introduces enclosures of exact values, which can be computed on any machine with finite precision.
</p>
<p>This introduces new possibilities for algorithms. Any errors are covered by the range of an interval during the course of computation. All members of intervals are by definition finite real numbers, which results in an exception free and mathematically well-defined arithmetic. The possibility to actually evaluate a function on a connected range of values and compute a guaranteed enclosure of all possible values is a unique selling point.
</p>
<p>For example, the <a href="http://en.wikipedia.org/wiki/Interval_arithmetic#Interval_Newton_method">interval newton method</a> (see <a href="https://octave.sourceforge.io/interval/function/@infsup/fzero.html">@infsup/fzero</a>) is able to find <em>all</em> zeros of a particular function. More precisely, the algorithm is able to reliably eliminate ranges of values where the function cannot have a root by a simple interval evaluation of either the function itself or its derivative. Global convergence can be achieved by bisecting the intermediate ranges.
</p>
<a name="Error-bounds-in-real-life"></a>
<h3 class="section">2.2 Error bounds in real life</h3>
<p>Intervals can be used instead of simple numbers to automatically take into account the tolerance (or uncertainty) of the values used in calculation. Every day we need to compute the result of a lot of simple mathematical equations. For example the cost of the apples bought at the farmer’s market is given by:
</p><div class="display">
<pre class="display"> apple price = apple cost per kilo · kilos of apple bought
</pre></div>
<p>When we need the result of those mathematical expressions, we put the values on the right hand side of the equation and we compute its result for the left hand side. We usually put wrong (erroneous) numbers into the equation and therefore where is no doubt we get wrong results. There are a lot of reasons why we use incorrect values, for example
</p><ol>
<li> Most of the values are measured, therefore they are known within a given tolerance. <a href="http://en.wikipedia.org/wiki/Accuracy_and_precision">Wikipedia sv. accuracy and precision</a>
</li><li> Some values have an infinite number of digits after the (decimal) point, e.g. π.
</li><li> Some values change with time or samples (or whatever), like the weight of a person, which can change of 5 percent during the day, or the current gain of a bipolar junction transistor (BJP), which can change of 50 percent on the samples of the same series.
</li><li> Some values are estimation or guess—something like between a minimum and a maximum.
</li></ol>
<p>For example, if a pipe breaks and you want to buy a new one you need its diameter. If you do not have a caliber, you may measure its circumference and divide it by π.
</p><div class="display">
<pre class="display">diameter = circumference / π
</pre></div>
<p>Here are two errors: the circumference is known within the tolerance given by your meter, moreover π has an infinite number of digits while only few of them can be used in the operation. You may think the error is negligible, the result is enough accurate to buy a new pipe in a hardware shop. However, the not infinite precision of those operations avoid the use of computers as automatic theorem demonstration tools and so on.
</p>
<p>This kind of issue is quite common in engineer design. What engineers do is to make sure their design will work in the worst case or in most of the cases (usually more than 99.9 percent). A simple example follows.
</p>
<p>Let us say you want to repaint the walls of your living room completely messed up by your children. You need to compute how many paint cans you need to buy. The equation is quite simple:
</p><div class="display">
<pre class="display">paint cans = 2 · (room width + room length) · room height
/ (paint per can · paint efficiency),
</pre></div>
<p>where “paint efficiency” is how many square meters of surface can be painted with a liter of paint. The problem here is that usually we do not have a long enough meter to measure the room width and length. It is much simpler to count the number of steps to go through it (1 step is about a meter, let us say from 0.9 to 1.1 meters). Moreover, the paint provider usually declares a paint efficiency range.
</p>
<p>Here is the data:
</p><ul>
<li> room width = 6 steps (5.4m to 6.6m)
</li><li> room length = 4 steps (3.6m to 4.4m)
</li><li> room height = 3m (it is assumed to be correct)
</li><li> paint efficiency = from 0.7 to 1.3 square meters per liter
</li><li> paint liters per can = 40 (it is assumed to be correct)
</li></ul>
<p>To compute the average result just put average values in. We get: paint cans = 2 · (6 + 4) · 3 / (40 · 1) = 1.5, which means two paint cans unless you are able to buy just half of the second can.
</p>
<p>What happens in the worst case? Just put pessimistic values in the equation. We get: paint cans = 2 · (6.6 + 4.4) · 3 / (40 · 0.7) = 2.36. That is, in the worst case we would be short 0.36 cans of paint. It makes sense to buy 3 cans.
</p>
<p>Last, consider the best case. Is it enough to only buy a single can of paint? Just put optimistic values in the equation. We get: paint cans = 2 · (5.4 + 3.6) · 3 / (40 · 1.3) = 1.04, which means one can of paint would not be enough.
</p>
<p>You have to buy at least two cans, but probably need one more. For this result we had to go through the equation multiple times (at least twice) and carefully consider for each variable, which would be the most optimistic / pessimistic value assignment, which is not trivial. For example consider the room size versus the paint efficiency: It depends whether the highest or the lowest value takes an optimistic or pessimistic role—and this was a simple example with basic arithmetic operations.
</p>
<p>Using interval arithmetic it is possible to compute the result in a single run with ranges as inputs. The following example demonstrates this and further below is explained how it works.
</p>
<div class="example">
<pre class="example">step = midrad (1, "0.1");
w = 6 * step;
l = 4 * step;
h = 3;
eff = infsupdec ("[0.7, 1.3]");
cansize = 40;
cans = 2 * (w + l) * h / (eff * cansize)
⇒ cans ⊂ [1.0384, 2.3572]_com
</pre></div>
<div class="example">
<pre class="example">## Since we can only buy whole cans
ceil (cans)
⇒ ans = [2, 3]_def
</pre></div>
<a name="Pros-and-Cons"></a>
<h3 class="section">2.3 Pros and Cons</h3>
<p>Interval arithmetic, introduced in the 1960s, is a young and powerful technique. Its first application has been to control errors in computations and simplify error analysis for engineers (rounding errors, truncation errors, and conversion errors). The range evaluation of functions has soon been exploited for reliably checking for certain function values and for self-verifying algorithms. Latest usage scenarios comprise root finding, function approximation, and robust pattern recognition. More useful applications are certainly left to be detected.
</p>
<p>The major problem in interval arithmetic is that errors can easily build up, such that the final result is too wide to be useful. This is especially true when the <em>dependency problem</em> applies, that is, a single variable occurs several times within a computation and is represented by an interval in each occurrence. Then, the variable virtually may take different values independently, which introduces a systematic error. For example, computing <code>x .^ 2</code> will always yield a subset of <code>times (x, x)</code>, the latter considers two intervals independent of each other.
</p>
<div class="example">
<pre class="example">x = infsupdec ("[-1, 3]");
x .^ 2
⇒ ans = [0, 9]_com
times (x, x)
⇒ ans = [-3, +9]_com
</pre></div>
<p>After all, it is possible to reduce overestimation errors by subdividing the function’s domain into smaller intervals, e. g., with bisection. This technique is called “mincing”. The computational errors are proportional to the interval width and a linear convergence can be achieved.
</p>
<div class="example">
<pre class="example">x1 = infsupdec ("[-1, 1]");
x2 = infsupdec ("[1, 3]");
hull (x1 .^ 2, x2 .^ 2)
⇒ ans = [0, 9]_com
hull (times (x1, x1), times (x2, x2))
⇒ ans = [-1, +9]_com
</pre></div>
<p>However, this does not help when ranges of input values are too big. For certain applications it is better to use statistical models, where infinite domains are supported.
</p>
<a name="Theory"></a>
<h3 class="section">2.4 Theory</h3>
<p>There are good introductions to interval arithmetic available and should be consulted for a deeper understanding of the topic. The following recommendations can make a starting point.
</p><ul>
<li> <a href="http://en.wikipedia.org/wiki/Interval_arithmetic">Wikipedia sv. interval arithmetic</a>
</li><li> Introduction to Interval Analysis (2009), by Ramon E. Moore, R. Baker Kearfott, and Michael J. Cloud. Cambridge University Press. ISBN 978-0898716696.
</li><li> <a href="http://www-sop.inria.fr/coprin/logiciels/ALIAS/Examples/COURS/index.html">Introduction to the methods used in interval arithmetic (French)</a>.
</li><li> <a href="http://www.maths.manchester.ac.uk/~higham/narep/narep416.pdf">Interval analysis in MATLAB</a> Note: The INTLAB toolbox for Matlab is not entirely compatible with this interval package for GNU Octave. However, basic operations can be compared and should be compatible for common intervals.
</li><li> <a href="http://www.cs.utep.edu/interval-comp/">Interval related collection of links</a>
</li></ul>
<hr>
<a name="Examples"></a>
<div class="header">
<p>
Next: <a href="#Advanced-Topics" accesskey="n" rel="next">Advanced Topics</a>, Previous: <a href="#Introduction-to-Interval-Arithmetic" accesskey="p" rel="prev">Introduction to Interval Arithmetic</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Examples-1"></a>
<h2 class="chapter">3 Examples</h2>
<p>This chapter presents some more or less exotic use cases for the interval package.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Floating_002dpoint-Numbers" accesskey="1">Floating-point Numbers</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Root-Finding" accesskey="2">Root Finding</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Parameter-Estimation" accesskey="3">Parameter Estimation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Path-Planning" accesskey="4">Path Planning</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="Arithmetic-with-System_002dindependent-Accuracy"></a>
<h3 class="section">3.1 Arithmetic with System-independent Accuracy</h3>
<p>According to IEEE Std 754 only the most basic floating-point operations must be provided with high accuracy. This is also true for the arithmetic functions in Octave. It is no surprise that many arithmetic functions fail to provide perfect results and their output may be system dependent.
</p>
<p>We compute the cosecant for 100 different values.
</p>
<div class="example">
<pre class="example">x = vec (1 ./ magic (10));
sum (subset (csc (x), csc (infsupdec (x))))
⇒ ans = 98
</pre></div>
<p>Due to the general containment rule of interval arithmetic <code>x ∈ X ⇒ f (x) ∈ f (X)</code> one would expect the <code>csc (x)</code> to always be contained in the interval version of the cosecant for the same input. However, the classic cosecant is not very accurate whereas the interval version is. In 2 out 100 cases the built-in cosecant is less accurate than 1 ULP.
</p>
<a name="Prove-the-Existence-of-a-Fixed-Point"></a>
<h3 class="section">3.2 Prove the Existence of a Fixed Point</h3>
<p>A weaker formulation of Brower’s fixed-point theorem goes: If <var>x</var> is a bounded interval and function <var>f</var> is continuous and <var>f</var> (<var>x</var>) ⊂ <var>x</var>, then there exists a point <var>x</var>₀ ∈ <var>x</var> such that <var>f</var> (<var>x</var>₀) = <var>x</var>₀.
</p>
<p>These properties can be tested automatically. Decorated intervals can even prove that the function is continuous.
</p>
<div class="example">
<pre class="example">x = infsupdec ("[-1, +1]");
f = @cos;
subset (f (x), x)
⇒ ans = 1
iscommoninterval (x)
⇒ ans = 1
continuous = strcmp (decorationpart (f (x)), "com")
⇒ continuous = 1
</pre></div>
<p>Furthermore it is sometimes possible to approximate the fixed-point by repetitive evaluation of the function, although there are better methods to do so in general.
</p>
<div class="example">
<pre class="example">for i = 1 : 20
x = f (x);
endfor
display (x)
⇒ x ⊂ [0.73893, 0.73919]_com
</pre></div>
<table class="menu" border="0" cellspacing="0">
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">Further Examples
</pre></th></tr><tr><td align="left" valign="top">• <a href="#Floating_002dpoint-Numbers" accesskey="1">Floating-point Numbers</a>:</td><td> </td><td align="left" valign="top">Analyze properties of binary64 numbers with intervals
</td></tr>
<tr><td align="left" valign="top">• <a href="#Root-Finding" accesskey="2">Root Finding</a>:</td><td> </td><td align="left" valign="top">Find guaranteed enclosures for roots of a function
</td></tr>
<tr><td align="left" valign="top">• <a href="#Parameter-Estimation" accesskey="3">Parameter Estimation</a>:</td><td> </td><td align="left" valign="top">Examples of set inversion via interval analysis
</td></tr>
<tr><td align="left" valign="top">• <a href="#Path-Planning" accesskey="4">Path Planning</a>:</td><td> </td><td align="left" valign="top">Find a feasible path between two points
</td></tr>
</table>
<hr>
<a name="Floating_002dpoint-Numbers"></a>
<div class="header">
<p>
Next: <a href="#Root-Finding" accesskey="n" rel="next">Root Finding</a>, Up: <a href="#Examples" accesskey="u" rel="up">Examples</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Floating_002dpoint-Numbers-1"></a>
<h3 class="section">3.3 Floating-point Numbers</h3>
<p>Floating-point numbers are most commonly used in binary64 format, a.k.a. double precision. Internally they are stored in the form <code>± <var>m</var> * 2 ^ <var>e</var></code> with some integral mantissa <var>m</var> and exponent <var>e</var>. Most decimal fractions can only be stored approximately in this format.
</p>
<p>The <a href="https://octave.sourceforge.io/interval/function/@infsup/intervaltotext.html">@infsup/intervaltotext</a> function can be used to output the approximate value up to the last decimal digit.
</p>
<div class="example">
<pre class="example">intervaltotext (infsup (0.1), "exact decimal")
⇒ ans = [0.1000000000000000055511151231257827021181583404541015625]
</pre></div>
<p>It can be seen that 0.1 is converted into the most accurate floating-point number. In this case that value is greater than 0.1. The next lower value can be seen after producing an interval enclosure around 0.1 with the nearest floating-point numbers in each direction.
</p>
<div class="example">
<pre class="example">intervaltotext (infsup ("0.1"), "exact decimal")
⇒ ans =
[0.09999999999999999167332731531132594682276248931884765625,
0.1000000000000000055511151231257827021181583404541015625]
</pre></div>
<p>The error of this approximation can be examined with the <a href="https://octave.sourceforge.io/interval/function/@infsup/wid.html">@infsup/wid</a> function.
</p>
<div class="example">
<pre class="example">wid (infsup ("0.1"))
⇒ ans = 1.3878e-17
</pre></div>
<p>With the <a href="https://octave.sourceforge.io/interval/function/@infsup/nextout.html">@infsup/nextout</a> function an interval can be enlarged in each direction up to the next floating-point number. Around zero the distance towards the next floating point number is very small, but gets bigger for numbers of higher magnitude.
</p>
<div class="example">
<pre class="example">wid (nextout (infsup ([0, 1, 1e10, 1e100])))
⇒ ans =
9.8813e-324 3.3307e-16 3.8147e-06 3.8853e+84
</pre></div>
<hr>
<a name="Root-Finding"></a>
<div class="header">
<p>
Next: <a href="#Parameter-Estimation" accesskey="n" rel="next">Parameter Estimation</a>, Previous: <a href="#Floating_002dpoint-Numbers" accesskey="p" rel="prev">Floating-point Numbers</a>, Up: <a href="#Examples" accesskey="u" rel="up">Examples</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Root-Finding-1"></a>
<h3 class="section">3.4 Root Finding</h3>
<a name="Interval-Newton-Method"></a>
<h4 class="subsection">3.4.1 Interval Newton Method</h4>
<p>In numerical analysis, <a href="https://en.wikipedia.org/wiki/Newton%27s_method">Newton’s method</a> can find an approximation to a root of a function. Starting at a location <var>x</var>₀ the algorithms executes the following step to produce a better approximation:
</p>
<div class="display">
<pre class="display"><var>x</var>₁ = <var>x</var>₀ - <var>f</var> (<var>x</var>₀) / <var>f</var>’ (<var>x</var>₀)
</pre></div>
<p>The step can be interpreted geometrically as an intersection of the graph’s tangent with the x-axis. Eventually, this may converge to a single root. In interval analysis, we start with an interval <var>x</var>₀ and utilize the following interval Newton step:
</p>
<div class="display">
<pre class="display"><var>x</var>₁ = (mid (<var>x</var>₀) - <var>f</var> (mid (<var>x</var>₀)) / <var>f</var>’ (<var>x</var>₀)) ∩ <var>x</var>₀
</pre></div>
<p>Here we use the pivot element <code>mid (<var>x</var>₀)</code> and produce an enclosure of all possible tangents with the x-axis. In special cases the division with <code><var>f</var>' (<var>x</var>₀)</code> yields two intervals and the algorithm bisects the search range. Eventually this algorithm produces enclosures for all possible roots of the function <var>f</var> in the interval <var>x</var>₀. The interval newton method is implemented by the function <a href="https://octave.sourceforge.io/interval/function/@infsup/fzero.html">@infsup/fzero</a>.
</p>
<p>To produce the derivative of function <var>f</var>, the automatic differentiation from the symbolic package bears a helping hand. However, be careful since this may introduce numeric errors with coefficients.
</p>
<div class="example">
<pre class="example">f = @(x) sqrt (x) + (x + 1) .* cos (x);
</pre><pre class="example">pkg load symbolic
df = function_handle (diff (formula (f (sym ("x")))))
⇒ df =
@(x) -(x + 1) .* sin (x) + cos (x) + 1 ./ (2 * sqrt (x))
</pre><pre class="example">fzero (f, infsup ("[0, 6]"), df)
⇒ ans ⊂ 2×1 interval vector
[2.059, 2.0591]
[4.3107, 4.3108]
</pre></div>
<p>We could find two roots in the interval [0, 6].
</p>
<a name="Bisection"></a>
<h4 class="subsection">3.4.2 Bisection</h4>
<p>Consider the function <code>f (<var>x</var>, <var>y</var>) = -(5*<var>y</var> - 20*<var>y</var>^3 + 16*<var>y</var>^5)^6 + (-(5*<var>x</var> - 20*<var>x</var>^3 + 16*<var>x</var>^5)^3 + 5*<var>y</var> - 20*<var>y</var>^3 + 16*<var>y</var>^5)^2</code>, which has several roots in the area <var>x</var>, <var>y</var> ∈ [-1, 1].
</p>
<img border="0" src="image/poly-example-surf.m.png" alt="Surface plot of <code>f (<var>x</var>, <var>y</var>)</code> which shows a lot of roots for the function" />
<p>The function is particular difficult to compute with intervals, because its variables appear several times in the expression, which benefits overestimation from the dependency problem. Computing root enclosures with the <a href="https://octave.sourceforge.io/interval/function/@infsup/fsolve.html">@infsup/fsolve</a> function is unfeasible, because many bisections would be necessary until the algorithm terminates with a useful result. It is possible to reduce the overestimation with the <a href="https://octave.sourceforge.io/interval/function/@infsup/polyval.html">@infsup/polyval</a> function to some degree, but since this function is quite costly to compute, it does not speed up the bisecting algorithm.
</p>
<div class="example">
<pre class="example">f = @(x,y) ...
-(5.*y - 20.*y.^3 + 16.*y.^5).^6 + ...
(-(5.*x - 20.*x.^3 + 16.*x.^5).^3 + ...
5.*y - 20.*y.^3 + 16.*y.^5).^2;
X = Y = infsup ("[-1, 1]");
has_roots = n = 1;
</pre><pre class="example">for iter = 1 : 10
## Bisect
[i,j] = ind2sub ([n,n], has_roots);
X = infsup ([X.inf,X.inf,X.mid,X.mid],[X.mid,X.mid,X.sup,X.sup]);
Y = infsup ([Y.inf,Y.mid,Y.inf,Y.mid],[Y.mid,Y.sup,Y.mid,Y.sup]);
ii = [2*(i-1)+1,2*(i-1)+2,2*(i-1)+1,2*(i-1)+2] ;
jj = [2*(j-1)+1,2*(j-1)+1,2*(j-1)+2,2*(j-1)+2] ;
has_roots = sub2ind ([2*n,2*n], ii, jj);
n *= 2;
## Check if function value covers zero
fval = f (X, Y);
zero_contained = find (ismember (0, fval));
## Discard values without roots
has_roots = has_roots(zero_contained);
X = X(zero_contained);
Y = Y(zero_contained);
endfor
</pre><pre class="example">colormap gray
B = false (n);
B(has_roots) = true;
imagesc (B)
axis equal
axis off
</pre></div>
<img border="0" src="image/poly-example-roots-simple.m.png" alt="Enclosures of roots for the function <code>f (<var>x</var>, <var>y</var>)</code>" />
<p>Now we use the same algorithm with the same number of iterations, but also utilize the <em>mean value theorem</em> to produce better enclosures of the function value with first order approximation of the function. The function is evaluated at the interval’s midpoint and a range evaluation of the derivative can be used to produce an enclosure of possible function values.
</p>
<div class="example">
<pre class="example">f_dx = @(x,y) ...
-6.*(5 - 60.*x.^2 + 80.*x.^4) .* ...
(5.*x - 20.*x.^3 + 16.*x.^5).^2 .* ...
(-(5.*x - 20.*x.^3 + 16.*x.^5).^3 + ...
5.*y - 20.*y.^3 + 16.*y.^5);
f_dy = @(x,y) ...
-6.*(5 - 60.*y.^2 + 80.*y.^4) .* ...
(5.*y - 20.*y.^3 + 16.*y.^5).^5 + ...
2.*(5 - 60.*y.^2 + 80.*y.^4) .* ...
(-(5.*x - 20.*x.^3 + 16.*x.^5).^3 + ...
5.*y - 20.*y.^3 + 16.*y.^5);
</pre><pre class="example">for iter = 1 : 10
…
## Check if function value covers zero
fval1 = f (X, Y);
fval2 = f (mid (X), mid (Y)) + ...
(X - mid (X)) .* f_dx (X, Y) + ...
(Y - mid (Y)) .* f_dy (X, Y);
fval = intersect (fval1, fval2);
…
endfor
</pre></div>
<p>By using the derivative, it is possible to reduce overestimation errors and achieve a much better convergence behavior.
</p>
<img border="0" src="image/poly-example-roots-with-deriv.m.png" alt="Enclosures of roots for the function <code>f (<var>x</var>, <var>y</var>)</code>" />
<hr>
<a name="Parameter-Estimation"></a>
<div class="header">
<p>
Next: <a href="#Path-Planning" accesskey="n" rel="next">Path Planning</a>, Previous: <a href="#Root-Finding" accesskey="p" rel="prev">Root Finding</a>, Up: <a href="#Examples" accesskey="u" rel="up">Examples</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Parameter-Estimation-1"></a>
<h3 class="section">3.5 Parameter Estimation</h3>
<a name="Small-Search-Space"></a>
<h4 class="subsection">3.5.1 Small Search Space</h4>
<p>Consider the model <code>y (<var>t</var>) = <var>p1</var> * exp (<var>p2</var> * t)</code>. The parameters <var>p1</var> and <var>p2</var> are unknown, but it is known that the model fulfills the following constraints, which have been obtained using measurements with known error bounds.
</p>
<div class="display">
<pre class="verbatim">p1, p2 ∈ [-3, 3]
y (0.2) ∈ [1.5, 2]
y (1) ∈ [0.7, 0.8]
y (2) ∈ [0.1, 0.3]
y (4) ∈ [-0.1, 0.03]
</pre></div>
<p>A better enclosure of the parameters <var>p1</var> and <var>p2</var> can be estimated with the <a href="https://octave.sourceforge.io/interval/function/@infsup/fsolve.html">@infsup/fsolve</a> function.
</p>
<div class="example">
<pre class="example">## Model
y = @(p1, p2, t) p1 .* exp (p2 .* t);
## Observations / Constraints
t = [0.2; 1; 2; 4];
y_t = infsup ("[1.5, 2]; [0.7, 0.8]; [0.1, 0.3]; [-0.1, 0.03]");
## Estimate parameters
f = @(p1, p2) y (p1, p2, t);
p = fsolve (f, infsup ("[-3, 3]; [-3, 3]"), y_t)
⇒ p ⊂ 2×1 interval vector
[1.9863, 2.6075]
[-1.3243, -1.0429]
</pre></div>
<p>The resulting <code>p</code> guarantees to contain all parameters <code>[<var>p1</var>; <var>p2</var>]</code> which satisfy all constraints on <var>y</var>. It is no surprise that <code>f (p)</code> intersects the constraints for <var>y</var>.
</p>
<div class="example">
<pre class="example">f (p(1), p(2))
⇒ ans ⊂ 4×1 interval vector
[1.5241, 2.1166]
[0.52838, 0.91888]
[0.14055, 0.32382]
[0.0099459, 0.040216]
</pre></div>
<a name="Larger-Search-Space"></a>
<h4 class="subsection">3.5.2 Larger Search Space</h4>
<p>Consider the function <code>f (x) = <var>p1</var> ^ x * (<var>p2</var> + <var>p3</var> * x + <var>p4</var> * x^2)</code>. Let’s say we have some known function values (measurements) and want to find matching parameters <var>p1</var> through <var>p4</var>. The data sets (<var>x</var>, <var>y</var>) can be simulated. The parameters shall be reconstructed from the observed values on the search range <var>p</var>.
</p>
<p>Using plain <a href="https://octave.sourceforge.io/interval/function/@infsup/fsolve.html">@infsup/fsolve</a> would take considerably longer, because the search range has 4 dimensions. Bisecting intervals requires an exponential number of steps and can easily become inefficient. Thus we use a contractor for function <var>f</var>, which in addition to the function value can produce a refinement for its parameter constraints. Contractors can easily be build using interval reverse operations like <a href="https://octave.sourceforge.io/interval/function/@infsup/mulrev.html">@infsup/mulrev</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/sqrrev.html">@infsup/sqrrev</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/powrev1.html">@infsup/powrev1</a>, etc.
</p>
<div class="example">
<pre class="example">## Simulate some data sets and add uncertainty
x = -6 : 3 : 18;
f = @(p1, p2, p3, p4) ...
p1 .^ x .* (p2 + p3 .* x + p4 .* x .^ 2);
y = f (1.5, 1, -3, 0.5) .* infsup ("[0.999, 1.001]");
</pre><pre class="example">function [fval, p1, p2, p3, p4] = ...
contractor (y, p1, p2, p3, p4)
x = -6 : 3 : 18;
## Forward evaluation
a = p1 .^ x;
b = p3 .* x;
c = p2 + b;
d = p4 .* x .^ 2;
e = c + d;
fval = a .* e;
## Reverse evaluation and
## undo broadcasting of x
y = intersect (y, fval);
a = mulrev (e, y, a);
e = mulrev (a, y, e);
p1 = powrev1 (x, a, p1);
p1 = intersect (p1, [], 2);
c = intersect (c, e - d);
d = intersect (d, e - c);
p2 = intersect (p2, c - b);
p2 = intersect (p2, [], 2);
b = intersect (b, c - p2);
p3 = mulrev (x, b, p3);
p3 = intersect (p3, [], 2);
p4 = mulrev (x .^ 2, d, p4);
p4 = intersect (p4, [], 2);
endfunction
</pre></div>
<p>Now, search for solutions in the range of <code>p</code> and try to restore the function parameters.
</p>
<div class="example">
<pre class="example">p = infsup ("[1.1, 2] [1, 5] [-5, -1] [0.1, 5]");
p = fsolve (@contractor, ...
p, y, ...
struct ("Contract", true))'
⇒ p ⊂ 4×1 interval vector
[1.4991, 1.5009]
[1, 1.0011]
[-3.0117, -2.9915]
[0.49772, 0.50578]
</pre></div>
<p>The function parameters 1.5, 1, -3, and 0.5 from above could be restored. The contractor function could significantly improve the convergence speed of the algorithm.
</p>
<a name="Combination-of-Functions"></a>
<h4 class="subsection">3.5.3 Combination of Functions</h4>
<p>Sometimes it is hard to express the search range in terms of a single function and its constraints, when the preimage of the function consists of a union or intersection of different parts. Several contractor functions can be combined using <a href="https://octave.sourceforge.io/interval/function/ctc_union.html">ctc_union</a> or <a href="https://octave.sourceforge.io/interval/function/ctc_intersect.html">ctc_intersect</a> to make a contractor function for more complicated sets. The combined contractor function allows one to solve for more complicated sets in a single step.
</p>
<div class="example">
<pre class="example">## General ring contractor
function [fval, cx1, cx2] = ctc_ring (y, c1, c2, x1, x2)
## Forward evaluation
x1_c1 = x1 - c1;
x2_c2 = x2 - c2;
sqr_x1_c1 = x1_c1 .^ 2;
sqr_x2_c2 = x2_c2 .^ 2;
fval = hypot (x1_c1, x2_c2);
## Reverse evaluation
y = intersect (y, fval);
sqr_y = y .^ 2;
sqr_x1_c1 = intersect (sqr_x1_c1, sqr_y - sqr_x2_c2);
sqr_x2_c2 = intersect (sqr_x2_c2, sqr_y - sqr_x1_c1);
x1_c1 = sqrrev (sqr_x1_c1, x1_c1);
x2_c2 = sqrrev (sqr_x2_c2, x2_c2);
cx1 = intersect (x1, x1_c1 + c1);
cx2 = intersect (x2, x2_c2 + c2);
endfunction
</pre><pre class="example">## Ring 1 with center at (1, 3)
## Ring 2 with center at (2, -1)
ctc_ring1 = @(y, x1, x2) ctc_ring (y, 1, 3, x1, x2);
ctc_ring2 = @(y, x1, x2) ctc_ring (y, 2, -1, x1, x2);
</pre><pre class="example">## Unite ring 1 with radius 3..4 and ring 2 with radius 5..6
ctc_union_of_rings = ctc_union (ctc_ring1, "[3, 4]", ...
ctc_ring2, "[5, 6]");
</pre><pre class="example">## Compute a paving to approximate the union of rings
## in the area x, y = -10..10
[~, paving] = fsolve (ctc_union_of_rings, ...
infsup ("[-10, 10] [-10, 10]"), ...
struct ("Contract", true));
plot (paving(1, :), paving(2, :))
axis equal
</pre></div>
<img border="0" src="image/contractor-rings-union.m.png" alt="Set inversion for two rings" />
<p>Intersections of contractor functions are especially useful to apply several constraints at once. For example, when it is known that a particular location has a distance of <var>a</var> ∈ [3, 4] from object A, located at coordinates (1, 3), and a distance of <var>b</var> ∈ [5, 6] from object B, located at coordinates (2, -1), the intersection of both rings yields all possible locations in the search range. The combined contractor function enables fast convergence of the search algorithm.
</p>
<div class="example">
<pre class="example">## Intersect ring 1 with radius 3..4 and ring 2 with radius 5..6
ctc_intersection_of_rings = ctc_intersect (ctc_ring1, "[3, 4]", ...
ctc_ring2, "[5, 6]");
</pre><pre class="example">## Compute a paving to approximate the intersection of rings
## in the area x, y = -10..10
[~, paving] = fsolve (ctc_intersection_of_rings, ...
infsup ("[-10, 10] [-10, 10]"), ...
struct ("Contract", true));
plot (paving(1, :), paving(2, :))
axis equal
</pre></div>
<img border="0" src="image/contractor-rings-intersect.m.png" alt="Set inversion for intersection of two rings" />
<hr>
<a name="Path-Planning"></a>
<div class="header">
<p>
Previous: <a href="#Parameter-Estimation" accesskey="p" rel="prev">Parameter Estimation</a>, Up: <a href="#Examples" accesskey="u" rel="up">Examples</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Path-Planning-1"></a>
<h3 class="section">3.6 Path Planning</h3>
<div class="float"><a name="cameleon_002dproblem"></a>
<img border="0" src="image/cameleon-start-end.svg.png" alt="Cameleon Problem: Start and End Position" />
<div class="float-caption"><p><strong>Figure 3.1: </strong>Cameleon Problem: The polygon has to be moved from the left to the right without touching any obstacles along the path.</p></div></div>
<p>The problem presented here is a simplified version from the paper L. Jaulin (2001). <a href="https://www.ensta-bretagne.fr/jaulin/cameleon.html">Path planning using intervals and graphs.</a> Reliable Computing, issue 1, volume 7, 1–15.
</p>
<p>There is an object, a simple polygon in this case, which shall be moved from a starting position to a specified target position. Along the way there are obstacles which may not be touched by the polygon. The polygon can be moved in one direction (left to right or right to left) and may be rotated around its lower left corner.
</p>
<p>This makes a two dimensional parameter space and any feasible positions can be determined using interval arithmetic like in the examples above.
</p>
<p>Then we use a simple path planning algorithm: We move along the centers of adjacent and feasible boxes in the parameter space until we have a closed path from the start position to the end position. The path is guaranteed to be feasible, that is, there will be no collisions if we follow the path.
</p>
<div class="example">
<pre class="example"># We can build the simple polygon from interval boxes
global polygon_x = ...
infsup ("[18,20] [0,20] [0, 2] [ 0,14] [12,14] [10,14]")';
global polygon_y = ...
infsup ("[ 0,18] [0, 2] [0,14] [12,14] [ 6,14] [ 6, 8]")';
global obstacle_x = infsup ("[ 8,11] [25,28]");
global obstacle_y = infsup ("[10,10] [10,10]");
color_feasible = [238 232 213] ./ 255;
color_path = [133 153 0] ./ 255;
</pre><pre class="example">function feasible = check_collision (obstacle_x, obstacle_y)
global polygon_x;
global polygon_y;
feasible = infsup (zeros (size (obstacle_x)), ...
ones (size (obstacle_x)));
# Check if the obstacle is inside the polygon
inside = any (...
subset (obstacle_x, polygon_x) & subset (obstacle_y, polygon_y));
feasible(inside) = 0;
# Check if the obstacle is outside the polygon
outside = all (...
disjoint (obstacle_x, polygon_x) | ...
disjoint (obstacle_y, polygon_y));
feasible(outside) = 1;
endfunction
</pre><pre class="example">function feasible = check_parameters (x_offset, angle)
global obstacle_x;
global obstacle_y;
# Instead of rotating the polygon, we rotate the obstacles (reverse)
s = sin (-angle);
c = cos (-angle);
f_x = @(x, y) (x - x_offset) .* c - y .* s;
f_y = @(x, y) (x - x_offset) .* s + y .* c;
# All obstacles must be considered
feasible = 1;
for i = 1 : numel (obstacle_x)
feasible = min (feasible, ...
check_collision (f_x (obstacle_x(i), obstacle_y(i)), ...
f_y (obstacle_x(i), obstacle_y(i))));
endfor
endfunction
</pre><pre class="example"># Compute a paving of feasible polygon states
[x, paving, inner] = fsolve (...
@check_parameters, ...
infsup ("[-28, 57] [-1.4, 2.7]"), ...
1, ...
struct ('MaxIter', 21, 'TolX', 0.03));
hold on
plot (paving(1, inner), paving(2, inner), color_feasible);
# Consider only states that are guaranteed to be feasible
paving = paving (:, inner);
</pre><pre class="example"># Path search
start_idx = find (all (ismember ([0; 0], paving)), 1);
end_idx = find (all (ismember ([17; 0], paving)), 1);
adjacency = not (disjoint (paving(1, :), transpose (paving(1, :))) | ...
disjoint (paving(2, :), transpose (paving(2, :))));
# Do a Dijkstra search until we reach end_idx
distance = inf (columns (paving), 1); # nan = visited
previous = zeros (columns (paving), 1);
distance(start_idx) = 0;
while (not (isnan (distance(end_idx))))
[pivot_distance, pivot_idx] = min (distance);
visited = isnan (distance);
neighbors_idx = adjacency(:, pivot_idx) & not (visited);
if (not (any (neighbors_idx)))
error ("Cannot reach target location")
endif
neighbors_distance = subsasgn (...
distance, ...
substruct ("()", {neighbors_idx}), ...
pivot_distance + hypot (...
# Compute distance between centers of boxes
mid (paving(1, pivot_idx)) - mid (paving(1, neighbors_idx)), ...
mid (paving(2, pivot_idx)) - mid (paving(2, neighbors_idx))));
shorter_path = neighbors_idx & (neighbors_distance < distance);
previous(shorter_path) = pivot_idx;
distance(shorter_path) = neighbors_distance(shorter_path);
distance(pivot_idx) = nan;
endwhile
</pre><pre class="example"># Plot the path to the target location
last_idx = end_idx;
while (last_idx != start_idx)
next_idx = previous(last_idx);
x1 = mid (paving(1, last_idx));
y1 = mid (paving(2, last_idx));
x2 = mid (paving(1, next_idx));
y2 = mid (paving(2, next_idx));
plot ([x1 x2], [y1 y2], 'linewidth', 2, 'color', color_path);
last_idx = next_idx;
endwhile
</pre></div>
<p>The script visualizes the solution in the parameter space. Unfeasible or uncertain combinations of parameters are white. The algorithm’s accuracy is just good enough to find a closed path, which is drawn in green color. The uncertain area is quite big because we have used a very simple check for verification whether the polygon overlaps the obstacles. This could be improved.
</p>
<img border="0" src="image/cameleon.m.png" alt="Computed feasible path in parameter space" />
<p>The solution is not optimal, please refer to Luc Jaulin’s paper for more sophisticated approaches. However, we could find a valid solution that moves the polygon as desired without touching any obstacles.
</p>
<div class="float"><a name="cameleon_002dsolution"></a>
<object data="image/cameleon-animation.svg" type="image/svg+xml">
<param name="src" value="image/cameleon-animation.svg" />
<img border="0" src="image/cameleon-transition.svg.png" alt="Cameleon Problem: Transition from Start to End Position" />
</object>
<div class="float-caption"><p><strong>Figure 3.2: </strong>Cameleon Problem: A possible solution which moves the polygon from the left to the right without touching obstacles.</p></div></div>
<hr>
<a name="Advanced-Topics"></a>
<div class="header">
<p>
Next: <a href="#IEEE-Std-1788_002d2015" accesskey="n" rel="next">IEEE Std 1788-2015</a>, Previous: <a href="#Examples" accesskey="p" rel="prev">Examples</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Advanced-Topics-1"></a>
<h2 class="chapter">4 Advanced Topics</h2>
<a name="Error-Handling"></a>
<h3 class="section">4.1 Error Handling</h3>
<p>Due to the nature of set-based interval arithmetic, one should not observe errors (in the sense of raised GNU Octave error messages) during computation unless operations are evaluated for incompatible data types. Arithmetic operations which are not defined for (parts of) their input, simply ignore anything that is outside of their domain.
</p>
<p>However, the interval constructors can produce warnings depending on the input. The <a href="https://octave.sourceforge.io/interval/function/@infsup/infsup.html">@infsup/infsup</a> constructor will warn if the interval boundaries are invalid and returns empty intervals in these cases. Contrariwise, the (preferred) <a href="https://octave.sourceforge.io/interval/function/@infsupdec/infsupdec.html">@infsupdec/infsupdec</a>, <a href="https://octave.sourceforge.io/interval/function/midrad.html">midrad</a> and <a href="https://octave.sourceforge.io/interval/function/hull.html">hull</a> constructors will only issue a warning and return [NaI] objects, which will propagate and survive through computations. NaI stands for “not an interval”.
</p>
<p>Effects of set-based interval arithmetic on partial functions and the NaI object
</p><div class="example">
<pre class="example">## Evaluation of a function outside of its domain
## returns an empty interval
infsupdec (2) / 0
⇒ ans = [Empty]_trv
infsupdec (0) ^ infsupdec (0)
⇒ ans = [Empty]_trv
</pre></div>
<div class="example">
<pre class="example">## Illegal interval construction creates a NaI
infsupdec (3, 2)
-| warning: illegal interval boundaries:
-| infimum greater than supremum
⇒ ans = [NaI]
</pre></div>
<div class="example">
<pre class="example">## NaI even survives through computations
ans + 1
⇒ ans = [NaI]
</pre></div>
<p>There are some situations where the interval package cannot decide whether an error occurred or not and issues a warning. The user may choose to ignore these warnings or handle them as errors, see <code>help warning</code> for instructions.
</p>
<div class="float"><a name="tab_003awarnings"></a>
<dl compact="compact">
<dt><samp>interval:PossiblyUndefined</samp></dt>
<dd><dl compact="compact">
<dt>Reason</dt>
<dd><p>Interval construction with boundaries in decimal format, and the constructor can’t decide whether the lower boundary is smaller than the upper boundary. Both boundaries are very close and lie between subsequent binary64 numbers.
</p>
</dd>
<dt>Possible consequences</dt>
<dd><p>The constructed interval is a valid and tight enclosure of both numbers. If the lower boundary was actually greater than the upper boundary, this illegal interval is not considered an error.
</p>
</dd>
</dl>
</dd>
<dt><samp>interval:ImplicitPromote</samp></dt>
<dd><dl compact="compact">
<dt>Reason</dt>
<dd><p>An interval operation has been evaluated on both, a bare and a decorated interval. The bare interval has been converted into a decorated interval in order to produce a decorated result. Note: This warning does not occur if a bare interval literal string gets promoted into a decorated interval, e. g., <code>infsupdec (1, 2) + "[3, 4]"</code> does not produce this warning whereas <code>infsupdec (1, 2) + infsup (3, 4)</code> does. A bare interval can be explicitly promoted with the <a href="https://octave.sourceforge.io/interval/function/@infsup/newdec.html">@infsup/newdec</a> function.
</p>
</dd>
<dt>Possible consequences</dt>
<dd><p>The implicit conversion applies the best possible decoration for the bare interval. If the bare interval has been produced from an interval arithmetic computation, this branch of computation is not covered by the decoration information and the final decoration could be considered wrong. For example, <code>infsupdec (1, 2) + infsup (0, 1) ^ 0</code> would ignore that 0^0 is undefined.
</p>
</dd>
</dl>
</dd>
<dt><samp>interval:UndefinedOperation</samp></dt>
<dd><dl compact="compact">
<dt>Reason</dt>
<dd><p>An error has occurred during interval construction and the NaI object has been produced (an empty interval in case of the bare interval constructor). The warning text contains further details. A NaI can be explicitly created with the <a href="https://octave.sourceforge.io/interval/function/nai.html">nai</a> function.
</p>
</dd>
<dt>Possible consequences</dt>
<dd><p>Nothing bad is going to happen, because the semantics of NaI and empty intervals are well defined by IEEE Std 1788-2015. However, the user might choose to cancel the algorithm immediately when the NaI is encountered for the first time.
</p>
</dd>
</dl>
</dd>
</dl>
<div class="float-caption"><p><strong>Table 4.1: </strong>Warning IDs</p></div></div>
<a name="Decorations"></a>
<h3 class="section">4.2 Decorations</h3>
<p>The interval package provides a powerful decoration system for intervals, as specified by IEEE Std 1788-2015, IEEE standard for interval arithmetic. By default any interval carries a decoration, which collects additional information about the course of function evaluation on the interval data.
</p>
<p>Only the (unfavored) <a href="https://octave.sourceforge.io/interval/function/@infsup/infsup.html">@infsup/infsup</a> constructor creates bare, undecorated intervals and the <a href="https://octave.sourceforge.io/interval/function/@infsupdec/intervalpart.html">@infsupdec/intervalpart</a> operation may be used to demote decorated intervals into bare, undecorated ones. It is highly recommended to always use the decorated interval arithmetic, which gives additional information about an interval result in exchange for a tiny overhead.
</p>
<p>The following decorations are available:
</p>
<div class="float">
<table>
<thead><tr><th>Decoration</th><th>Bounded</th><th>Continuous</th><th>Defined</th><th>Definition</th></tr></thead>
<tr><td>com (common)</td><td>✓</td><td>✓</td><td>✓</td><td>x is a bounded, nonempty subset of Dom(f); f is continuous at each point of x; and the computed interval f(x) is bounded</td></tr>
<tr><td>dac (defined and continuous)</td><td></td><td>✓</td><td>✓</td><td>x is a nonempty subset of Dom(f); and the restriction of f to x is continuous</td></tr>
<tr><td>def (defined)</td><td></td><td></td><td>✓</td><td>x is a nonempty subset of Dom(f)</td></tr>
<tr><td>trv (trivial)</td><td></td><td></td><td></td><td>always true<br>(so gives no information)</td></tr>
<tr><td>ill (ill-formed)</td><td></td><td></td><td></td><td>Not an interval, at least one interval constructor failed during the course of computation</td></tr>
</table>
</div>
<p>The decoration information is especially useful after a very long and complicated function evaluation. For example, when the “def” decoration survives until the final result, it is proven that the overall function is actually defined for all values covered by the input intervals.
</p>
<p>Examples of using the decoration system
</p><div class="example">
<pre class="example">x = infsupdec (3, 4)
⇒ x = [3, 4]_com
y = x - 3.5
⇒ y = [-0.5, +0.5]_com
</pre></div>
<div class="example">
<pre class="example">## The square root function ignores any negative part of the input,
## but the decoration indicates whether this has or has not happened.
sqrt (x)
⇒ ans ⊂ [1.732, 2]_com
sqrt (y)
⇒ ans ⊂ [0, 0.70711]_trv
</pre></div>
<p>Please note that decoration information will not survive through reverse operations (see below) and set operations.
</p>
<a name="Specialized-interval-constructors"></a>
<h3 class="section">4.3 Specialized interval constructors</h3>
<p>Above mentioned interval construction with decimal numbers or numeric data is straightforward. Beyond that, there are more ways to define intervals or interval boundaries.
</p>
<ul>
<li> Hexadecimal-floating-constant form: Each interval boundary may be defined by a hexadecimal number (optionally containing a point) and an exponent field with an integral power of two as defined by the C99 standard <a href="http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf">ISO/IEC9899, N1256, §6.4.4.2</a>. This can be used as a convenient way to define interval boundaries in binary64 precision, because the hexadecimal form is much shorter than the decimal representation of many numbers.
</li><li> Rational literals: Each interval boundary may be defined as a fraction of two decimal numbers. This is especially useful if interval boundaries shall be tightest enclosures of fractions, that would be hard to write down as a decimal number.
</li><li> Uncertain form: The interval as a whole can be defined by a midpoint or upper/lower boundary and an integral number of <a href="http://en.wikipedia.org/wiki/Unit_in_the_last_place">“units in last place” (ULPs)</a> as an uncertainty. The format is <code>m?ruE</code>, where
<dl compact="compact">
<dt><code>m</code></dt>
<dd><p>is a mantissa in decimal,
</p></dd>
<dt><code>r</code></dt>
<dd><p>is either empty (which means ½ ULP) or is a non-negative decimal integral ULP count or is the <samp>?</samp> character (for unbounded intervals),
</p></dd>
<dt><code>u</code></dt>
<dd><p>is either empty (symmetrical uncertainty of r ULPs in both directions) or is either <samp>u</samp> (up) or <samp>d</samp> (down),
</p></dd>
<dt><code>E</code></dt>
<dd><p>is either empty or an exponent field comprising the character <code>e</code> followed by a decimal integer exponent (base 10).
</p></dd>
</dl>
</li></ul>
<p>Examples of different formats during interval construction
</p><div class="example">
<pre class="example">infsupdec ("0x1.999999999999Ap-4") # hex-form
⇒ ans ⊂ [0.1, 0.10001]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("1/3", "7/9") # rational form
⇒ ans ⊂ [0.33333, 0.77778]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("121.2?") # uncertain form
⇒ ans ⊂ [121.14, 121.25]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("5?32e2") # uncertain form with ulp count
⇒ ans = [-2700, +3700]_com
</pre></div>
<div class="example">
<pre class="example">infsupdec ("-42??u") # unbound uncertain form
⇒ ans = [-42, +Inf]_dac
</pre></div>
<p>The hex-form can be set for output with the <code>format hex</code> command.
</p>
<a name="Reverse-Arithmetic-Operations"></a>
<h3 class="section">4.4 Reverse Arithmetic Operations</h3>
<p>Some arithmetic functions also provide reverse mode operations. That is inverse functions with interval constraints. For example the <a href="https://octave.sourceforge.io/interval/function/@infsup/sqrrev.html">@infsup/sqrrev</a> function can compute the inverse of the <code><var>x</var> .^ 2</code> function on intervals. The syntax is <code>sqrrev (<var>C</var>, <var>X</var>)</code> and will compute the enclosure of all numbers x ∈ <var>X</var> that fulfill the constraint x² ∈ <var>C</var>.
</p>
<p>In the following example, we compute the constraints for base and exponent of the power function pow as shown in the figure.
</p>
<div class="float"><a name="reverse"></a>
<img border="0" src="image/inverse-power.svg.png" alt="Reverse Power Functions" />
<div class="float-caption"><p><strong>Figure 4.1: </strong>Reverse power operations. A relevant subset of the function’s domain is outlined and hatched. In this example we use x^y ∈ [2, 3].</p></div></div>
<div class="example">
<pre class="example">x = powrev1 (infsupdec ("[1.1, 1.45]"), infsupdec (2, 3))
⇒ x ⊂ [1.6128, 2.7149]_trv
y = powrev2 (infsupdec ("[2.14, 2.5]"), infsupdec (2, 3))
⇒ y ⊂ [0.75647, 1.4441]_trv
</pre></div>
<a name="Tips-and-Tricks"></a>
<h3 class="section">4.5 Tips and Tricks</h3>
<p>For convenience it is possible to implicitly call the interval constructor during all interval operations if at least one input already is an interval object.
</p>
<div class="example">
<pre class="example">infsupdec ("17.7") + 1
⇒ ans ⊂ [18.699, 18.701]_com
ans + "[0, 2]"
⇒ ans ⊂ [18.699, 20.701]_com
</pre></div>
<p>Interval functions with only one argument can be called by using property syntax, e. g. <code>x.inf</code>, <code>x.sup</code> or even <code>x.sqrt</code>.
</p>
<p>Whilst most functions (<a href="https://octave.sourceforge.io/interval/function/@infsup/size.html">@infsup/size</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/isvector.html">@infsup/isvector</a>, <a href="https://octave.sourceforge.io/interval/function/@infsup/ismatrix.html">@infsup/ismatrix</a>, …) work as expected on interval data types, the function <a href="https://octave.sourceforge.io/interval/function/@infsup/isempty.html">@infsup/isempty</a> is evaluated element-wise and checks if an interval equals the empty set.
</p>
<div class="example">
<pre class="example">builtin ("isempty", empty ())
⇒ ans = 0
isempty (empty ())
⇒ ans = 1
</pre></div>
<a name="Validation"></a>
<h3 class="section">4.6 Validation</h3>
<p>The interval package contains an extensive test suite, which can be run with the command <code>__run_test_suite__ ({pkg("list", "interval"){}.dir}, {})</code> to verify correct functionality for a particular system.
</p>
<p>In addition, examples from the package documentation can be verified using the doctest package:
</p>
<div class="example">
<pre class="example">pkg load doctest
doctest (pkg ("list", "interval"){}.dir)
</pre></div>
<hr>
<a name="IEEE-Std-1788_002d2015"></a>
<div class="header">
<p>
Next: <a href="#GNU-General-Public-License" accesskey="n" rel="next">GNU General Public License</a>, Previous: <a href="#Advanced-Topics" accesskey="p" rel="prev">Advanced Topics</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="IEEE-Std-1788_002d2015-1"></a>
<h2 class="appendix">Appendix A IEEE Std 1788-2015</h2>
<p>The IEEE standard for interval arithmetic is an important asset for the general use of interval arithmetic. Several interval arithmetic libraries have been created (most popular for the language C++), which vary greatly in their philosophy, completeness and—most important—mathematical definition of certain functions and arithmetic evaluation. The standard grants support for several interval arithmetic flavors, but fights incompatibilities on many layers: Interval arithmetic applications shall be portable, predictable, and reproducible. This is especially important since interval arithmetic shall lead to reliable results. Also a common standard is necessary to catalyze the availability of (fast) interval operations in hardware.
</p>
<p>For all conforming implementations certain accuracy constraints must be satisfied and a good amount of interval functions must be implemented. It is defined how to handle functions that are not globally defined or have limiting values. Also such basic things like interval representation, many useful constructors, and interchange encoding are addressed.
</p>
<p>The interval package for GNU Octave is the first complete implementation that claims to be standard conforming.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Function-Names" accesskey="1">Function Names</a>:</td><td> </td><td align="left" valign="top">List of functions defined by IEEE Std 1788-2015<br>and how they have been implemented in GNU Octave
</td></tr>
<tr><td align="left" valign="top">• <a href="#Conformance-Claim" accesskey="2">Conformance Claim</a>:</td><td> </td><td align="left" valign="top">Official statement and some<br>implementation specific details regarding the standard
</td></tr>
</table>
<hr>
<a name="Function-Names"></a>
<div class="header">
<p>
Next: <a href="#Conformance-Claim" accesskey="n" rel="next">Conformance Claim</a>, Up: <a href="#IEEE-Std-1788_002d2015" accesskey="u" rel="up">IEEE Std 1788-2015</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Function-Names-1"></a>
<h3 class="appendixsec">A.1 Function Names</h3>
<p>In terms of a better integration into the GNU Octave language, several operations use a function name which is different from the name proposed in the standard document. The following table translates and lists the implemented function names of the IEEE standard for interval arithmetic.
</p>
<p>The implementation provides several additional functions, but this section lists only functions that are mentioned in IEEE Std 1788-2015.
</p>
<a name="Interval-constants"></a>
<h4 class="appendixsubsec">A.1.1 Interval constants</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/empty.html">empty</a> and <a href="https://octave.sourceforge.io/interval/function/entire.html">entire</a>.
</p>
<a name="Constructors"></a>
<h4 class="appendixsubsec">A.1.2 Constructors</h4>
<p>The operations textToInterval (<var>S</var>), numsToInterval (<var>l</var>, <var>u</var>), and setDec (<var>x</var>) are implemented by the class constructors <a href="https://octave.sourceforge.io/interval/function/@infsup/infsup.html">@infsup/infsup</a> for bare intervals and <a href="https://octave.sourceforge.io/interval/function/@infsupdec/infsupdec.html">@infsupdec/infsupdec</a> for decorated intervals.
</p>
<a name="Required-functions"></a>
<h4 class="appendixsubsec">A.1.3 Required functions</h4>
<div class="float"><a name="tab_003arequired_002dforward_002dfunctions"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Tightness</th></tr></thead>
<thead><tr><th></th><th><span class="roman"><em>Basic operations</em></span></th><th></th></tr></thead>
<tr><td>neg (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/uminus.html">@infsup/uminus</a></td><td>tightest</td></tr>
<tr><td>add (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/plus.html">@infsup/plus</a></td><td>tightest</td></tr>
<tr><td>sub (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/minus.html">@infsup/minus</a></td><td>tightest</td></tr>
<tr><td>mul (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/times.html">@infsup/times</a></td><td>tightest</td></tr>
<tr><td>div (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/rdivide.html">@infsup/rdivide</a></td><td>tightest</td></tr>
<tr><td>recip (<var>x</var>)</td><td><code>1 ./ <var>x</var></code></td><td>tightest</td></tr>
<tr><td>sqr (<var>x</var>)</td><td><code><var>x</var> .^ 2</code></td><td>tightest</td></tr>
<tr><td>sqrt (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/realsqrt.html">@infsup/realsqrt</a></td><td>tightest</td></tr>
<tr><td>fma (<var>x</var>, <var>y</var>, <var>z</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/fma.html">@infsup/fma</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Power functions</em></span></th><th></th></tr></thead>
<tr><td>pown (<var>x</var>, <var>p</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/pown.html">@infsup/pown</a></td><td>tightest</td></tr>
<tr><td>pow (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/pow.html">@infsup/pow</a></td><td>tightest</td></tr>
<tr><td>exp (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/exp.html">@infsup/exp</a></td><td>tightest</td></tr>
<tr><td>exp2 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/pow2.html">@infsup/pow2</a></td><td>tightest</td></tr>
<tr><td>exp10 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/pow10.html">@infsup/pow10</a></td><td>tightest</td></tr>
<tr><td>log (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/log.html">@infsup/log</a></td><td>tightest</td></tr>
<tr><td>log2 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/log2.html">@infsup/log2</a></td><td>tightest</td></tr>
<tr><td>log10 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/log10.html">@infsup/log10</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Trigonometric / hyperbolic</em></span></th><th></th></tr></thead>
<tr><td>sin (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sin.html">@infsup/sin</a></td><td>tightest</td></tr>
<tr><td>cos (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/cos.html">@infsup/cos</a></td><td>tightest</td></tr>
<tr><td>tan (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/tan.html">@infsup/tan</a></td><td>tightest</td></tr>
<tr><td>asin (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/asin.html">@infsup/asin</a></td><td>tightest</td></tr>
<tr><td>acos (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/acos.html">@infsup/acos</a></td><td>tightest</td></tr>
<tr><td>atan (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/atan.html">@infsup/atan</a></td><td>tightest</td></tr>
<tr><td>atan2 (<var>y</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/atan2.html">@infsup/atan2</a></td><td>tightest</td></tr>
<tr><td>sinh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sinh.html">@infsup/sinh</a></td><td>tightest</td></tr>
<tr><td>cosh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/cosh.html">@infsup/cosh</a></td><td>tightest</td></tr>
<tr><td>tanh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/tanh.html">@infsup/tanh</a></td><td>tightest</td></tr>
<tr><td>asinh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/asinh.html">@infsup/asinh</a></td><td>tightest</td></tr>
<tr><td>acosh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/acosh.html">@infsup/acosh</a></td><td>tightest</td></tr>
<tr><td>atanh (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/atanh.html">@infsup/atanh</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Integer functions</em></span></th><th></th></tr></thead>
<tr><td>sign (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sign.html">@infsup/sign</a></td><td>tightest</td></tr>
<tr><td>ceil (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/ceil.html">@infsup/ceil</a></td><td>tightest</td></tr>
<tr><td>floor (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/floor.html">@infsup/floor</a></td><td>tightest</td></tr>
<tr><td>trunc (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/fix.html">@infsup/fix</a></td><td>tightest</td></tr>
<tr><td>roundTiesToEven (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/roundb.html">@infsup/roundb</a></td><td>tightest</td></tr>
<tr><td>roundTiesToAway (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/round.html">@infsup/round</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Absmax functions</em></span></th><th></th></tr></thead>
<tr><td>abs (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/abs.html">@infsup/abs</a></td><td>tightest</td></tr>
<tr><td>min (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/min.html">@infsup/min</a></td><td>tightest</td></tr>
<tr><td>max (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/max.html">@infsup/max</a></td><td>tightest</td></tr>
</table>
<div class="float-caption"><p><strong>Table A.1: </strong>Required forward elementary functions</p></div></div>
<div class="float"><a name="tab_003arequired_002dreverse_002dfunctions"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Tightness</th></tr></thead>
<thead><tr><th></th><th><span class="roman"><em>From unary functions</em></span></th><th></th></tr></thead>
<tr><td>sqrRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sqrrev.html">@infsup/sqrrev</a></td><td>tightest</td></tr>
<tr><td>absRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/absrev.html">@infsup/absrev</a></td><td>tightest</td></tr>
<tr><td>pownRev (<var>c</var>, <var>x</var>, <var>p</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/pownrev.html">@infsup/pownrev</a></td><td>valid (tightest for <var>p</var> ≥ -2)</td></tr>
<tr><td>sinRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sinrev.html">@infsup/sinrev</a></td><td>valid</td></tr>
<tr><td>cosRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/cosrev.html">@infsup/cosrev</a></td><td>valid</td></tr>
<tr><td>tanRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/tanrev.html">@infsup/tanrev</a></td><td>valid</td></tr>
<tr><td>coshRev (<var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/coshrev.html">@infsup/coshrev</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>From binary functions</em></span></th><th></th></tr></thead>
<tr><td>mulRev (<var>b</var>, <var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/mulrev.html">@infsup/mulrev</a></td><td>tightest</td></tr>
<tr><td>powRev1 (<var>b</var>, <var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/powrev1.html">@infsup/powrev1</a></td><td>valid</td></tr>
<tr><td>powRev2 (<var>a</var>, <var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/powrev2.html">@infsup/powrev2</a></td><td>valid</td></tr>
<tr><td>atan2Rev1 (<var>b</var>, <var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/atan2rev1.html">@infsup/atan2rev1</a></td><td>valid</td></tr>
<tr><td>atan2Rev2 (<var>a</var>, <var>c</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/atan2rev2.html">@infsup/atan2rev2</a></td><td>valid</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Two-output division</em></span></th><th></th></tr></thead>
<tr><td>mulRevToPair (<var>b</var>, <var>c</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/mulrev.html">@infsup/mulrev</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Cancellative addition<br>and subtraction</em></span></th><th></th></tr></thead>
<tr><td>cancelMinus (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/cancelminus.html">@infsup/cancelminus</a></td><td>tightest</td></tr>
<tr><td>cancelPlus (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/cancelplus.html">@infsup/cancelplus</a></td><td>tightest</td></tr>
</table>
<div class="float-caption"><p><strong>Table A.2: </strong>Required reverse functions</p></div></div>
<div class="float"><a name="tab_003arequired_002dset_002doperations"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Tightness</th></tr></thead>
<tr><td>intersection (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/intersect.html">@infsup/intersect</a></td><td>tightest</td></tr>
<tr><td>convexHull (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/union.html">@infsup/union</a></td><td>tightest</td></tr>
</table>
<div class="float-caption"><p><strong>Table A.3: </strong>Required set operations</p></div></div>
<div class="float"><a name="tab_003arequired_002dnumeric_002dfunctions"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Rounding mode</th></tr></thead>
<tr><td>inf (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/inf.html">@infsup/inf</a></td><td></td></tr>
<tr><td>sup (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/sup.html">@infsup/sup</a></td><td></td></tr>
<tr><td>mid (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/mid.html">@infsup/mid</a></td><td>to nearest, ties to even</td></tr>
<tr><td>wid (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/wid.html">@infsup/wid</a></td><td>toward +∞</td></tr>
<tr><td>rad (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/rad.html">@infsup/rad</a></td><td>toward +∞</td></tr>
<tr><td>mag (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/mag.html">@infsup/mag</a></td><td></td></tr>
<tr><td>mig (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/mig.html">@infsup/mig</a></td><td></td></tr>
</table>
<div class="float-caption"><p><strong>Table A.4: </strong>Required numeric functions of intervals</p></div></div>
<div class="float"><a name="tab_003arequired_002dboolean_002dfunctions"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Description</th></tr></thead>
<tr><td>isEmpty (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/isempty.html">@infsup/isempty</a></td><td><var>x</var> is the empty set</td></tr>
<tr><td>isEntire (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/isentire.html">@infsup/isentire</a></td><td><var>x</var> is the whole line</td></tr>
<tr><td>equal (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/eq.html">@infsup/eq</a></td><td><var>a</var> equals <var>b</var></td></tr>
<tr><td>subset (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/subset.html">@infsup/subset</a></td><td><var>a</var> is a subset of <var>b</var></td></tr>
<tr><td>less (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/le.html">@infsup/le</a></td><td><var>a</var> is weakly less than <var>b</var></td></tr>
<tr><td>precedes (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/precedes.html">@infsup/precedes</a></td><td><var>a</var> is left of but may touch <var>b</var></td></tr>
<tr><td>interior (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/interior.html">@infsup/interior</a></td><td><var>a</var> is interior to <var>b</var></td></tr>
<tr><td>strictLess (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/lt.html">@infsup/lt</a></td><td><var>a</var> is strictly less than <var>b</var></td></tr>
<tr><td>strictPrecedes (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/strictprecedes.html">@infsup/strictprecedes</a></td><td><var>a</var> is strictly left of <var>b</var></td></tr>
<tr><td>disjoint (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/disjoint.html">@infsup/disjoint</a></td><td><var>a</var> and <var>b</var> are disjoint</td></tr>
</table>
<div class="float-caption"><p><strong>Table A.5: </strong>Required boolean functions of intervals</p></div></div>
<a name="Recommended-functions"></a>
<h4 class="appendixsubsec">A.1.4 Recommended functions</h4>
<div class="float"><a name="tab_003arecommended_002dfunctions"></a>
<table>
<thead><tr><th>Operation</th><th>Implementation</th><th>Tightness / Comments</th></tr></thead>
<thead><tr><th></th><th><span class="roman"><em>Elementary functions</em></span></th><th></th></tr></thead>
<tr><td>rootn (<var>x</var>, <var>q</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/nthroot.html">@infsup/nthroot</a></td><td>valid (tightest for <var>q</var> ≥ -2)</td></tr>
<tr><td>expm1 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/expm1.html">@infsup/expm1</a></td><td>tightest</td></tr>
<tr><td>logp1 (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/log1p.html">@infsup/log1p</a></td><td>tightest</td></tr>
<tr><td>hypot (<var>x</var>, <var>y</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/hypot.html">@infsup/hypot</a></td><td>tightest</td></tr>
<tr><td>rSqrt (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/rsqrt.html">@infsup/rsqrt</a></td><td>tightest</td></tr>
<thead><tr><th></th><th><span class="roman"><em>Boolean functions</em></span></th><th></th></tr></thead>
<tr><td>isCommonInterval (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/iscommoninterval.html">@infsup/iscommoninterval</a></td><td>(=bound and non-empty)</td></tr>
<tr><td>isSingleton (<var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/issingleton.html">@infsup/issingleton</a></td><td>(=single real)</td></tr>
<tr><td>isMember (<var>m</var>, <var>x</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/ismember.html">@infsup/ismember</a></td><td></td></tr>
<thead><tr><th></th><th><span class="roman"><em>Extended comparison</em></span></th><th></th></tr></thead>
<tr><td>overlap (<var>a</var>, <var>b</var>)</td><td><a href="https://octave.sourceforge.io/interval/function/@infsup/overlap.html">@infsup/overlap</a></td><td></td></tr>
</table>
<div class="float-caption"><p><strong>Table A.6: </strong>Recommended functions</p></div></div>
<a name="Operations-on_002fwith-decorations"></a>
<h4 class="appendixsubsec">A.1.5 Operations on/with decorations</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/@infsup/newdec.html">@infsup/newdec</a>, <a href="https://octave.sourceforge.io/interval/function/@infsupdec/intervalpart.html">@infsupdec/intervalpart</a>, and <a href="https://octave.sourceforge.io/interval/function/@infsupdec/decorationpart.html">@infsupdec/decorationpart</a>. The operation setDec is implemented by <a href="https://octave.sourceforge.io/interval/function/@infsupdec/infsupdec.html">@infsupdec/infsupdec</a>.
</p>
<p>For comparison of decorations with respect to the propagation order <code>com > dac > def > trv > ill</code> use the numeric value returned by <code>decorationpart (<var>x</var>, "uint8")</code>.
</p>
<a name="Reduction-operations"></a>
<h4 class="appendixsubsec">A.1.6 Reduction operations</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/mpfr_vector_sum_d.html">mpfr_vector_sum_d</a> and <a href="https://octave.sourceforge.io/interval/function/mpfr_vector_dot_d.html">mpfr_vector_dot_d</a>. The operations <code>sumAbs</code> and <code>sumSquare</code> can be computed with <code>mpfr_vector_sum_d (<var>rounding mode</var>, abs (<var>x</var>))</code> and <code>mpfr_vector_dot_d (<var>rounding mode</var>, <var>x</var>, <var>x</var>)</code> respectively.
</p>
<a name="Input"></a>
<h4 class="appendixsubsec">A.1.7 Input</h4>
<p>The operation <code>textToInterval</code> is implemented by the class constructors <a href="https://octave.sourceforge.io/interval/function/@infsup/infsup.html">@infsup/infsup</a> for bare intervals and <a href="https://octave.sourceforge.io/interval/function/@infsupdec/infsupdec.html">@infsupdec/infsupdec</a> for decorated intervals. Both are able to operate on interval literals provided as strings.
</p>
<a name="Output"></a>
<h4 class="appendixsubsec">A.1.8 Output</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/@infsup/intervaltotext.html">@infsup/intervaltotext</a>.
</p>
<a name="Exact-text-representation"></a>
<h4 class="appendixsubsec">A.1.9 Exact text representation</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/exacttointerval.html">exacttointerval</a> and <a href="https://octave.sourceforge.io/interval/function/@infsup/intervaltoexact.html">@infsup/intervaltoexact</a>.
</p>
<a name="Interchange-representation-and-encoding"></a>
<h4 class="appendixsubsec">A.1.10 Interchange representation and encoding</h4>
<p>See <a href="https://octave.sourceforge.io/interval/function/interval_bitpack.html">interval_bitpack</a> and <a href="https://octave.sourceforge.io/interval/function/@infsup/bitunpack.html">@infsup/bitunpack</a>.
</p>
<hr>
<a name="Conformance-Claim"></a>
<div class="header">
<p>
Previous: <a href="#Function-Names" accesskey="p" rel="prev">Function Names</a>, Up: <a href="#IEEE-Std-1788_002d2015" accesskey="u" rel="up">IEEE Std 1788-2015</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="Conformance-Claim-1"></a>
<h3 class="appendixsec">A.2 Conformance Claim</h3>
<p>The inverval package version 3.1.0 for GNU Octave is conforming to IEEE Std 1788-2015, IEEE Standard for Interval Arithmetic. It is conforming to the set-based flavor with IEEE 754 conformance for the infsup binary64 interval type and without compressed arithmetic. Additionally it provides no further flavors.
</p>
<a name="Conformance-Questionnaire"></a>
<h3 class="appendixsec">A.3 Conformance Questionnaire</h3>
<div class="alpha-list"></div>
<ol type="a" start="1">
<li> Implementation-defined behavior
<ol>
<li> What status flags or other means to signal the occurrence of certain decoration values in computations does the implementation provide if any?
<p>The implementation does not signal the occurrence of decoration values.
</p></li></ol>
</li><li> Documentation of behavior
<ol>
<li> If the implementation supports implicit interval types, how is the interval hull operation realized?
<p>The implementation supports explicit interval types only.
</p>
</li><li> What accuracy is achieved (i.e., tightest, accurate, or valid) for each of the implementation’s interval operations?
<p>The accuracy requirements of IEEE Std 1788-2015 are fulfilled. Most operations achieve tightest accuracy, some operations (especially reverse operations) do not. The tightness of each operation is documented in the function’s documentation string and can be displayed with the <code>help</code> command.
</p>
</li><li> Under what conditions is a constructor unable to determine whether a Level 1 value exists that corresponds to the supplied inputs?
<p>When two different string boundaries for an interval both lie between the same two subsequent binary64 numbers, a PossiblyUndefined warning is created.
</p>
</li><li> How are ties broken in rounding numbers if multiple numbers qualify as the rounded result?
<p>Tie-breaking uses the IEEE Std 754 default: round ties to even.
</p>
</li><li> How are interval datums converted to their exact text representations?
<p>The binary64 boundaries are converted into hexadecimal-significand form as required by the standard. It is also possible to convert interval datums to exact interval literals in decimal form, see optional arguments of function <a href="https://octave.sourceforge.io/interval/function/@infsup/intervaltotext.html">@infsup/intervaltotext</a> for that purpose.
</p></li></ol>
</li><li> Implementation-defined behavior
<ol>
<li>Does the implementation include the interval overlapping function? If so, how is it made available to the user?
<p>Yes, the interval overlapping function is implemented under the name <a href="https://octave.sourceforge.io/interval/function/@infsup/overlap.html">@infsup/overlap</a>.
</p>
</li><li> Does the implementation store additional information in a NaI? What functions are provided for the user to set and read this information?
<p>No additional information is stored in a NaI.
</p>
</li><li> What means if any does the implementation provide for an exception to be signaled when a NaI is produced?
<p>The creation of a NaI is signaled with GNU Octave’s warning mechanism.
</p>
</li><li> What interval types are supported besides the required ones?
<p>None.
</p>
</li><li> What mechanisms of exception handling are used in exception handlers provided by the implementation? What additional exception handling is provided by the implementation?
<p>The exceptions described by IEEE Std 1788-2015 raise a warning, which can be handled with GNU Octave’s warning mechanism. The warning may be customized to produce an error instead and interrupt computation. The implementation provides no additional exception handling.
</p>
</li><li> [Question does not apply to IEEE 754 conforming types.]
</li><li> Does the implementation include different versions of the same operation for a given type and how are these provided to the user?
<p>The interval matrix multiplication (see <a href="https://octave.sourceforge.io/interval/function/@infsup/mtimes.html">@infsup/mtimes</a>) offers two implementations, with either <samp>tightest</samp> or <samp>valid</samp> accuracy. The user may chose the desired version with an optional argument during the function call.
</p>
</li><li> What combinations of formats are supported in interval constructors?
<p>Any reasonable combination of the formats described in the standard document is supported.
</p>
</li><li> [Question does not apply to IEEE 754 conforming types.]
</li><li> What methods are used to read or write strings from or to character streams? Does the implementation employ variations in locales (such as specific character case matching)? This includes the syntax used in the strings for reading and writing.
<p>Input and output is implemented with GNU Octave string variables in UTF-8 encoding. There is no discrimination between different locales. Character case is ignored during input. The syntax for interval literals is used as described by the standard document.
</p>
</li><li> What is the tightness for the interval to string conversion for all interval types?
<p>The general-purpose interval to string conversion produces the tightest decimal infsup form which has no more digits than are necessary to separate two binary64 numbers.
</p>
</li><li> What is the result of Level 3 operations for invalid inputs?
<p>Interval constructors prevent the creation of invalid Level 3 interval datums.
</p>
<p>Any non-interval input to Level 3 operations is implicitly converted into an interval and the operation silently continues on interval inputs.
</p>
<p>If at least one input is a decorated interval, bare interval inputs are implicitly decorated as described by <code>newDec</code> in the standard document. Implicit promotion from a bare interval to a decorated interval is signaled with GNU Octave’s warning mechanism.
</p>
<p>If implicit conversion fails (e.g., illegal interval literals), bare interval operations produce empty intervals, whereas the decorated interval operations continue on NaI inputs.
</p>
</li><li> [Question does not apply to IEEE 754 conforming types.]
</li><li> What decorations does the implementation provide and what is their mathematical definition? How are these decorations mapped when converting an interval to the interchange format?
<p>The implementation provides the decorations com, dac, def, trv, and ill as described by the standard document.
</p>
</li><li> [Question does not apply to IEEE 754 conforming types.]
</li></ol>
</li><li> [Question applies to compressed arithmetic only, which is not supported.]
</li><li> [Questions apply to non-standard flavors only, which are not supported.]
</li></ol>
<hr>
<a name="GNU-General-Public-License"></a>
<div class="header">
<p>
Previous: <a href="#IEEE-Std-1788_002d2015" accesskey="p" rel="prev">IEEE Std 1788-2015</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<a name="GNU-General-Public-License-1"></a>
<h2 class="appendix">Appendix B GNU General Public License</h2>
<div align="center">Version 3, 29 June 2007
</div>
<div class="display">
<pre class="display">Copyright © 2007 Free Software Foundation, Inc. <a href="http://fsf.org/">http://fsf.org/</a>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
</pre></div>
<a name="Preamble"></a>
<h3 class="heading">Preamble</h3>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.
</p>
<p>The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom
to share and change all versions of a program—to make sure it remains
free software for all its users. We, the Free Software Foundation,
use the GNU General Public License for most of our software; it
applies also to any other work released this way by its authors. You
can apply it to your programs, too.
</p>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
</p>
<p>To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
</p>
<p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too,
receive or can get the source code. And you must show them these
terms so they know their rights.
</p>
<p>Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
</p>
<p>For the developers’ and authors’ protection, the GPL clearly explains
that there is no warranty for this free software. For both users’ and
authors’ sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
</p>
<p>Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so. This is fundamentally incompatible with the
aim of protecting users’ freedom to change the software. The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
</p>
<p>Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish
to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.
</p>
<a name="TERMS-AND-CONDITIONS"></a>
<h3 class="heading">TERMS AND CONDITIONS</h3>
<div class="zero-list"></div>
<ol start="0">
<li> Definitions.
<p>“This License” refers to version 3 of the GNU General Public License.
</p>
<p>“Copyright” also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
</p>
<p>“The Program” refers to any copyrightable work licensed under this
License. Each licensee is addressed as “you”. “Licensees” and
“recipients” may be individuals or organizations.
</p>
<p>To “modify” a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a “modified version” of
the earlier work or a work “based on” the earlier work.
</p>
<p>A “covered work” means either the unmodified Program or a work based
on the Program.
</p>
<p>To “propagate” a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
</p>
<p>To “convey” a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
</p>
<p>An interactive user interface displays “Appropriate Legal Notices” to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
</p>
</li><li> Source Code.
<p>The “source code” for a work means the preferred form of the work for
making modifications to it. “Object code” means any non-source form
of a work.
</p>
<p>A “Standard Interface” means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
</p>
<p>The “System Libraries” of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
“Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
</p>
<p>The “Corresponding Source” for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work’s
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
</p>
<p>The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
</p>
<p>The Corresponding Source for a work in source code form is that same
work.
</p>
</li><li> Basic Permissions.
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
</p>
<p>You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
</p>
<p>Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
</p>
</li><li> Protecting Users’ Legal Rights From Anti-Circumvention Law.
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work’s users, your or third parties’ legal rights to forbid
circumvention of technological measures.
</p>
</li><li> Conveying Verbatim Copies.
<p>You may convey verbatim copies of the Program’s source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
</p>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
</p>
</li><li> Conveying Modified Source Versions.
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
</p>
<div class="alpha-list"></div>
<ol type="a" start="1">
<li> The work must carry prominent notices stating that you modified it,
and giving a relevant date.
</li><li> The work must carry prominent notices stating that it is released
under this License and any conditions added under section 7. This
requirement modifies the requirement in section 4 to “keep intact all
notices”.
</li><li> You must license the entire work, as a whole, under this License to
anyone who comes into possession of a copy. This License will
therefore apply, along with any applicable section 7 additional terms,
to the whole of the work, and all its parts, regardless of how they
are packaged. This License gives no permission to license the work in
any other way, but it does not invalidate such permission if you have
separately received it.
</li><li> If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your work
need not make them do so.
</li></ol>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
“aggregate” if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation’s users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
</p>
</li><li> Conveying Non-Source Forms.
<p>You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
</p>
<div class="alpha-list"></div>
<ol type="a" start="1">
<li> Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium customarily
used for software interchange.
</li><li> Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a written
offer, valid for at least three years and valid for as long as you
offer spare parts or customer support for that product model, to give
anyone who possesses the object code either (1) a copy of the
Corresponding Source for all the software in the product that is
covered by this License, on a durable physical medium customarily used
for software interchange, for a price no more than your reasonable
cost of physically performing this conveying of source, or (2) access
to copy the Corresponding Source from a network server at no charge.
</li><li> Convey individual copies of the object code with a copy of the written
offer to provide the Corresponding Source. This alternative is
allowed only occasionally and noncommercially, and only if you
received the object code with such an offer, in accord with subsection
6b.
</li><li> Convey the object code by offering access from a designated place
(gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to copy
the object code is a network server, the Corresponding Source may be
on a different server (operated by you or a third party) that supports
equivalent copying facilities, provided you maintain clear directions
next to the object code saying where to find the Corresponding Source.
Regardless of what server hosts the Corresponding Source, you remain
obligated to ensure that it is available for as long as needed to
satisfy these requirements.
</li><li> Convey the object code using peer-to-peer transmission, provided you
inform other peers where the object code and Corresponding Source of
the work are being offered to the general public at no charge under
subsection 6d.
</li></ol>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
</p>
<p>A “User Product” is either (1) a “consumer product”, which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
“normally used” refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
</p>
<p>“Installation Information” for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
</p>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
</p>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
</p>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
</p>
</li><li> Additional Terms.
<p>“Additional permissions” are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
</p>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
</p>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
</p>
<div class="alpha-list"></div>
<ol type="a" start="1">
<li> Disclaiming warranty or limiting liability differently from the terms
of sections 15 and 16 of this License; or
</li><li> Requiring preservation of specified reasonable legal notices or author
attributions in that material or in the Appropriate Legal Notices
displayed by works containing it; or
</li><li> Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
</li><li> Limiting the use for publicity purposes of names of licensors or
authors of the material; or
</li><li> Declining to grant rights under trademark law for use of some trade
names, trademarks, or service marks; or
</li><li> Requiring indemnification of licensors and authors of that material by
anyone who conveys the material (or modified versions of it) with
contractual assumptions of liability to the recipient, for any
liability that these contractual assumptions directly impose on those
licensors and authors.
</li></ol>
<p>All other non-permissive additional terms are considered “further
restrictions” within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
</p>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
</p>
</li><li> Termination.
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
</p>
<p>However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
</p>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
</p>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
</p>
</li><li> Acceptance Not Required for Having Copies.
<p>You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
</p>
</li><li> Automatic Licensing of Downstream Recipients.
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
</p>
<p>An “entity transaction” is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party’s predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
</p>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
</p>
</li><li> Patents.
<p>A “contributor” is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor’s “contributor version”.
</p>
<p>A contributor’s “essential patent claims” are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, “control” includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor’s essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
</p>
<p>In the following three paragraphs, a “patent license” is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To “grant” such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
</p>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. “Knowingly relying” means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient’s use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
</p>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
</p>
<p>A patent license is “discriminatory” if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
</p>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
</p>
</li><li> No Surrender of Others’ Freedom.
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey
a covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree
to terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
</p>
</li><li> Use with the GNU Affero General Public License.
<p>Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
</p>
</li><li> Revised Versions of this License.
<p>The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
</p>
<p>Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU General Public
License “or any later version” applies to it, you have the option of
following the terms and conditions either of that numbered version or
of any later version published by the Free Software Foundation. If
the Program does not specify a version number of the GNU General
Public License, you may choose any version ever published by the Free
Software Foundation.
</p>
<p>If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy’s public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
</p>
</li><li> Disclaimer of Warranty.
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
</p>
</li><li> Limitation of Liability.
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
</p>
</li><li> Interpretation of Sections 15 and 16.
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
</p>
</li></ol>
<a name="END-OF-TERMS-AND-CONDITIONS"></a>
<h3 class="heading">END OF TERMS AND CONDITIONS</h3>
<a name="How-to-Apply-These-Terms-to-Your-New-Programs"></a>
<h3 class="heading">How to Apply These Terms to Your New Programs</h3>
<p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
</p>
<p>To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the “copyright” line and a pointer to where the full notice is found.
</p>
<div class="smallexample">
<pre class="smallexample"><var>one line to give the program's name and a brief idea of what it does.</var>
Copyright (C) <var>year</var> <var>name of author</var>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
</pre></div>
<p>Also add information on how to contact you by electronic and paper mail.
</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
</p>
<div class="smallexample">
<pre class="smallexample"><var>program</var> Copyright (C) <var>year</var> <var>name of author</var>
This program comes with ABSOLUTELY NO WARRANTY; for details type ‘<samp>show w</samp>’.
This is free software, and you are welcome to redistribute it
under certain conditions; type ‘<samp>show c</samp>’ for details.
</pre></div>
<p>The hypothetical commands ‘<samp>show w</samp>’ and ‘<samp>show c</samp>’ should show
the appropriate parts of the General Public License. Of course, your
program’s commands might be different; for a GUI interface, you would
use an “about box”.
</p>
<p>You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
</p>
<p>The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use
the GNU Lesser General Public License instead of this License. But
first, please read <a href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</a>.
</p>
<hr>
</body>
</html>
|