summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/polexpr/polexpr.html
blob: 74963329764038a6f50fd23637f5aed13b449c19 (plain)
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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Package polexpr documentation</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0 }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 ! important }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 ! important }

.last, .with-subtitle {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

.subscript {
  vertical-align: sub;
  font-size: smaller }

.superscript {
  vertical-align: super;
  font-size: smaller }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dl.docutils dd {
  margin-bottom: 0.5em }

object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
  overflow: hidden;
}

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em ;
  margin-right: 2em }

div.footer, div.header {
  clear: both;
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin: 0 0 0.5em 1em ;
  border: medium outset ;
  padding: 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em }

h1.title {
  text-align: center }

h2.subtitle {
  text-align: center }

hr.docutils {
  width: 75% }

img.align-left, .figure.align-left, object.align-left, table.align-left {
  clear: left ;
  float: left ;
  margin-right: 1em }

img.align-right, .figure.align-right, object.align-right, table.align-right {
  clear: right ;
  float: right ;
  margin-left: 1em }

img.align-center, .figure.align-center, object.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

table.align-center {
  margin-left: auto;
  margin-right: auto;
}

.align-left {
  text-align: left }

.align-center {
  clear: both ;
  text-align: center }

.align-right {
  text-align: right }

/* reset inner alignment in figures */
div.align-right {
  text-align: inherit }

/* div.align-center * { */
/*   text-align: left } */

.align-top    {
  vertical-align: top }

.align-middle {
  vertical-align: middle }

.align-bottom {
  vertical-align: bottom }

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font: inherit }

pre.literal-block, pre.doctest-block, pre.math, pre.code {
  margin-left: 2em ;
  margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80% }

table.citation {
  border-left: solid 1px gray;
  margin-left: 1px }

table.docinfo {
  margin: 2em 4em }

table.docutils {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.footnote {
  border-left: solid 1px black;
  margin-left: 1px }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap ;
  padding-left: 0 }

/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
  border: 0px;
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-collapse: collapse;
}
table.docutils.booktabs * {
  border: 0px;
}
table.docutils.booktabs th {
  border-bottom: thin solid;
  text-align: left;
}

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100% }

ul.auto-toc {
  list-style-type: none }

</style>
</head>
<body>
<div class="document" id="package-polexpr-documentation">
<h1 class="title">Package polexpr documentation</h1>
<h2 class="subtitle" id="id1">0.7.5 (2020/01/31)</h2>

<!-- comment: -*- fill-column: 72; mode: rst; -*- -->
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#basic-syntax" id="id38">Basic syntax</a></li>
<li><a class="reference internal" href="#examples-of-localization-of-roots" id="id39">Examples of localization of roots</a><ul>
<li><a class="reference internal" href="#a-typical-example" id="id40">A typical example</a></li>
<li><a class="reference internal" href="#a-degree-four-polynomial-with-nearby-roots" id="id41">A degree four polynomial with nearby roots</a></li>
<li><a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots" id="id42">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></li>
<li><a class="reference internal" href="#a-degree-five-polynomial-with-three-rational-roots" id="id43">A degree five polynomial with three rational roots</a></li>
<li><a class="reference internal" href="#a-mignotte-type-polynomial" id="id44">A Mignotte type polynomial</a></li>
<li><a class="reference internal" href="#the-wilkinson-polynomial" id="id45">The Wilkinson polynomial</a></li>
<li><a class="reference internal" href="#the-second-wilkinson-polynomial" id="id46">The second Wilkinson polynomial</a></li>
<li><a class="reference internal" href="#the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots" id="id47">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></li>
<li><a class="reference internal" href="#roots-of-chebyshev-polynomials" id="id48">Roots of Chebyshev polynomials</a></li>
</ul>
</li>
<li><a class="reference internal" href="#non-expandable-macros" id="id49">Non-expandable macros</a><ul>
<li><a class="reference internal" href="#poldef-polname-letter-expression-in-letter" id="id50"><tt class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression in letter;</tt></a></li>
<li><a class="reference internal" href="#poldef-letter-polname-expression-in-letter" id="id51"><tt class="docutils literal"><span class="pre">\PolDef[letter]{polname}{expression</span> in letter}</tt></a></li>
<li><a class="reference internal" href="#polgenfloatvariant-polname" id="id52"><tt class="docutils literal">\PolGenFloatVariant{polname}</tt></a></li>
<li><a class="reference internal" href="#pollet-polname-2-polname-1" id="id53"><tt class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></tt></a></li>
<li><a class="reference internal" href="#polgloballet-polname-2-polname-1" id="id54"><tt class="docutils literal"><span class="pre">\PolGlobalLet{polname_2}={polname_1}</span></tt></a></li>
<li><a class="reference internal" href="#polassign-polname-toarray-macro" id="id55"><tt class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></tt></a></li>
<li><a class="reference internal" href="#polget-polname-fromarray-macro" id="id56"><tt class="docutils literal"><span class="pre">\PolGet{polname}\fromarray\macro</span></tt></a></li>
<li><a class="reference internal" href="#polfromcsv-polname-csv" id="id57"><tt class="docutils literal"><span class="pre">\PolFromCSV{polname}{&lt;csv&gt;}</span></tt></a></li>
<li><a class="reference internal" href="#poltypeset-polname" id="id58"><tt class="docutils literal">\PolTypeset{polname}</tt></a><ul>
<li><a class="reference internal" href="#poltypesetcmd-raw-coeff" id="id59"><tt class="docutils literal">\PolTypesetCmd{raw_coeff}</tt></a></li>
<li><a class="reference internal" href="#poltypesetone-raw-coeff" id="id60"><tt class="docutils literal">\PolTypesetOne{raw_coeff}</tt></a></li>
<li><a class="reference internal" href="#id6" id="id61"><tt class="docutils literal">\PolTypesetMonomialCmd</tt></a></li>
<li><a class="reference internal" href="#poltypesetcmdprefix-raw-coeff" id="id62"><tt class="docutils literal">\PolTypesetCmdPrefix{raw_coeff}</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#id8" id="id63"><tt class="docutils literal"><span class="pre">\PolTypeset*{polname}</span></tt></a></li>
<li><a class="reference internal" href="#poldiff-polname-1-polname-2" id="id64"><tt class="docutils literal"><span class="pre">\PolDiff{polname_1}{polname_2}</span></tt></a></li>
<li><a class="reference internal" href="#poldiff-n-polname-1-polname-2" id="id65"><tt class="docutils literal"><span class="pre">\PolDiff[N]{polname_1}{polname_2}</span></tt></a></li>
<li><a class="reference internal" href="#polantidiff-polname-1-polname-2" id="id66"><tt class="docutils literal"><span class="pre">\PolAntiDiff{polname_1}{polname_2}</span></tt></a></li>
<li><a class="reference internal" href="#polantidiff-n-polname-1-polname-2" id="id67"><tt class="docutils literal"><span class="pre">\PolAntiDiff[N]{polname_1}{polname_2}</span></tt></a></li>
<li><a class="reference internal" href="#poldivide-polname-1-polname-2-polname-q-polname-r" id="id68"><tt class="docutils literal"><span class="pre">\PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}</span></tt></a></li>
<li><a class="reference internal" href="#polquo-polname-1-polname-2-polname-q" id="id69"><tt class="docutils literal"><span class="pre">\PolQuo{polname_1}{polname_2}{polname_Q}</span></tt></a></li>
<li><a class="reference internal" href="#polrem-polname-1-polname-2-polname-r" id="id70"><tt class="docutils literal"><span class="pre">\PolRem{polname_1}{polname_2}{polname_R}</span></tt></a></li>
<li><a class="reference internal" href="#polgcd-polname-1-polname-2-polname-gcd" id="id71"><tt class="docutils literal"><span class="pre">\PolGCD{polname_1}{polname_2}{polname_GCD}</span></tt></a></li>
<li><a class="reference internal" href="#poltosturm-polname-sturmname" id="id72"><tt class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></tt></a></li>
<li><a class="reference internal" href="#id10" id="id73"><tt class="docutils literal"><span class="pre">\PolToSturm*{polname}{sturmname}</span></tt></a></li>
<li><a class="reference internal" href="#polsettosturmchainsignchangesat-macro-sturmname-fraction" id="id74"><tt class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}</span></tt></a></li>
<li><a class="reference internal" href="#polsettonbofzeroswithin-macro-sturmname-value-a-value-b" id="id75"><tt class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmisolatezeros-sturmname" id="id76"><tt class="docutils literal">\PolSturmIsolateZeros{sturmname}</tt></a></li>
<li><a class="reference internal" href="#id12" id="id77"><tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{sturmname}</span></tt></a></li>
<li><a class="reference internal" href="#id14" id="id78"><tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmisolatezerosandgetmultiplicities-sturmname" id="id79"><tt class="docutils literal">\PolSturmIsolateZerosAndGetMultiplicities{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname" id="id80"><tt class="docutils literal">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname" id="id81"><tt class="docutils literal">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polrefineinterval-sturmname-index" id="id82"><tt class="docutils literal"><span class="pre">\PolRefineInterval*{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#polrefineinterval-n-sturmname-index" id="id83"><tt class="docutils literal"><span class="pre">\PolRefineInterval[N]{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#polensureintervallength-sturmname-index-e" id="id84"><tt class="docutils literal"><span class="pre">\PolEnsureIntervalLength{sturmname}{index}{E}</span></tt></a></li>
<li><a class="reference internal" href="#polensureintervallengths-sturmname-e" id="id85"><tt class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{sturmname}{E}</span></tt></a></li>
<li><a class="reference internal" href="#polprintintervals-varname-sturmname" id="id86"><tt class="docutils literal"><span class="pre">\PolPrintIntervals[varname]{sturmname}</span></tt></a><ul>
<li><a class="reference internal" href="#polprintintervalsnorealroots" id="id87"><tt class="docutils literal">\PolPrintIntervalsNoRealRoots</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsbeginenv" id="id88"><tt class="docutils literal">\PolPrintIntervalsBeginEnv</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsendenv" id="id89"><tt class="docutils literal">\PolPrintIntervalsEndEnv</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsknownroot" id="id90"><tt class="docutils literal">\PolPrintIntervalsKnownRoot</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsunknownroot" id="id91"><tt class="docutils literal">\PolPrintIntervalsUnknownRoot</tt></a></li>
<li><a class="reference internal" href="#id15" id="id92"><tt class="docutils literal">\PolPrintIntervalsPrintExactZero</tt></a></li>
<li><a class="reference internal" href="#id16" id="id93"><tt class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</tt></a></li>
<li><a class="reference internal" href="#id17" id="id94"><tt class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#id19" id="id95"><tt class="docutils literal"><span class="pre">\PolPrintIntervals*[varname]{sturmname}</span></tt></a><ul>
<li><a class="reference internal" href="#polprintintervalsprintmultiplicity" id="id96"><tt class="docutils literal">\PolPrintIntervalsPrintMultiplicity</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#polmapcoeffs-macro-polname" id="id97"><tt class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{polname}</span></tt></a></li>
<li><a class="reference internal" href="#polreducecoeffs-polname" id="id98"><tt class="docutils literal">\PolReduceCoeffs{polname}</tt></a></li>
<li><a class="reference internal" href="#id21" id="id99"><tt class="docutils literal"><span class="pre">\PolReduceCoeffs*{polname}</span></tt></a></li>
<li><a class="reference internal" href="#polmakemonic-polname" id="id100"><tt class="docutils literal">\PolMakeMonic{polname}</tt></a></li>
<li><a class="reference internal" href="#polmakeprimitive-polname" id="id101"><tt class="docutils literal">\PolMakePrimitive{polname}</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#expandable-macros" id="id102">Expandable macros</a><ul>
<li><a class="reference internal" href="#poleval-polname-atexpr-numerical-expression" id="id103"><tt class="docutils literal"><span class="pre">\PolEval{polname}\AtExpr{numerical</span> expression}</tt></a></li>
<li><a class="reference internal" href="#poleval-polname-at-fraction" id="id104"><tt class="docutils literal"><span class="pre">\PolEval{polname}\At{fraction}</span></tt></a></li>
<li><a class="reference internal" href="#polevalreduced-polname-atexpr-numerical-expression" id="id105"><tt class="docutils literal"><span class="pre">\PolEvalReduced{polname}\AtExpr{numerical</span> expression}</tt></a></li>
<li><a class="reference internal" href="#polevalreduced-polname-at-fraction" id="id106"><tt class="docutils literal"><span class="pre">\PolEvalReduced{polname}\At{fraction}</span></tt></a></li>
<li><a class="reference internal" href="#polfloateval-polname-atexpr-numerical-expression" id="id107"><tt class="docutils literal"><span class="pre">\PolFloatEval{polname}\AtExpr{numerical</span> expression}</tt></a></li>
<li><a class="reference internal" href="#polfloateval-polname-at-fraction" id="id108"><tt class="docutils literal"><span class="pre">\PolFloatEval{polname}\At{fraction}</span></tt></a></li>
<li><a class="reference internal" href="#polifcoeffisplusorminusone-a-b" id="id109"><tt class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{A}{B}</span></tt></a></li>
<li><a class="reference internal" href="#polleadingcoeff-polname" id="id110"><tt class="docutils literal">\PolLeadingCoeff{polname}</tt></a></li>
<li><a class="reference internal" href="#polnthcoeff-polname-number" id="id111"><tt class="docutils literal"><span class="pre">\PolNthCoeff{polname}{number}</span></tt></a></li>
<li><a class="reference internal" href="#poldegree-polname" id="id112"><tt class="docutils literal">\PolDegree{polname}</tt></a></li>
<li><a class="reference internal" href="#policontent-polname" id="id113"><tt class="docutils literal">\PolIContent{polname}</tt></a></li>
<li><a class="reference internal" href="#poltoexpr-polname" id="id114"><tt class="docutils literal">\PolToExpr{polname}</tt></a><ul>
<li><a class="reference internal" href="#poltoexproneterm-raw-coeff-number" id="id115"><tt class="docutils literal"><span class="pre">\PolToExprOneTerm{raw_coeff}{number}</span></tt></a></li>
<li><a class="reference internal" href="#poltoexpronetermstylea-raw-coeff-number" id="id116"><tt class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{raw_coeff}{number}</span></tt></a></li>
<li><a class="reference internal" href="#poltoexpronetermstyleb-raw-coeff-number" id="id117"><tt class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{raw_coeff}{number}</span></tt></a></li>
<li><a class="reference internal" href="#poltoexprcmd-raw-coeff" id="id118"><tt class="docutils literal">\PolToExprCmd{raw_coeff}</tt></a></li>
<li><a class="reference internal" href="#poltoexprtermprefix-raw-coeff" id="id119"><tt class="docutils literal">\PolToExprTermPrefix{raw_coeff}</tt></a></li>
<li><a class="reference internal" href="#id28" id="id120"><tt class="docutils literal">\PolToExprVar</tt></a></li>
<li><a class="reference internal" href="#id29" id="id121"><tt class="docutils literal">\PolToExprTimes</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#id31" id="id122"><tt class="docutils literal"><span class="pre">\PolToExpr*{polname}</span></tt></a></li>
<li><a class="reference internal" href="#poltofloatexpr-polname" id="id123"><tt class="docutils literal">\PolToFloatExpr{polname}</tt></a><ul>
<li><a class="reference internal" href="#poltofloatexproneterm-raw-coeff-number" id="id124"><tt class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{raw_coeff}{number}</span></tt></a></li>
<li><a class="reference internal" href="#poltofloatexprcmd-raw-coeff" id="id125"><tt class="docutils literal">\PolToFloatExprCmd{raw_coeff}</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#id35" id="id126"><tt class="docutils literal"><span class="pre">\PolToFloatExpr*{polname}</span></tt></a></li>
<li><a class="reference internal" href="#poltolist-polname" id="id127"><tt class="docutils literal">\PolToList{polname}</tt></a></li>
<li><a class="reference internal" href="#poltocsv-polname" id="id128"><tt class="docutils literal">\PolToCSV{polname}</tt></a></li>
<li><a class="reference internal" href="#polsturmchainlength-sturmname" id="id129"><tt class="docutils literal">\PolSturmChainLength{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-a-b" id="id130"><tt class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmisolatedzeroleft-sturmname-index" id="id131"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index" id="id132"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index" id="id133"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname" id="id134"><tt class="docutils literal">\PolSturmNbOfIsolatedZeros{sturmname}</tt></a><ul>
<li><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value" id="id135"><tt class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression" id="id136"><tt class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value" id="id137"><tt class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression" id="id138"><tt class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#polsturmnbofrationalroots-sturmname" id="id139"><tt class="docutils literal">\PolSturmNbOfRationalRoots{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname" id="id140"><tt class="docutils literal">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</tt></a></li>
<li><a class="reference internal" href="#polsturmrationalroot-sturmname-k" id="id141"><tt class="docutils literal"><span class="pre">\PolSturmRationalRoot{sturmname}{k}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k" id="id142"><tt class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{sturmname}{k}</span></tt></a></li>
<li><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k" id="id143"><tt class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{sturmname}{k}</span></tt></a></li>
<li><a class="reference internal" href="#polintervalwidth-sturmname-index" id="id144"><tt class="docutils literal"><span class="pre">\PolIntervalWidth{sturmname}{index}</span></tt></a></li>
<li><a class="reference internal" href="#expandable-macros-for-use-within-execution-of-polprintintervals" id="id145">Expandable macros for use within execution of <tt class="docutils literal">\PolPrintIntervals</tt></a><ul>
<li><a class="reference internal" href="#polprintintervalsthevar" id="id146"><tt class="docutils literal">\PolPrintIntervalsTheVar</tt></a></li>
<li><a class="reference internal" href="#polprintintervalstheindex" id="id147"><tt class="docutils literal">\PolPrintIntervalsTheIndex</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsthesturmname" id="id148"><tt class="docutils literal">\PolPrintIntervalsTheSturmName</tt></a></li>
<li><a class="reference internal" href="#polprintintervalstheleftendpoint" id="id149"><tt class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</tt></a></li>
<li><a class="reference internal" href="#polprintintervalstherightendpoint" id="id150"><tt class="docutils literal">\PolPrintIntervalsTheRightEndPoint</tt></a></li>
<li><a class="reference internal" href="#polprintintervalsthemultiplicity" id="id151"><tt class="docutils literal">\PolPrintIntervalsTheMultiplicity</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#poldectostring-decimal-number" id="id152"><tt class="docutils literal">\PolDecToString{decimal number}</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#booleans-with-default-setting-as-indicated" id="id153">Booleans (with default setting as indicated)</a><ul>
<li><a class="reference internal" href="#xintverbosefalse" id="id154"><tt class="docutils literal">\xintverbosefalse</tt></a></li>
<li><a class="reference internal" href="#poltypesetallfalse" id="id155"><tt class="docutils literal">\poltypesetallfalse</tt></a></li>
<li><a class="reference internal" href="#poltoexprallfalse" id="id156"><tt class="docutils literal">\poltoexprallfalse</tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#polexprsetup" id="id157"><tt class="docutils literal">\polexprsetup</tt></a></li>
<li><a class="reference internal" href="#technicalities" id="id158">Technicalities</a></li>
<li><a class="reference internal" href="#change-log" id="id159">CHANGE LOG</a></li>
<li><a class="reference internal" href="#acknowledgments" id="id160">Acknowledgments</a></li>
</ul>
</div>
<div class="section" id="basic-syntax">
<h1><a class="toc-backref" href="#id38">Basic syntax</a></h1>
<p>The syntax is:</p>
<pre class="literal-block">
\poldef polname(x):= expression in variable x;
</pre>
<p>where:</p>
<ul class="simple">
<li>in place of <tt class="docutils literal">x</tt> an arbitrary <em>dummy variable</em> is authorized,
i.e. per default any of <tt class="docutils literal"><span class="pre">[a-z|A-Z]</span></tt> (more letters can be declared
under Unicode engines.)</li>
<li><tt class="docutils literal">polname</tt> consists of letters, digits, and the <tt class="docutils literal">_</tt> and
<tt class="docutils literal">'</tt> characters. It must start with a letter.</li>
</ul>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last">The <tt class="docutils literal">'</tt> is authorized since <tt class="docutils literal">0.5.1</tt>. As a result some constructs
recognized by the <tt class="docutils literal">\xintexpr</tt> parser, such as <tt class="docutils literal">var1 'and' var2</tt>
will get misinterpreted and cause errors. However these constructs
are unlikely to be frequently needed in polynomial expressions, and
the <tt class="docutils literal">\xintexpr</tt> syntax offers alternatives, so it was deemed a
small evil. Of course the <tt class="docutils literal">\xintexpr</tt> parser is modified only
temporarily during execution of <tt class="docutils literal">\poldef</tt>.</p>
</div>
<p>One can also issue:</p>
<pre class="literal-block">
\PolDef{polname}{expression in variable x}
</pre>
<p>which admits an optional first argument to modify the variable letter
from its default <tt class="docutils literal">x</tt>.</p>
<dl class="docutils">
<dt><tt class="docutils literal">\poldef <span class="pre">f(x):=</span> <span class="pre">1-x+x^2;</span></tt></dt>
<dd>defines polynomial <tt class="docutils literal">f</tt>. Polynomial names must start with a
letter and may contain letters, digits, underscores and the right
tick character. The
variable must be a single letter. The colon character is optional.
The semi-colon at end of expression is mandatory.</dd>
<dt><tt class="docutils literal"><span class="pre">\PolDef{f}{1-x+x^2}</span></tt></dt>
<dd>does the same as <tt class="docutils literal">\poldef <span class="pre">f(x):=</span> <span class="pre">1-x+x^2;</span></tt> To use another letter
than <tt class="docutils literal">x</tt> in the expression, one must pass it as an extra optional
argument to <tt class="docutils literal">\PolDef</tt>. Useful if the semi-colon has been assigned
some non-standard catcode by some package.</dd>
<dt><tt class="docutils literal"><span class="pre">\PolLet{g}={f}</span></tt></dt>
<dd>saves a copy of <tt class="docutils literal">f</tt> under name <tt class="docutils literal">g</tt>. Also usable without <tt class="docutils literal">=</tt>.</dd>
<dt><tt class="docutils literal">\poldef <span class="pre">f(z):=</span> <span class="pre">f(z)^2;</span></tt></dt>
<dd>redefines <tt class="docutils literal">f</tt> in terms of itself.</dd>
<dt><tt class="docutils literal">\poldef <span class="pre">f(T):=</span> <span class="pre">f(f(T));</span></tt></dt>
<dd>again redefines <tt class="docutils literal">f</tt> in terms of its (new) self.</dd>
<dt><tt class="docutils literal">\poldef <span class="pre">k(z):=</span> <span class="pre">f(z)-g(g(z)^2)^2;</span></tt></dt>
<dd>should now define the zero polynomial... Let's check:
<tt class="docutils literal">\[ k(z) = <span class="pre">\PolTypeset[z]{k}</span> \]</tt></dd>
<dt><tt class="docutils literal"><span class="pre">\PolDiff{f}{f'}</span></tt></dt>
<dd>sets <tt class="docutils literal">f'</tt> to the derivative of <tt class="docutils literal">f</tt>. The name doesn't have to be
<tt class="docutils literal">f'</tt> (in fact the <tt class="docutils literal">'</tt> is licit only since <tt class="docutils literal">0.5.1</tt>).</dd>
</dl>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">This is not done automatically. If some new definition needs to use
the derivative of some available polynomial, that derivative
polynomial must have been defined via <tt class="docutils literal">\PolDiff</tt>: something like
<tt class="docutils literal"><span class="pre">T'(x)^2</span></tt> will not work without a prior <tt class="docutils literal"><span class="pre">\PolDiff{T}{T'}</span></tt>.</p>
</div>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">\PolDiff{f'}{f''}</span></tt></dt>
<dd>obtains second derivative.</dd>
<dt><tt class="docutils literal"><span class="pre">\PolDiff[3]{f}{f'''}</span></tt></dt>
<dd>computes the third derivative.</dd>
</dl>
<pre class="literal-block">
$f(z)   = \PolTypeset[z]{f}    $\newline
$f'(z)  = \PolTypeset[z]{f'}   $\newline
$f''(z) = \PolTypeset[z]{f''}  $\newline
$f'''(z)= \PolTypeset[z]{f'''} $\par
</pre>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p>The package does not currently know rational functions: <tt class="docutils literal">/</tt> in
a parsed polynomial expression does the Euclidean quotient:</p>
<pre class="literal-block">
(1-x^2)/(1-x)
</pre>
<p>does give <tt class="docutils literal">1+x</tt> but</p>
<pre class="literal-block">
(1/(1-x))*(1-x^2)
</pre>
<p>evaluates to zero. This will work as expected:</p>
<pre class="last literal-block">
\poldef k(x):= (x-1)(x-2)(x-3)(x-4)/(x^2-5x+4);
</pre>
</div>
<div class="admonition attention" id="warningtacit">
<p class="first admonition-title">Attention!</p>
<p><tt class="docutils literal">1/2 x^2</tt> skips the space and is treated like <tt class="docutils literal"><span class="pre">1/(2*x^2)</span></tt> because
of the tacit multiplication rules of xintexpr. But this means it
gives zero! Thus one must use <tt class="docutils literal">(1/2)x^2</tt> or <tt class="docutils literal">1/2*x^2</tt> or
<tt class="docutils literal"><span class="pre">(1/2)*x^2</span></tt> for disambiguation: <tt class="docutils literal">x - 1/2*x^2 + <span class="pre">1/3*x^3...</span></tt>. It is
even simpler to move the denominator to the right: <tt class="docutils literal">x - x^2/2 +
x^3/3 - ...</tt>.</p>
<p class="last">It is worth noting that <tt class="docutils literal"><span class="pre">1/2(x-1)(x-2)</span></tt> suffers the same issue:
<a class="reference external" href="http://www.ctan.org/pkg/xint">xint</a> tacit multiplication always &quot;ties more&quot;, hence this gets
interpreted as <tt class="docutils literal"><span class="pre">1/(2*(x-1)*(x-2))</span></tt> which gives zero by polynomial
division. Thus, use one of <tt class="docutils literal"><span class="pre">(1/2)(x-1)(x-2)</span></tt>, <tt class="docutils literal"><span class="pre">1/2*(x-1)(x-2)</span></tt> or
<tt class="docutils literal"><span class="pre">(x-1)(x-2)/2</span></tt>.</p>
</div>
<p>After:</p>
<pre class="literal-block">
\poldef f_1(x):= 25(x-1)(x^2-2)(x-3)(x-4)(x-5);%
\poldef f_2(x):= 37(x-1)(x^2-2)(x-6)(x-7)(x-8);%
</pre>
<p>the macro call <tt class="docutils literal"><span class="pre">\PolGCD{f_1}{f_2}{k}</span></tt> sets <tt class="docutils literal">k</tt> to the (unitary) GCD of
<tt class="docutils literal">f_1</tt> and <tt class="docutils literal">f_2</tt> (hence to the expansion of <tt class="docutils literal"><span class="pre">(x-1)(x^2-2)</span></tt>.)</p>
<dl class="docutils">
<dt><tt class="docutils literal">\PolToExpr{k}</tt></dt>
<dd>will (expandably) give in this case <tt class="docutils literal"><span class="pre">x^3-x^2-2*x+2</span></tt>. This is
useful for console or file output (the syntax is Maple- and
PSTricks-compatible; the letter used in output can be
(non-expandably) changed via a redefinition of <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a>.)</dd>
<dt><tt class="docutils literal"><span class="pre">\PolToExpr*{k}</span></tt></dt>
<dd>gives ascending powers: <tt class="docutils literal"><span class="pre">2-2*x-x^2+x^3</span></tt>.</dd>
</dl>
</div>
<div class="section" id="examples-of-localization-of-roots">
<h1><a class="toc-backref" href="#id39">Examples of localization of roots</a></h1>
<ul>
<li><p class="first">To make printed decimal numbers more enjoyable than via
<tt class="docutils literal">\xintSignedFrac</tt>:</p>
<pre class="literal-block">
\renewcommand\PolTypesetOne[1]{\PolDecToString{\xintREZ{#1}}}%
</pre>
<p><tt class="docutils literal">\PolDecToString</tt> will use decimal notation to incorporate the power
of ten part; and the <tt class="docutils literal">\xintREZ</tt> will have the effect to suppress
trailing zeros if present in raw numerator (if those digits end up
after decimal mark.) Notice that the above are expandable macros and
that one can also do:</p>
<pre class="literal-block">
\renewcommand\PolToExprCmd[1]{\PolDecToString{\xintREZ{#1}}}%
</pre>
<p>to modify output of <a class="reference internal" href="#poltoexpr-polname">\PolToExpr{polname}</a>.</p>
</li>
<li><p class="first">For extra info in log file use <tt class="docutils literal">\xintverbosetrue</tt>.</p>
</li>
<li><p class="first">Only for some of these examples is the output included here.</p>
</li>
</ul>
<div class="section" id="a-typical-example">
<h2><a class="toc-backref" href="#id40">A typical example</a></h2>
<p>In this example the polynomial is square-free.</p>
<pre class="literal-block">
\poldef f(x) := x^7 - x^6 - 2x + 1;

\PolToSturm{f}{f}
\PolSturmIsolateZeros{f}
The \PolTypeset{f} polynomial has \PolSturmNbOfIsolatedZeros{f} distinct real
roots which are located in the following intervals:
\PolPrintIntervals{f}
Here is the second root with ten more decimal digits:
\PolRefineInterval[10]{f}{2}
\[\PolSturmIsolatedZeroLeft{f}{2}&lt;Z_2&lt;\PolSturmIsolatedZeroRight{f}{2}\]
And here is the first root with twenty digits after decimal mark:
\PolEnsureIntervalLength{f}{1}{-20}
\[\PolSturmIsolatedZeroLeft{f}{1}&lt;Z_1&lt;\PolSturmIsolatedZeroRight{f}{1}\]
The first element of the Sturm chain has degree $\PolDegree{f_0}$. As
this is the original degreee $\PolDegree{f}$ we know that $f$ is square free.
Its derivative is up to a constant \PolTypeset{f_1} (in this example
it is identical with it).
\PolToSturm{f_1}{f_1}\PolSturmIsolateZeros{f_1}%
The derivative has \PolSturmNbOfIsolatedZeros{f_1} distinct real
roots:
\PolPrintIntervals[W]{f_1}
\PolEnsureIntervalLengths{f_1}{-10}%
Here they are with ten digits after decimal mark:
\PolPrintIntervals[W]{f_1}
\PolDiff{f_1}{f''}
\PolToSturm{f''}{f''}
\PolSturmIsolateZeros{f''}
The second derivative is \PolTypeset{f''}.
It has \PolSturmNbOfIsolatedZeros{f''} distinct real
roots:
\PolPrintIntervals[X]{f''}
Here is the positive one with 20 digits after decimal mark:
\PolEnsureIntervalLength{f''}{2}{-20}%
\[X_2 = \PolSturmIsolatedZeroLeft{f''}{2}\dots\]
The more mathematically advanced among our dear readers will be able
to give the exact value for $X_2$!
</pre>
</div>
<div class="section" id="a-degree-four-polynomial-with-nearby-roots">
<h2><a class="toc-backref" href="#id41">A degree four polynomial with nearby roots</a></h2>
<p>Notice that this example is a bit outdated as <tt class="docutils literal">0.7</tt> release has
added <tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></tt> which would find exactly
the roots. The steps here retain their interest when one is interested
in finding isolating intervals for example to prepare some demonstration
of dichotomy method.</p>
<pre class="literal-block">
\PolDef{Q}{(x-1.050001)(x-1.105001)(x-1.110501)(x-1.111051)}
\PolTypeset{Q}
\PolToSturm{Q}{Q} % it is allowed to use same prefix for Sturm chain
\PolSturmIsolateZeros{Q}
\PolPrintIntervals{Q}
% reports 1.0 &lt; Z_1 &lt; 1.1, 1.10 &lt; Z_2 &lt; 1.11, 1.110 &lt; Z_3 &lt; 1.111, and 1.111 &lt; Z_4 &lt; 1.112
% but the above bounds do not allow minimizing separation between roots
% so we refine:
\PolRefineInterval*{Q}{1}
\PolRefineInterval*{Q}{2}
\PolRefineInterval*{Q}{3}
\PolRefineInterval*{Q}{4}
\PolPrintIntervals{Q}
% reports 1.05 &lt; Z_1 &lt; 1.06, 1.105 &lt; Z_2 &lt; 1.106, 1.1105 &lt; Z_3 &lt; 1.1106,
% and 1.11105 &lt; Z_4 &lt; 1.11106.
\PolEnsureIntervalLengths{Q}{-6}
\PolPrintIntervals{Q}
% of course finds here all roots exactly
</pre>
</div>
<div class="section" id="the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">
<h2><a class="toc-backref" href="#id42">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></h2>
<pre class="literal-block">
% define a user command (xinttools is loaded automatically by polexpr)
\newcommand\showmultiplicities[1]{% #1 = &quot;sturmname&quot;
\xintFor* ##1 in {\xintSeq{1}{\PolSturmNbOfIsolatedZeros{#1}}}\do{%
    The multiplicity is \PolSturmIsolatedZeroMultiplicity{#1}{##1}
    \PolSturmIfZeroExactlyKnown{#1}{##1}%
    {at the root $x=\PolSturmIsolatedZeroLeft{#1}{##1}$}
    {for the root such that
    $\PolSturmIsolatedZeroLeft{#1}{##1}&lt;x&lt;\PolSturmIsolatedZeroRight{#1}{##1}$}
    \par
}}%
\PolDef{f}{(x-0.99)^3(x-0.999)^3(x-0.9999)^3}
\renewcommand\PolTypesetOne[1]{\PolDecToString{\xintREZ{#1}}}
\PolTypeset{f}\par
\PolToSturm{f}{f}% it is allowed to use &quot;polname&quot; as &quot;sturmname&quot; too
\PolSturmIsolateZerosAndGetMultiplicities{f}% use the &quot;sturmname&quot; here
% or \PolSturmIsolateZeros*{f} which is exactly the same, but shorter..

\showmultiplicities{f}
</pre>
<p>In this example, the output will look like this (but using math mode):</p>
<pre class="literal-block">
x^9 - 8.9667x^8 + 35.73400293x^7 - 83.070418400109x^6 + 124.143648875193123x^5
- 123.683070924326075877x^4 + 82.149260397553075617891x^3
- 35.07602992699900159127007x^2 + 8.7364078733314648368671733x
- 0.967100824643585986488103299

The multiplicity is 3 at the root x = 0.99
The multiplicity is 3 at the root x = 0.999
The multiplicity is 3 at the root x = 0.9999
</pre>
<p>On first pass, these rational roots were found (due to their relative
magnitudes, using <tt class="docutils literal">\PolSturmIsolateZeros**</tt> was not needed here). But
multiplicity computation works also with (decimal) roots not yet
identified or with non-decimal or irrational roots.</p>
<p>It is fun to modify only a tiny bit the polynomial and see if polexpr
survives:</p>
<pre class="literal-block">
\PolDef{g}{f(x)+1e-27}
\PolTypeset{g}\par
\PolToSturm{g}{g}
\PolSturmIsolateZeros*{g}

\showmultiplicities{g}
</pre>
<p>This produces:</p>
<pre class="literal-block">
x^9 - 8.9667x^8 + 35.73400293x^7 - 83.070418400109x^6 + 124.143648875193123x^5
- 123.683070924326075877x^4 + 82.149260397553075617891x^3
- 35.07602992699900159127007x^2 + 8.7364078733314648368671733x
- 0.967100824643585986488103298

The multiplicity is 1 for the root such that 0.98 &lt; x &lt; 0.99
The multiplicity is 1 for the root such that 0.9991 &lt; x &lt; 0.9992
The multiplicity is 1 for the root such that 0.9997 &lt; x &lt; 0.9998
</pre>
<p>Which means that the multiplicity-3 roots each became a real and a pair of
complex ones. Let's see them better:</p>
<pre class="literal-block">
\PolEnsureIntervalLengths{g}{-10}

\showmultiplicities{g}
</pre>
<p>which produces:</p>
<pre class="literal-block">
The multiplicity is 1 for the root such that 0.9899888032 &lt; x &lt; 0.9899888033
The multiplicity is 1 for the root such that 0.9991447980 &lt; x &lt; 0.9991447981
The multiplicity is 1 for the root such that 0.9997663986 &lt; x &lt; 0.9997663987
</pre>
</div>
<div class="section" id="a-degree-five-polynomial-with-three-rational-roots">
<h2><a class="toc-backref" href="#id43">A degree five polynomial with three rational roots</a></h2>
<pre class="literal-block">
\poldef Q(x) :=  1581755751184441 x^5
               -14907697165025339 x^4
               +48415668972339336 x^3
               -63952057791306264 x^2
               +46833913221154895 x
               -49044360626280925;

\PolToSturm{Q}{Q}
%\begin{flushleft}
  \renewcommand\PolTypesetCmdPrefix[1]{\allowbreak\xintiiifSgn{#1}{}{+}{+}}%
  $Q_0(x) = \PolTypeset{Q_0}$
%\end{flushleft}
\PolSturmIsolateZeros**{Q}
\PolPrintIntervals{Q}

$Q_{norr}(x) = \PolTypeset{Q_norr}$
</pre>
<p>Here, all real roots are rational:</p>
<pre class="literal-block">
Z_1 = 833719/265381
Z_2 = 165707065/52746197
Z_3 = 355/113

Q_norr(x) = x^2 + 1
</pre>
<p>And let's get their decimal expansion too:</p>
<pre class="literal-block">
% print decimal expansion of the found roots
\renewcommand\PolPrintIntervalsPrintExactZero
            {\xintTrunc{20}{\PolPrintIntervalsTheLeftEndPoint}\dots}
\PolPrintIntervals{Q}

Z_1 = 3.14159265358107777120...
Z_2 = 3.14159265358979340254...
Z_3 = 3.14159292035398230088...
</pre>
</div>
<div class="section" id="a-mignotte-type-polynomial">
<h2><a class="toc-backref" href="#id44">A Mignotte type polynomial</a></h2>
<pre class="literal-block">
\PolDef{P}{x^10 - (10x-1)^2}%
\PolTypeset{P}              % prints it in expanded form
\PolToSturm{P}{P}           % we can use same prefix for Sturm chain
\PolSturmIsolateZeros{P}    % finds 4 real roots
This polynomial has \PolSturmNbOfIsolatedZeros{P} distinct real roots:
\PolPrintIntervals{P}%
% reports  -2 &lt; Z_1 &lt; -1, 0.09 &lt; Z_2 &lt; 0.10, 0.1 &lt; Z_3 &lt; 0.2, 1 &lt; Z_4 &lt; 2
Let us refine the second and third intervals to separate the corresponding
roots:
\PolRefineInterval*{P}{2}% will refine to 0.0999990 &lt; Z_2 &lt; 0.0999991
\PolRefineInterval*{P}{3}% will refine to 0.100001 &lt; Z_3 &lt; 0.100002
\PolPrintIntervals{P}%
Let us now get to know all roots with 10 digits after decimal mark:
\PolEnsureIntervalLengths{P}{-10}%
\PolPrintIntervals{P}% now all roots are known 10 decimal digits after mark
Finally, we display 20 digits of the second root:
\PolEnsureIntervalLength{P}{2}{-20}% makes Z_2 known with 20 digits after mark
\[\PolSturmIsolatedZeroLeft{P}{2}&lt;Z_2&lt;\PolSturmIsolatedZeroRight{P}{2}\]
</pre>
<p>The last line produces:</p>
<pre class="literal-block">
0.09999900004999650028 &lt; Z_2 &lt; 0.09999900004999650029
</pre>
</div>
<div class="section" id="the-wilkinson-polynomial">
<h2><a class="toc-backref" href="#id45">The Wilkinson polynomial</a></h2>
<p>See <a class="reference external" href="https://en.wikipedia.org/wiki/Wilkinson%27s_polynomial">Wilkinson polynomial</a>.</p>
<pre class="literal-block">
\documentclass{article}
\usepackage{polexpr}
\begin{document}
%\xintverbosetrue % for the curious...

\poldef f(x) := mul((x - i), i = 1..20);

\renewcommand\PolTypesetCmdPrefix[1]{\allowbreak\xintiiifSgn{#1}{}{+}{+}}%
\renewcommand\PolTypesetOne[1]{\xintDecToString{#1}}%

\noindent\PolTypeset{f}

\PolToSturm{f}{f}
\PolSturmIsolateZeros{f}
\PolPrintIntervals{f}

\clearpage

\poldef g(x) := f(x) - 2**{-23} x**19;

% be patient!
\PolToSturm{g}{g}
\noindent\PolTypeset{g_0}% integer coefficient primitive polynomial

\PolSturmIsolateZeros{g}
\PolEnsureIntervalLengths{g}{-10}

\renewcommand\PolPrintIntervalsPrintMultiplicity{}
\PolPrintIntervals*{g}

\end{document}
</pre>
<p>The first polynomial:</p>
<pre class="literal-block">
f(x) = x**20
- 210 x**19
+ 20615 x**18
- 1256850 x**17
+ 53327946 x**16
- 1672280820 x**15
+ 40171771630 x**14
- 756111184500 x**13
+ 11310276995381 x**12
- 135585182899530 x**11
+ 1307535010540395 x**10
- 10142299865511450 x**9
+ 63030812099294896 x**8
- 311333643161390640 x**7
+ 1206647803780373360 x**6
- 3599979517947607200 x**5
+ 8037811822645051776 x**4
- 12870931245150988800 x**3
+ 13803759753640704000 x**2
- 8752948036761600000 x
+ 2432902008176640000
</pre>
<p>is handled fast enough (a few seconds), but the modified one <tt class="docutils literal">f(x) -
<span class="pre">2**-23</span> <span class="pre">x**19</span></tt> takes about 20x longer (the Sturm chain polynomials
have integer coefficients with up to 321 digits, whereas (surprisingly
perhaps) those of the Sturm chain polynomials derived from <tt class="docutils literal">f</tt> never
have more than 21 digits ...).</p>
<p>Once the Sturm chain is computed and the zeros isolated, obtaining their
decimal digits is relatively faster. Here is for the ten real roots of
<tt class="docutils literal">f(x) - <span class="pre">2**-23</span> <span class="pre">x**19</span></tt> as computed by the code above:</p>
<pre class="literal-block">
Z_1 = 0.9999999999...
Z_2 = 2.0000000000...
Z_3 = 2.9999999999...
Z_4 = 4.0000000002...
Z_5 = 4.9999999275...
Z_6 = 6.0000069439...
Z_7 = 6.9996972339...
Z_8 = 8.0072676034...
Z_9 = 8.9172502485...
Z_10 = 20.8469081014...
</pre>
</div>
<div class="section" id="the-second-wilkinson-polynomial">
<h2><a class="toc-backref" href="#id46">The second Wilkinson polynomial</a></h2>
<pre class="literal-block">
\documentclass{article}
\usepackage{polexpr}
\begin{document}
\poldef f(x) := mul(x - 2^-i, i = 1..20);

%\PolTypeset{f}

\PolToSturm{f}{f}
\PolSturmIsolateZeros**{f}
\PolPrintIntervals{f}
\end{document}
</pre>
<p>This takes more time than the polynomial with 1, 2, .., 20 as roots but
less than the latter modified by the <tt class="docutils literal"><span class="pre">2**-23</span></tt> change in one
coefficient.</p>
<p>Here is the output (with release 0.7.2):</p>
<pre class="literal-block">
Z_1  = 0.00000095367431640625
Z_2  = 0.0000019073486328125
Z_3  = 0.000003814697265625
Z_4  = 0.00000762939453125
Z_5  = 0.0000152587890625
Z_6  = 0.000030517578125
Z_7  = 0.00006103515625
Z_8  = 0.0001220703125
Z_9  = 1/4096
Z_10 = 1/2048
Z_11 = 1/1024
Z_12 = 1/512
Z_13 = 1/256
Z_14 = 1/128
Z_15 = 0.015625
Z_16 = 0.03125
Z_17 = 0.0625
Z_18 = 0.125
Z_19 = 0.25
Z_20 = 0.5
</pre>
<p>There is some incoherence in output format which has its source in the
fact that some roots are found in branches which can only find decimal
roots, whereas some are found in branches which could find general
fractions and they use <tt class="docutils literal">\xintIrr</tt> before storage of the found root.
This may evolve in future.</p>
</div>
<div class="section" id="the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots">
<h2><a class="toc-backref" href="#id47">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></h2>
<pre class="literal-block">
\PolDef{P}{mul((x-i*1e-1), i=-20..20)}% i/10 is same but less efficient
</pre>
<p>In the defining expression we could have used <tt class="docutils literal">i/10</tt> but this gives
less efficient internal form for the coefficients (the <tt class="docutils literal">10</tt>'s end up
in denominators). Using <tt class="docutils literal">\PolToExpr{P}</tt> after having done</p>
<pre class="literal-block">
\renewcommand\PolToExprCmd[1]{\PolDecToString{\xintREZ{#1}}}
</pre>
<p>we get this expanded form:</p>
<pre class="literal-block">
x^41
-28.7*x^39
+375.7117*x^37
-2975.11006*x^35
+15935.28150578*x^33
-61167.527674162*x^31
+173944.259366417394*x^29
-373686.963560544648*x^27
+613012.0665016658846445*x^25
-771182.31133138163125495*x^23
+743263.86672885754888959569*x^21
-545609.076599482896371978698*x^19
+301748.325708943677229642930528*x^17
-123655.8987669450434698869844544*x^15
+36666.1782054884005855608205864192*x^13
-7607.85821367459445649518380016128*x^11
+1053.15135918687298508885950223794176*x^9
-90.6380005918141132650786081964032*x^7
+4.33701563847327366842552218288128*x^5
-0.0944770968420804735498178265088*x^3
+0.00059190121813899276854174416896*x
</pre>
<p>which shows coefficients with up to 36 significant digits...</p>
<p>Stress test: not a hard challenge to <tt class="docutils literal">xint + polexpr</tt>, but be a bit patient!</p>
<pre class="literal-block">
\PolDef{P}{mul((x-i*1e-1), i=-20..20)}%
\PolToSturm{P}{S}           % dutifully computes S_0, ..., S_{41}
% the [1] optional argument limits the search to interval (-10,10)
\PolSturmIsolateZeros[1]{S} % finds *exactly* (but a bit slowly) all 41 roots!
\PolPrintIntervals{S}       % nice, isn't it?
</pre>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Release <tt class="docutils literal">0.5</tt> has <em>experimental</em> addition of optional argument
<tt class="docutils literal">E</tt> to <tt class="docutils literal">\PolSturmIsolateZeros</tt>. It instructs to search roots only
in interval <tt class="docutils literal"><span class="pre">(-10^E,</span> 10^E)</tt>. Important: the extremities are
<em>assumed to not be roots</em>. In this example, the <tt class="docutils literal">[1]</tt> in
<tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros[1]{S}</span></tt> gives some speed gain; without it, it
turns out in this case that <tt class="docutils literal">polexpr</tt> would have started with
<tt class="docutils literal"><span class="pre">(-10^6,</span> 10^6)</tt> interval.</p>
<p class="last">Please note that this will probably get replaced in future by the
specification of a general interval. Do not rely on meaning of this
optional argument keeping the same.</p>
</div>
</div>
<div class="section" id="roots-of-chebyshev-polynomials">
<h2><a class="toc-backref" href="#id48">Roots of Chebyshev polynomials</a></h2>
<pre class="literal-block">
\newcount\mycount
\poldef T_0(x) := 1;
\poldef T_1(x) := x;
\mycount 2
\xintloop
  \poldef T_\the\mycount(x) :=
          2x*T_\the\numexpr\mycount-1(x)
           - T_\the\numexpr\mycount-2(x);
\ifnum\mycount&lt;15
\advance\mycount 1
\repeat

\[T_{15} = \PolTypeset[X]{T_15}\]
\PolToSturm{T_15}{T_15}
\PolSturmIsolateZeros{T_15}
\PolEnsureIntervalLengths{T_15}{-10}
\PolPrintIntervals{T_15}
</pre>
</div>
</div>
<div class="section" id="non-expandable-macros">
<h1><a class="toc-backref" href="#id49">Non-expandable macros</a></h1>
<div class="section" id="poldef-polname-letter-expression-in-letter">
<span id="poldef"></span><h2><a class="toc-backref" href="#id50"><tt class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression in letter;</tt></a></h2>
<blockquote>
<p>This evaluates the <em>polynomial expression</em> and stores the coefficients
in a private structure accessible later via other package macros,
under the user-chosen <tt class="docutils literal">polname</tt>. Of course the <em>expression</em> can
use other previously defined polynomials. Names must start with a
letter and are constituted of letters, digits, underscores and
(since <tt class="docutils literal">0.5.1</tt>) the right tick <tt class="docutils literal">'</tt>.
The whole <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> syntax is authorized:</p>
<pre class="literal-block">
\poldef sin(z) := add((-1)^i z^(2i+1)/(2i+1)!, i = 0..10);
</pre>
<p>With fractional coefficients, beware the <a class="reference internal" href="#warningtacit">tacit multiplication issue</a>.</p>
<p>As a side effect the function <tt class="docutils literal">polname()</tt> is recognized as a
genuine <tt class="docutils literal"><span class="pre">\xintexpr...\relax</span></tt> function for (exact) numerical
evaluation (or within an <tt class="docutils literal">\xintdefvar</tt> assignment.) It computes
values not according to the original expression but via the Horner
scheme corresponding to the polynomial coefficients.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p>Release <tt class="docutils literal">0.3</tt> also did the necessary set-up to let the
polynomial be known to the <tt class="docutils literal">\xintfloatexpr</tt> (or
<tt class="docutils literal">\xintdeffloatvar</tt>) parser.</p>
<p>Since <tt class="docutils literal">0.4</tt> this isn't done automatically. Even more, a
previously existing floating point variant of the same name will
be let undefined again, to avoid hard to debug mismatches between
exact and floating point polynomials. This also applies when the
polynomial is produced not via <tt class="docutils literal">\poldef</tt> or <tt class="docutils literal">\PolDef</tt> but as
a product of the other package macros.</p>
<p class="last">See <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>.</p>
</div>
<p>The original expression is lost after parsing, and in particular
the package provides no way to typeset it. This has to be done
manually, if needed.</p>
</blockquote>
</div>
<div class="section" id="poldef-letter-polname-expression-in-letter">
<span id="id2"></span><h2><a class="toc-backref" href="#id51"><tt class="docutils literal"><span class="pre">\PolDef[letter]{polname}{expression</span> in letter}</tt></a></h2>
<blockquote>
Does the same as <a class="reference external" href="poldef;">\poldef</a> in an undelimited macro
format (thus avoiding potential problems with the catcode of the
semi-colon in presence of some packages.) In absence of the
<tt class="docutils literal">[letter]</tt> optional argument, the variable is assumed to be <tt class="docutils literal">x</tt>.</blockquote>
</div>
<div class="section" id="polgenfloatvariant-polname">
<span id="polgenfloatvariant"></span><h2><a class="toc-backref" href="#id52"><tt class="docutils literal">\PolGenFloatVariant{polname}</tt></a></h2>
<blockquote>
<p>Makes the polynomial also usable in the <tt class="docutils literal">\xintfloatexpr</tt> parser.
It will therein evaluates via an Horner scheme with coefficients
already pre-rounded to the float precision.</p>
<p>See also <a class="reference internal" href="#poltofloatexpr-polname">\PolToFloatExpr{polname}</a>.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p>Release <tt class="docutils literal">0.3</tt> did this automatically on <tt class="docutils literal">\PolDef</tt> and
<tt class="docutils literal">\poldef</tt> but this was removed at <tt class="docutils literal">0.4</tt> for optimization.</p>
<p class="last">Any operation, for example generating the derivative polynomial,
or dividing two polynomials or using the <tt class="docutils literal">\PolLet</tt>, <strong>must</strong> be
followed by explicit usage of <tt class="docutils literal">\PolGenFloatVariant{polname}</tt> if
the new polynomial is to be used in <tt class="docutils literal">\xintfloatexpr</tt> or alike
context.</p>
</div>
</blockquote>
</div>
<div class="section" id="pollet-polname-2-polname-1">
<span id="pollet"></span><h2><a class="toc-backref" href="#id53"><tt class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></tt></a></h2>
<blockquote>
Makes a copy of the already defined polynomial <tt class="docutils literal">polname_1</tt> to a
new one <tt class="docutils literal">polname_2</tt>. Same effect as
<tt class="docutils literal"><span class="pre">\PolDef{polname_2}{polname_1(x)}</span></tt> but with less overhead. The
<tt class="docutils literal">=</tt> is optional.</blockquote>
</div>
<div class="section" id="polgloballet-polname-2-polname-1">
<span id="polgloballet"></span><h2><a class="toc-backref" href="#id54"><tt class="docutils literal"><span class="pre">\PolGlobalLet{polname_2}={polname_1}</span></tt></a></h2>
<blockquote>
Acts globally.</blockquote>
</div>
<div class="section" id="polassign-polname-toarray-macro">
<span id="polassign"></span><h2><a class="toc-backref" href="#id55"><tt class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></tt></a></h2>
<blockquote>
<p>Defines a one-argument expandable macro <tt class="docutils literal"><span class="pre">\macro{#1}</span></tt> which expands
to the (raw) #1th polynomial coefficient.</p>
<ul class="simple">
<li>Attention, coefficients here are indexed starting at 1.</li>
<li>With #1=-1, -2, ..., <tt class="docutils literal"><span class="pre">\macro{#1}</span></tt> returns leading coefficients.</li>
<li>With #1=0, returns the number of coefficients, i.e. <tt class="docutils literal">1 + deg f</tt>
for non-zero polynomials.</li>
<li>Out-of-range #1's return <tt class="docutils literal">0/1[0]</tt>.</li>
</ul>
<p>See also <a class="reference internal" href="#polnthcoeff-polname-number">\PolNthCoeff{polname}{number}</a>. The main difference is that
with <tt class="docutils literal">\PolAssign</tt>, <tt class="docutils literal">\macro</tt> is made a prefix to <tt class="docutils literal">1 + deg f</tt>
already defined (hidden to user) macros holding individually the
coefficients but <a class="reference internal" href="#polnthcoeff-polname-number">\PolNthCoeff{polname}{number}</a> does each time the job
to expandably recover the <tt class="docutils literal">Nth</tt> coefficient, and due to
expandability can not store it in a macro for future usage (of course,
it can be an argument in an <tt class="docutils literal">\edef</tt>.) The other difference
is the shift by one in indexing, mentioned above (negative
indices act the same in both.)</p>
</blockquote>
</div>
<div class="section" id="polget-polname-fromarray-macro">
<span id="polget"></span><h2><a class="toc-backref" href="#id56"><tt class="docutils literal"><span class="pre">\PolGet{polname}\fromarray\macro</span></tt></a></h2>
<blockquote>
<p>Does the converse operation to
<tt class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></tt>. Each individual
<tt class="docutils literal">\macro{number}</tt> gets expanded in an <tt class="docutils literal">\edef</tt> and then normalized
via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <tt class="docutils literal">\xintRaw</tt>.</p>
<p>The leading zeros are removed from the polynomial.</p>
<p>(contrived) Example:</p>
<pre class="literal-block">
\xintAssignArray{1}{-2}{5}{-3}\to\foo
\PolGet{f}\fromarray\foo
</pre>
<p>This will define <tt class="docutils literal">f</tt> as would have <tt class="docutils literal">\poldef <span class="pre">f(x):=1-2x+5x^2-3x^3;</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Prior to <tt class="docutils literal">0.5</tt>, coefficients were not normalized via
<tt class="docutils literal">\xintRaw</tt> for internal storage.</p>
</div>
</blockquote>
</div>
<div class="section" id="polfromcsv-polname-csv">
<span id="polfromcsv"></span><h2><a class="toc-backref" href="#id57"><tt class="docutils literal"><span class="pre">\PolFromCSV{polname}{&lt;csv&gt;}</span></tt></a></h2>
<blockquote>
<p>Defines a polynomial directly from the comma separated list of values
(or a macro expanding to such a list) of its coefficients, the <em>first
item</em> gives the constant term, the <em>last item</em> gives the leading
coefficient, except if zero, then it is dropped (iteratively). List
items are each expanded in an <tt class="docutils literal">\edef</tt> and then put into normalized
form via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <tt class="docutils literal">\xintRaw</tt>.</p>
<p>As leading zero coefficients are removed:</p>
<pre class="literal-block">
\PolFromCSV{f}{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
</pre>
<p>defines the zero polynomial, which holds only one coefficient.</p>
<p>See also expandable macro <a class="reference internal" href="#poltocsv-polname">\PolToCSV</a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Prior to <tt class="docutils literal">0.5</tt>, coefficients were not normalized via
<tt class="docutils literal">\xintRaw</tt> for internal storage.</p>
</div>
</blockquote>
</div>
<div class="section" id="poltypeset-polname">
<span id="poltypeset"></span><h2><a class="toc-backref" href="#id58"><tt class="docutils literal">\PolTypeset{polname}</tt></a></h2>
<blockquote>
<p>Typesets in descending powers in math mode. It uses letter <tt class="docutils literal">x</tt> but
this can be changed via an optional argument:</p>
<pre class="literal-block">
\PolTypeset[z]{polname}
</pre>
<p>By default zero coefficients are skipped (issue <tt class="docutils literal">\poltypesetalltrue</tt>
to get all of them in output).</p>
<p>These commands (whose meanings will be found in the package code)
can be re-defined for customization. Their default definitions are
expandable, but this is not a requirement.</p>
</blockquote>
<div class="section" id="poltypesetcmd-raw-coeff">
<span id="poltypesetcmd"></span><h3><a class="toc-backref" href="#id59"><tt class="docutils literal">\PolTypesetCmd{raw_coeff}</tt></a></h3>
<blockquote>
<p>Checks if the coefficient is <tt class="docutils literal">1</tt> or <tt class="docutils literal"><span class="pre">-1</span></tt> and then skips printing
the <tt class="docutils literal">1</tt>, except for the constant term. Also it sets conditional
<a class="reference internal" href="#polifcoeffisplusorminusone-a-b">\PolIfCoeffIsPlusOrMinusOne{A}{B}</a>.</p>
<p>The actual printing of the coefficients, when not equal to plus or
minus one is handled by <a class="reference internal" href="#poltypesetone-raw-coeff">\PolTypesetOne{raw_coeff}</a>.</p>
</blockquote>
</div>
<div class="section" id="poltypesetone-raw-coeff">
<span id="poltypesetone"></span><h3><a class="toc-backref" href="#id60"><tt class="docutils literal">\PolTypesetOne{raw_coeff}</tt></a></h3>
<blockquote>
<p>The default is <tt class="docutils literal">\xintSignedFrac</tt> but this macro is annoying as it
insists to use a power of ten, and not decimal notation.</p>
<p>One can do things such as for example: <a class="footnote-reference" href="#id5" id="id4">[1]</a></p>
<pre class="literal-block">
\renewcommand\PolTypesetOne[1]{\num{\xintPFloat[5]{#1}}}
\renewcommand\PolTypesetOne[1]{\num{\xintRound{4}{#1}}}
</pre>
<p>where e.g. we used the <tt class="docutils literal">\num</tt> macro of <tt class="docutils literal">siunitx</tt> as it
understands floating point notation.</p>
<table class="docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[1]</a></td><td>the difference in the syntaxes of <tt class="docutils literal">\xintPFloat</tt> and
<tt class="docutils literal">\xintRound</tt> is explained from the fact that
<tt class="docutils literal">\xintPFloat</tt> by default uses the prevailing precision
hence the extra argument like here <tt class="docutils literal">5</tt> is an optional one.</td></tr>
</tbody>
</table>
<p>One can also give a try to using <a class="reference internal" href="#poldectostring-decimal-number">\PolDecToString{decimal number}</a>
which uses decimal notation (at least for the numerator part).</p>
</blockquote>
</div>
<div class="section" id="id6">
<span id="poltypesetmonomialcmd"></span><h3><a class="toc-backref" href="#id61"><tt class="docutils literal">\PolTypesetMonomialCmd</tt></a></h3>
<blockquote>
This decides how a monomial (in variable <tt class="docutils literal">\PolVar</tt> and with
exponent <tt class="docutils literal">\PolIndex</tt>) is to be printed. The default does nothing
for the constant term, <tt class="docutils literal">\PolVar</tt> for the first degree and
<tt class="docutils literal"><span class="pre">\PolVar^{\PolIndex}</span></tt> for higher degrees monomials. Beware that
<tt class="docutils literal">\PolIndex</tt> expands to digit tokens and needs termination in
<tt class="docutils literal">\ifnum</tt> tests.</blockquote>
</div>
<div class="section" id="poltypesetcmdprefix-raw-coeff">
<span id="poltypesetcmdprefix"></span><h3><a class="toc-backref" href="#id62"><tt class="docutils literal">\PolTypesetCmdPrefix{raw_coeff}</tt></a></h3>
<blockquote>
Expands to a <tt class="docutils literal">+</tt> if the <tt class="docutils literal">raw_coeff</tt> is zero or positive, and to
nothing if <tt class="docutils literal">raw_coeff</tt> is negative, as in latter case the
<tt class="docutils literal">\xintSignedFrac</tt> used by <a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{raw_coeff}</a> will put
the <tt class="docutils literal">-</tt> sign in front of the fraction (if it is a fraction) and
this will thus serve as separator in the typeset formula. Not used
for the first term.</blockquote>
</div>
</div>
<div class="section" id="id8">
<span id="id7"></span><h2><a class="toc-backref" href="#id63"><tt class="docutils literal"><span class="pre">\PolTypeset*{polname}</span></tt></a></h2>
<blockquote>
Typesets in ascending powers. Use e.g. <tt class="docutils literal">[h]</tt> optional argument
(after the <tt class="docutils literal">*</tt>) to use letter <tt class="docutils literal">h</tt> rather than <tt class="docutils literal">x</tt>.</blockquote>
</div>
<div class="section" id="poldiff-polname-1-polname-2">
<span id="poldiff"></span><h2><a class="toc-backref" href="#id64"><tt class="docutils literal"><span class="pre">\PolDiff{polname_1}{polname_2}</span></tt></a></h2>
<blockquote>
<p>This sets <tt class="docutils literal">polname_2</tt> to the first derivative of <tt class="docutils literal">polname_1</tt>. It
is allowed to issue <tt class="docutils literal"><span class="pre">\PolDiff{f}{f}</span></tt>, effectively replacing <tt class="docutils literal">f</tt>
by <tt class="docutils literal">f'</tt>.</p>
<p>Coefficients of the result <tt class="docutils literal">polname_2</tt> are irreducible fractions
(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
</blockquote>
</div>
<div class="section" id="poldiff-n-polname-1-polname-2">
<span id="poldiff-n"></span><h2><a class="toc-backref" href="#id65"><tt class="docutils literal"><span class="pre">\PolDiff[N]{polname_1}{polname_2}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_2</tt> to the <tt class="docutils literal">N</tt>-th derivative of <tt class="docutils literal">polname_1</tt>.
Identical arguments is allowed. With <tt class="docutils literal">N=0</tt>, same effect as
<tt class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></tt>. With negative <tt class="docutils literal">N</tt>, switches to
using <tt class="docutils literal">\PolAntiDiff</tt>.</blockquote>
</div>
<div class="section" id="polantidiff-polname-1-polname-2">
<span id="polantidiff"></span><h2><a class="toc-backref" href="#id66"><tt class="docutils literal"><span class="pre">\PolAntiDiff{polname_1}{polname_2}</span></tt></a></h2>
<blockquote>
<p>This sets <tt class="docutils literal">polname_2</tt> to the primitive of <tt class="docutils literal">polname_1</tt> vanishing
at zero.</p>
<p>Coefficients of the result <tt class="docutils literal">polname_2</tt> are irreducible fractions
(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
</blockquote>
</div>
<div class="section" id="polantidiff-n-polname-1-polname-2">
<span id="polantidiff-n"></span><h2><a class="toc-backref" href="#id67"><tt class="docutils literal"><span class="pre">\PolAntiDiff[N]{polname_1}{polname_2}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_2</tt> to the result of <tt class="docutils literal">N</tt> successive integrations on
<tt class="docutils literal">polname_1</tt>. With negative <tt class="docutils literal">N</tt>, it switches to using <tt class="docutils literal">\PolDiff</tt>.</blockquote>
</div>
<div class="section" id="poldivide-polname-1-polname-2-polname-q-polname-r">
<span id="poldivide"></span><h2><a class="toc-backref" href="#id68"><tt class="docutils literal"><span class="pre">\PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_Q</tt> and <tt class="docutils literal">polname_R</tt> to be the quotient and
remainder in the Euclidean division of <tt class="docutils literal">polname_1</tt> by
<tt class="docutils literal">polname_2</tt>.</blockquote>
</div>
<div class="section" id="polquo-polname-1-polname-2-polname-q">
<span id="polquo"></span><h2><a class="toc-backref" href="#id69"><tt class="docutils literal"><span class="pre">\PolQuo{polname_1}{polname_2}{polname_Q}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_Q</tt> to be the quotient in the Euclidean division
of <tt class="docutils literal">polname_1</tt> by <tt class="docutils literal">polname_2</tt>.</blockquote>
</div>
<div class="section" id="polrem-polname-1-polname-2-polname-r">
<span id="polrem"></span><h2><a class="toc-backref" href="#id70"><tt class="docutils literal"><span class="pre">\PolRem{polname_1}{polname_2}{polname_R}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_R</tt> to be the remainder in the Euclidean division
of <tt class="docutils literal">polname_1</tt> by <tt class="docutils literal">polname_2</tt>.</blockquote>
</div>
<div class="section" id="polgcd-polname-1-polname-2-polname-gcd">
<span id="polgcd"></span><h2><a class="toc-backref" href="#id71"><tt class="docutils literal"><span class="pre">\PolGCD{polname_1}{polname_2}{polname_GCD}</span></tt></a></h2>
<blockquote>
This sets <tt class="docutils literal">polname_GCD</tt> to be the (monic) GCD of the two first
polynomials. It is a unitary polynomial except if both <tt class="docutils literal">polname_1</tt>
and <tt class="docutils literal">polname_2</tt> vanish, then <tt class="docutils literal">polname_GCD</tt> is the zero
polynomial.</blockquote>
<!-- ``\PolIGCD{polname_1}{polname_2}{polname_iGCD}``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 **NOT YET**

 This **assumes** that the two polynomials have integer coefficients.
 It then computes the greatest common divisor in the integer
 polynomial ring, normalized to have a positive leading coefficient
 (if the inputs are not both zero).

``\PolIContent{polname}``
~~~~~~~~~~~~~~~~~~~~~~~~~

 **NOT YET**

 This computes a positive rational number such that dividing the
 polynomial with it returns an integer coefficients polynomial with
 no common factor among the coefficients. -->
</div>
<div class="section" id="poltosturm-polname-sturmname">
<span id="poltosturm"></span><h2><a class="toc-backref" href="#id72"><tt class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></tt></a></h2>
<blockquote>
<p>With <tt class="docutils literal">polname</tt> being for example  <tt class="docutils literal">P</tt>, the macro starts by
computing polynomials <tt class="docutils literal">P</tt> and <tt class="docutils literal">P'</tt>, then computes the (opposite
of the) remainder in euclidean division, iteratively.</p>
<p>The last non-zero remainder <tt class="docutils literal">P_N_</tt> (where <tt class="docutils literal">N</tt> is obtainable as
<a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a>) is up to a factor
the GCD of <tt class="docutils literal">P</tt> and <tt class="docutils literal">P'</tt> hence it is a constant if and only if
<tt class="docutils literal">P</tt> is square-free.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<ul class="last simple">
<li>Since <tt class="docutils literal">0.5</tt> all these polynomials are divided by their rational
content, so they have integer coefficients with no common factor,
and the last one if a constant is either <tt class="docutils literal">1</tt> or <tt class="docutils literal"><span class="pre">-1</span></tt>.</li>
<li>After this normalization to primitive polynomials, they are
stored internally as <tt class="docutils literal">sturmname_k_</tt>, <tt class="docutils literal">k=0,1, ...</tt>.</li>
<li>These polynomials are used internally only. To keep them as
genuine declared polynomials also after the macro call, use the
starred variant <a class="reference internal" href="#id9">PolToSturm*</a>.</li>
</ul>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is perfectly allowed to use the polynomial name as Sturm chain name:
<tt class="docutils literal"><span class="pre">\PolToSturm{f}(f}</span></tt>.</p>
</div>
<p>The macro then declares <tt class="docutils literal">sturmname_0</tt>, <tt class="docutils literal">sturmname_1</tt>, ..., which are
the (non-declared) <tt class="docutils literal">sturmname_k_</tt> divided by the last one. Division is
not done if this last one is the constant <tt class="docutils literal">1</tt> or <tt class="docutils literal"><span class="pre">-1</span></tt>, i.e. if the
original polynomial was square-free. These polynomials are primitive
polynomials too, i.e. with integer coefficients having no common factor.</p>
<p>Thus <tt class="docutils literal">sturmname_0</tt> has exactly the same real and complex roots as
polynomial <tt class="docutils literal">polname</tt>, but with each root now of multiplicity one:
i.e. it is the &quot;square-free part&quot; of original polynomial <tt class="docutils literal">polname</tt>.</p>
<p>Notice that <tt class="docutils literal">sturmname_1</tt> isn't necessarily the derivative of
<tt class="docutils literal">sturmname_0</tt> due to the various normalizations.</p>
<p>The polynomials <tt class="docutils literal">sturmname_k</tt> main utility is for the execution of
<a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a>. Be careful not to use these
names <tt class="docutils literal">sturmname_0</tt>, <tt class="docutils literal">sturmname_1</tt>, etc... for defining other
polynomials after having done <tt class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></tt> and
before executing <tt class="docutils literal">\PolSturmIsolateZeros{sturmname}</tt> else the
latter will behave erroneously.</p>
<p><a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a> gives the index of the last
element of the Sturm chain.</p>
</blockquote>
</div>
<div class="section" id="id10">
<span id="id9"></span><h2><a class="toc-backref" href="#id73"><tt class="docutils literal"><span class="pre">\PolToSturm*{polname}{sturmname}</span></tt></a></h2>
<blockquote>
<p>Does the same as <a class="reference internal" href="#poltosturm">un-starred version</a> and additionally it
keeps for user usage the memory of the <em>un-normalized</em> Sturm chain
polynomials <tt class="docutils literal">sturmname_k_</tt>, <tt class="docutils literal">k=0,1, <span class="pre">...,</span> N</tt>, with
<tt class="docutils literal">N</tt> being <a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This behaviour was modified at  <tt class="docutils literal">0.6</tt>, anyhow the macro was
broken at <tt class="docutils literal">0.5</tt>.</p>
</div>
<div class="admonition hint">
<p class="first admonition-title">Hint</p>
<p class="last">The square-free part of <tt class="docutils literal">polname</tt> is <tt class="docutils literal">sturmname_0</tt>, and their
quotient is the polynomial with name
<tt class="docutils literal">sturname_\PolSturmChainLength{sturmname}_</tt>. It thus easy to
set-up a loop iteratively computing the latter until the last one
is a constant, thus obtaining the decomposition of an <tt class="docutils literal">f</tt> as
a product <tt class="docutils literal">c f_1 f_2 f_3 ...</tt> of a constant and square-free (primitive)
polynomials, where each <tt class="docutils literal">f_i</tt> divides its predecessor.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsettosturmchainsignchangesat-macro-sturmname-fraction">
<span id="polsettosturmchainsignchangesat"></span><h2><a class="toc-backref" href="#id74"><tt class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}</span></tt></a></h2>
<blockquote>
<p>Sets macro <tt class="docutils literal">\macro</tt> to the number of sign changes in the Sturm
chain with name prefix <tt class="docutils literal">sturmname</tt>, at location <tt class="docutils literal">fraction</tt>
(which must be in format as acceptable by the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.)</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The author was lazy and did not provide rather an expandable
variant, where one would do <tt class="docutils literal"><span class="pre">\edef\macro{\PolNbOf...}</span></tt>.</p>
<p>This will presumably get added in a future release.</p>
<p class="last">After some hesitation it was decided the macro would by default
act globally. To make the scope of its macro definition local,
use <tt class="docutils literal">[\empty]</tt> as extra optional argument.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsettonbofzeroswithin-macro-sturmname-value-a-value-b">
<span id="polsettonbofzeroswithin"></span><h2><a class="toc-backref" href="#id75"><tt class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}</span></tt></a></h2>
<blockquote>
<p>Applies the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a> to set <tt class="docutils literal">\macro</tt> to the exact number
of <strong>distinct</strong> roots of <tt class="docutils literal">sturmname_0</tt> in the interval <tt class="docutils literal">(value_a,
value_b]</tt> (the macro first re-orders the value for <tt class="docutils literal">value_a &lt;=
value_b</tt> to hold).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The author was lazy and did not provide rather an expandable
variant, where one would do <tt class="docutils literal"><span class="pre">\edef\macro{\PolNbOf...}</span></tt>.</p>
<p>This will presumably get added in future.</p>
<p class="last">After some hesitation it was decided the macro would by default
act globally. To make the scope of its macro definition local,
use <tt class="docutils literal">[\empty]</tt> as extra optional argument.</p>
</div>
<p>See also the expandable
<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a>, from
which it is immediate (with <tt class="docutils literal">\numexpr</tt>) to create an expandable
variant of this macro. However the difference is that this macro
requires only <a class="reference internal" href="#poltosturm">\PolToSturm</a> to have been executed,
whereas the expandable variant requires prior execution of
<a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a>.</p>
<p>See also the expandable
<a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a>
which requires prior execution of
<a class="reference internal" href="#id11">\PolSturmIsolateZeros*</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatezeros-sturmname">
<span id="polsturmisolatezeros"></span><h2><a class="toc-backref" href="#id76"><tt class="docutils literal">\PolSturmIsolateZeros{sturmname}</tt></a></h2>
<blockquote>
<p>The macros locates, using <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm theorem</a>, as many disjoint
intervals as there are (real) roots.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p>The Sturm chain must have been produced by an earlier
<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</p>
<p>Why does this macro ask for argument the name of Sturm chain,
rather than the name of a polynomial? well this is mainly for
legacy reason, and because it is accompanied by other macros for
which it is simpler to assume the argument will be the name of an
already computed Sturm chain.</p>
<p>Notice that <tt class="docutils literal"><span class="pre">\PolToSturm{f}{f}</span></tt> is perfectly legal (the
<tt class="docutils literal">sturmname</tt> can be same as the <tt class="docutils literal">polname</tt>): it defines
polynomials <tt class="docutils literal">f_0</tt>, <tt class="docutils literal">f_1</tt>, ... having <tt class="docutils literal">f</tt> has name prefix.</p>
<p class="last">Such a prior call
to <tt class="docutils literal">\PolToSturm</tt> must have been made at any rate for
<tt class="docutils literal">\PolSturmIsolateZeros</tt> to be usable.</p>
</div>
<p>After its execution they are two types of such intervals (stored in
memory and accessible via macros or <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables, see below):</p>
<ul class="simple">
<li>singleton <tt class="docutils literal">{a}</tt>: then <tt class="docutils literal">a</tt> is a root, (necessarily a decimal
number, but not all such decimal numbers are exactly identified yet).</li>
<li>open intervals <tt class="docutils literal">(a,b)</tt>: then there is exactly one root <tt class="docutils literal">z</tt>
such that <tt class="docutils literal">a &lt; z &lt; b</tt>, and the end points are guaranteed to not
be roots.</li>
</ul>
<p>The interval boundaries are decimal numbers, originating
in iterated decimal subdivision from initial intervals
<tt class="docutils literal"><span class="pre">(-10^E,</span> 0)</tt> and <tt class="docutils literal">(0, 10^E)</tt> with <tt class="docutils literal">E</tt> chosen initially large
enough so that all roots are enclosed; if zero is a root it is always
identified as such. The non-singleton intervals are of the
type <tt class="docutils literal">(a/10^f, <span class="pre">(a+1)/10^f)</span></tt> with <tt class="docutils literal">a</tt> an integer, which is
neither <tt class="docutils literal">0</tt> nor <tt class="docutils literal"><span class="pre">-1</span></tt>. Hence either <tt class="docutils literal">a</tt> and <tt class="docutils literal">a+1</tt> are both positive
or they are both negative.</p>
<p>One does not <em>a priori</em> know what will be the lengths of these
intervals (except that they are always powers of ten), they
vary depending on how many digits two successive roots have in
common in their respective decimal expansions.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p>If some two consecutive intervals share an end-point, no
information is yet gained about the separation between the two
roots which could at this stage be arbitrarily small.</p>
<p class="last">See <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{sturmname}{index}</a> which addresses
this issue.</p>
</div>
<!-- This procedure is covariant
with the independent variable ``x`` becoming ``-x``.
Hmm, pas sûr et trop fatigué -->
<p>The interval boundaries (and exactly found roots) are made available
for future computations in <tt class="docutils literal">\xintexpr</tt>-essions or polynomial
definitions as variables <tt class="docutils literal">&lt;sturmname&gt;L_1</tt>,
<tt class="docutils literal">&lt;sturmname&gt;L_2</tt>, etc..., for the left end-points and
<tt class="docutils literal">&lt;sturmname&gt;R_1</tt>, <tt class="docutils literal">&lt;sturmname&gt;R_2</tt>, ..., for the right
end-points.</p>
<p>Thus for example, if <tt class="docutils literal">sturmname</tt> is <tt class="docutils literal">f</tt>, one can use the
<a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables <tt class="docutils literal">fL_1</tt>, <tt class="docutils literal">fL_2</tt>, ... to refer in expressions
to the left end-points (or to the exact root, if left and right end
points coincide). Additionally, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variable <tt class="docutils literal">fZ_1_isknown</tt>
will have value <tt class="docutils literal">1</tt> if the root in the first interval is known,
and <tt class="docutils literal">0</tt> otherwise. And similarly for the other intervals.</p>
<p>Also, macros <a class="reference internal" href="#polsturmisolatedzeroleft-sturmname-index">\PolSturmIsolatedZeroLeft{sturmname}{index}</a> and
<a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index">\PolSturmIsolatedZeroRight{sturmname}{index}</a> are provided which
expand to these same values, written in decimal notation (i.e.
pre-processed by <a class="reference internal" href="#poldectostring">\PolDecToString</a>.) And there
is also <a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-a-b">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</a>.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Trailing zeroes in the stored decimal numbers accessible via the
macros are significant: they are also present in the decimal
expansion of the exact root.</p>
</div>
<p>These variables and macros are automatically updated when one next
uses macros such as <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{sturmname}{index}</a>.</p>
<p>The start of decimal expansion of a positive <tt class="docutils literal">k</tt>-th root is given
by <a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft{sturmname}{k}</a>, and for a negative root it is given
by <a class="reference internal" href="#polsturmisolatedzeroright">PolSturmIsolatedZeroRight{sturmname}{k}</a>. These two decimal
numbers are either both zero or both of the same sign.</p>
<p>The number of distinct roots is obtainable expandably as
<a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname">\PolSturmNbOfIsolatedZeros{sturmname}</a>.</p>
<p>Furthermore
<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a> and
<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a>.
will expandably compute respectively the number of real roots at
most equal to <tt class="docutils literal">value</tt> or <tt class="docutils literal">expression</tt>, and the same but with
multiplicities.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">In the current implementation the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables
and <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> arrays are globally defined. On the
other hand the Sturm sequence polynomials obey the current scope.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>As all computations are done <em>exactly</em> there can be no errors...
apart those due to bad coding by author. The results are exact
bounds for the mathematically exact real roots.</p>
<p class="last">Future releases will perhaps also provide macros based on Newton
or Regula Falsi methods. Exact computations with such methods
lead however quickly to very big fractions, and this forces usage
of some rounding scheme for the abscissas if computation times
are to remain reasonable. This raises issues of its own, which
are studied in numerical mathematics.</p>
</div>
</blockquote>
</div>
<div class="section" id="id12">
<span id="id11"></span><h2><a class="toc-backref" href="#id77"><tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{sturmname}</span></tt></a></h2>
<blockquote>
<p>The macro does the same as <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> and
then in addition it does the extra work to determine all
multiplicities (of the real roots):
after executing this macro,
<a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a> will expand
to the multiplicity of the root located in the <tt class="docutils literal">index</tt>-th
interval (intervals are enumerated from left to right, with index
starting at <tt class="docutils literal">1</tt>).</p>
<p>Furthermore, if for example the <tt class="docutils literal">sturmname</tt> is <tt class="docutils literal">f</tt>, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>
variables <tt class="docutils literal">fM_1</tt>, <tt class="docutils literal">fM_2</tt>... hold the multiplicities thus
computed.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is <strong>not</strong> necessary to have executed the <a class="reference internal" href="#id9">PolToSturm*</a> starred
variant, as the non-starred variant keeps internally the memory of the
original GCD (and even of the full non-normalized original Sturm
chain), even though it does not make the declarations as <em>user-level</em>
genuine polynomials.</p>
</div>
<p>See <a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple
roots</a> for an example.</p>
</blockquote>
</div>
<div class="section" id="id14">
<span id="id13"></span><h2><a class="toc-backref" href="#id78"><tt class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></tt></a></h2>
<blockquote>
<p>The macro does the same as <a class="reference internal" href="#id12">\PolSturmIsolateZeros*{sturmname}</a> and
in addition it does the extra work to determine all the <em>rational</em>
roots.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">After execution of this macro, a root is &quot;known&quot; if and only if
it is rational.</p>
</div>
<p>Furthermore, primitive polynomial <tt class="docutils literal">sturmname_sqf_norr</tt> is created
to match the (square-free) <tt class="docutils literal">sturmname_0</tt> from which all rational
roots have been removed (see <a class="reference internal" href="#polexprsetup">\polexprsetup</a> for customizing this
name). The number of distinct rational roots is thus the difference
between the degrees of these two polynomials (see also
<a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{sturmname}</a>).</p>
<p>And <tt class="docutils literal">sturmname_norr</tt> is <tt class="docutils literal">sturmname_0_</tt> from which all rational
roots have been removed (see <a class="reference internal" href="#polexprsetup">\polexprsetup</a>), i.e. it contains
the irrational roots of the original polynomial, with the same
multiplicities.</p>
<p>See <a class="reference internal" href="#a-degree-five-polynomial-with-three-rational-roots">A degree five polynomial with three rational
roots</a> for an example.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatezerosandgetmultiplicities-sturmname">
<span id="polsturmisolatezerosandgetmultiplicities"></span><h2><a class="toc-backref" href="#id79"><tt class="docutils literal">\PolSturmIsolateZerosAndGetMultiplicities{sturmname}</tt></a></h2>
<blockquote>
This is another name for <a class="reference internal" href="#id12">\PolSturmIsolateZeros*{sturmname}</a>.</blockquote>
</div>
<div class="section" id="polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname">
<span id="polsturmisolatezerosgetmultiplicitiesandrationalroots"></span><h2><a class="toc-backref" href="#id80"><tt class="docutils literal">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</tt></a></h2>
<blockquote>
This is another name for <a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a>.</blockquote>
</div>
<div class="section" id="polsturmisolatezerosandfindrationalroots-sturmname">
<h2><a class="toc-backref" href="#id81"><tt class="docutils literal">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</tt></a></h2>
<blockquote>
<p>This works exactly like <a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a>
(inclusive of declaring the polynomials <tt class="docutils literal">sturmname_sqf_norr</tt> and
<tt class="docutils literal">sturmname_norr</tt> with no rational roots) except that it does <em>not</em>
compute the multiplicities of the <em>non-rational</em> roots.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">There is no macro to find the rational roots but not compute
their multiplicities at the same time.</p>
</div>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p>This macro does <em>not</em> define <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables
<tt class="docutils literal">sturmnameM_1</tt>, <tt class="docutils literal">sturmnameM_2</tt>, ... holding the
multiplicities and it leaves the multiplicity array (whose accessor
is <a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a>) into
a broken state, as all non-rational roots will supposedly have
multiplicity one. This means that the output of
<a class="reference internal" href="#id18">\PolPrintIntervals*</a> for example will be
erroneous for the intervals with irrational roots.</p>
<p class="last">I decided to document it because finding multiplicities of the
non rational roots is somewhat costly, and one may be interested
only into finding the rational roots (of course random
polynomials with integer coefficients will not have <em>any</em>
rational root anyhow).</p>
</div>
</blockquote>
</div>
<div class="section" id="polrefineinterval-sturmname-index">
<span id="polrefineinterval"></span><h2><a class="toc-backref" href="#id82"><tt class="docutils literal"><span class="pre">\PolRefineInterval*{sturmname}{index}</span></tt></a></h2>
<blockquote>
The <tt class="docutils literal">index</tt>-th interval (starting indexing at one) is further
subdivided as many times as is necessary in order for the newer
interval to have both its end-points distinct from the end-points of
the original interval. This means that the <tt class="docutils literal">k</tt>th root is then
strictly separated from the other roots.</blockquote>
</div>
<div class="section" id="polrefineinterval-n-sturmname-index">
<span id="polrefineinterval-n"></span><h2><a class="toc-backref" href="#id83"><tt class="docutils literal"><span class="pre">\PolRefineInterval[N]{sturmname}{index}</span></tt></a></h2>
<blockquote>
The <tt class="docutils literal">index</tt>-th interval (starting count at one) is further
subdivided once, reducing its length by a factor of 10. This is done
<tt class="docutils literal">N</tt> times if the optional argument <tt class="docutils literal">[N]</tt> is present.</blockquote>
</div>
<div class="section" id="polensureintervallength-sturmname-index-e">
<span id="polensureintervallength"></span><h2><a class="toc-backref" href="#id84"><tt class="docutils literal"><span class="pre">\PolEnsureIntervalLength{sturmname}{index}{E}</span></tt></a></h2>
<blockquote>
The <tt class="docutils literal">index</tt>-th interval is subdivided until its length becomes at
most <tt class="docutils literal">10^E</tt>. This means (for <tt class="docutils literal">E&lt;0</tt>) that the first <tt class="docutils literal"><span class="pre">-E</span></tt> digits
after decimal mark of the <tt class="docutils literal">k</tt>th root will then be known exactly.</blockquote>
</div>
<div class="section" id="polensureintervallengths-sturmname-e">
<span id="polensureintervallengths"></span><h2><a class="toc-backref" href="#id85"><tt class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{sturmname}{E}</span></tt></a></h2>
<blockquote>
<p>The intervals as obtained from <tt class="docutils literal">\PolSturmIsolateZeros</tt> are (if
necessary) subdivided further by (base 10) dichotomy in order for
each of them to have length at most <tt class="docutils literal">10^E</tt> (length will be shorter
than <tt class="docutils literal">10^E</tt> in output only if it did not change or became zero.)</p>
<p>This means that decimal expansions of all roots will be known with
<tt class="docutils literal"><span class="pre">-E</span></tt> digits (for <tt class="docutils literal">E&lt;0</tt>) after decimal mark.</p>
</blockquote>
</div>
<div class="section" id="polprintintervals-varname-sturmname">
<span id="polprintintervals"></span><h2><a class="toc-backref" href="#id86"><tt class="docutils literal"><span class="pre">\PolPrintIntervals[varname]{sturmname}</span></tt></a></h2>
<blockquote>
<p>This is a convenience macro which prints the bounds for the roots
<tt class="docutils literal">Z_1</tt>, <tt class="docutils literal">Z_2</tt>, ... (the optional argument <tt class="docutils literal">varname</tt> allows to
specify a replacement for the default <tt class="docutils literal">Z</tt>). This will be done (by
default) in a
math mode <tt class="docutils literal">array</tt>, one interval per row, and pattern <tt class="docutils literal">rcccl</tt>,
where the second and fourth column hold the <tt class="docutils literal">&lt;</tt> sign, except when
the interval reduces to a singleton, which means the root is known
exactly.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last">This macro was refactored at 0.7, its default output remained
identical but the ways to customize it got completely
modified.</p>
</div>
<p>See next macros which govern its output.</p>
</blockquote>
<div class="section" id="polprintintervalsnorealroots">
<h3><a class="toc-backref" href="#id87"><tt class="docutils literal">\PolPrintIntervalsNoRealRoots</tt></a></h3>
<blockquote>
<p>Executed in place of an <tt class="docutils literal">array</tt> environment, when there are no
real roots. Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsNoRealRoots{}
</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsbeginenv">
<h3><a class="toc-backref" href="#id88"><tt class="docutils literal">\PolPrintIntervalsBeginEnv</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsBeginEnv{\[\begin{array}{rcccl}}
</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsendenv">
<h3><a class="toc-backref" href="#id89"><tt class="docutils literal">\PolPrintIntervalsEndEnv</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsEndEnv{\end{array}\]}
</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsknownroot">
<h3><a class="toc-backref" href="#id90"><tt class="docutils literal">\PolPrintIntervalsKnownRoot</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsKnownRoot{%
  &amp;&amp;\PolPrintIntervalsTheVar_{\PolPrintIntervalsTheIndex}%
  &amp;=&amp;\PolPrintIntervalsPrintExactZero
}
</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsunknownroot">
<h3><a class="toc-backref" href="#id91"><tt class="docutils literal">\PolPrintIntervalsUnknownRoot</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsUnknownRoot{%
  \PolPrintIntervalsPrintLeftEndPoint&amp;&lt;&amp;%
  \PolPrintIntervalsTheVar_{\PolPrintIntervalsTheIndex}&amp;&lt;&amp;%
  \PolPrintIntervalsPrintRightEndPoint
}
</pre>
</blockquote>
</div>
<div class="section" id="id15">
<span id="polprintintervalsprintexactzero"></span><h3><a class="toc-backref" href="#id92"><tt class="docutils literal">\PolPrintIntervalsPrintExactZero</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsPrintExactZero{\PolPrintIntervalsTheLeftEndPoint}
</pre>
</blockquote>
</div>
<div class="section" id="id16">
<span id="polprintintervalsprintleftendpoint"></span><h3><a class="toc-backref" href="#id93"><tt class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</tt></a></h3>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsPrintLeftEndPoint{\PolPrintIntervalsTheLeftEndPoint}
</pre>
</blockquote>
</div>
<div class="section" id="id17">
<span id="polprintintervalsprintrightendpoint"></span><h3><a class="toc-backref" href="#id94"><tt class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</tt></a></h3>
<blockquote>
<p>Default definition is:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsPrintRightEndPoint{\PolPrintIntervalsTheRightEndPoint}
</pre>
</blockquote>
</div>
</div>
<div class="section" id="id19">
<span id="id18"></span><h2><a class="toc-backref" href="#id95"><tt class="docutils literal"><span class="pre">\PolPrintIntervals*[varname]{sturmname}</span></tt></a></h2>
<blockquote>
<p>This starred variant produces an alternative output (which
displays the root multiplicity), and is provided as an
example of customization.</p>
<p>As replacement for <a class="reference internal" href="#polprintintervalsknownroot">\PolPrintIntervalsKnownRoot</a>,
<a class="reference internal" href="#polprintintervalsprintexactzero">\PolPrintIntervalsPrintExactZero</a>,
<a class="reference internal" href="#polprintintervalsunknownroot">\PolPrintIntervalsUnknownRoot</a> it uses its own
<tt class="docutils literal"><span class="pre">\POL&#64;&#64;PrintIntervals...</span></tt> macros. We only reproduce here one
definition:</p>
<pre class="literal-block">
\newcommand\POL&#64;&#64;PrintIntervalsPrintExactZero{%
   \displaystyle
   \xintSignedFrac{\PolPrintIntervalsTheLeftEndPoint}%
}%
</pre>
<p>Multiplicities are printed using this auxiliary macro:</p>
</blockquote>
<div class="section" id="polprintintervalsprintmultiplicity">
<h3><a class="toc-backref" href="#id96"><tt class="docutils literal">\PolPrintIntervalsPrintMultiplicity</tt></a></h3>
<blockquote>
<p>whose default definition is:</p>
<pre class="literal-block">
\newcommand\PolPrintIntervalsPrintMultiplicity{(\mbox{mult. }\PolPrintIntervalsTheMultiplicity)}
</pre>
</blockquote>
</div>
</div>
<div class="section" id="polmapcoeffs-macro-polname">
<span id="polmapcoeffs"></span><h2><a class="toc-backref" href="#id97"><tt class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{polname}</span></tt></a></h2>
<blockquote>
<p>It modifies ('in-place': original coefficients get lost) each
coefficient of the defined polynomial via the <em>expandable</em> macro
<tt class="docutils literal">\macro</tt>. The degree is adjusted as necessary if some leading
coefficients vanish after the operation. In replacement text of
<tt class="docutils literal">\macro</tt>, <tt class="docutils literal">\index</tt> expands to the coefficient index (which is
defined to be zero for the constant term).</p>
<p>Notice that <tt class="docutils literal">\macro</tt> will have to handle inputs of the shape
<tt class="docutils literal">A/B[N]</tt> (<a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> internal notation). This means that it probably
will have to be expressed in terms of macros from <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> package.</p>
<p>Example:</p>
<pre class="literal-block">
\def\foo#1{\xintMul{#1}{\the\numexpr\index*\index\relax}}
</pre>
<p>(or with <tt class="docutils literal"><span class="pre">\xintSqr{\index}</span></tt>) to replace <tt class="docutils literal">n</tt>-th coefficient
<tt class="docutils literal">f_n</tt> by <tt class="docutils literal">f_n*n^2</tt>.</p>
</blockquote>
</div>
<div class="section" id="polreducecoeffs-polname">
<span id="polreducecoeffs"></span><h2><a class="toc-backref" href="#id98"><tt class="docutils literal">\PolReduceCoeffs{polname}</tt></a></h2>
<blockquote>
About the same as <tt class="docutils literal"><span class="pre">\PolMapCoeffs{\xintIrr}{polname}</span></tt> (but
maintaining a <tt class="docutils literal">[0]</tt> postfix for speedier <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> parsing when
polynomial function is used for computations.) This is a
one-argument macro, working 'in-place'.</blockquote>
</div>
<div class="section" id="id21">
<span id="id20"></span><h2><a class="toc-backref" href="#id99"><tt class="docutils literal"><span class="pre">\PolReduceCoeffs*{polname}</span></tt></a></h2>
<blockquote>
<p>This starred variant leaves un-touched the decimal exponent in the
internal representation of the fractional coefficients, i.e. if a
coefficient is internally <tt class="docutils literal">A/B[N]</tt>, then <tt class="docutils literal">A/B</tt> is reduced to
smallest terms, but the <tt class="docutils literal">10^N</tt> part is kept as is. Note: if the
polynomial is freshly defined directly via <a class="reference internal" href="#polfromcsv">\PolFromCSV</a> its coefficients might still be internally in some
format like <tt class="docutils literal">1.5e7</tt>; the macro will anyhow always first do the
needed conversion to strict format <tt class="docutils literal">A/B[N]</tt>.</p>
<p>Evaluations with polynomials treated by this can be much faster than
with those handled by the non-starred variant
<a class="reference internal" href="#polreducecoeffs-polname">\PolReduceCoeffs{polname}</a>: as the numerators and denominators
remain smaller, this proves very beneficial in favorable cases
(especially when the coefficients are decimal numbers) to the
expansion speed of the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros used internally by
<a class="reference internal" href="#polevalat">\PolEval</a>.</p>
</blockquote>
</div>
<div class="section" id="polmakemonic-polname">
<span id="polmakemonic"></span><h2><a class="toc-backref" href="#id100"><tt class="docutils literal">\PolMakeMonic{polname}</tt></a></h2>
<blockquote>
Divides by the leading coefficient. It is recommended to execute
<a class="reference internal" href="#id21">\PolReduceCoeffs*{polname}</a> immediately afterwards. This is not
done automatically, due to the case the original polynomial had integer
coefficients and we want to keep the leading one as common
denominator.</blockquote>
</div>
<div class="section" id="polmakeprimitive-polname">
<span id="polmakeprimitive"></span><h2><a class="toc-backref" href="#id101"><tt class="docutils literal">\PolMakePrimitive{polname}</tt></a></h2>
<blockquote>
Divides by the integer content see (<a class="reference internal" href="#policontent">\PolIContent</a>). This thus produces a polynomial with integer
coefficients having no common factor. The sign of the leading
coefficient is not modified.</blockquote>
</div>
</div>
<div class="section" id="expandable-macros">
<h1><a class="toc-backref" href="#id102">Expandable macros</a></h1>
<p>All these macros expand completely in two steps except <tt class="docutils literal">\PolToExpr</tt>
and <tt class="docutils literal">\PolToFloatExpr</tt> (and their auxiliaries) which need a
<tt class="docutils literal">\write</tt>, <tt class="docutils literal">\edef</tt> or a <tt class="docutils literal"><span class="pre">\csname...\endcsname</span></tt> context.</p>
<div class="section" id="poleval-polname-atexpr-numerical-expression">
<span id="polevalatexpr"></span><h2><a class="toc-backref" href="#id103"><tt class="docutils literal"><span class="pre">\PolEval{polname}\AtExpr{numerical</span> expression}</tt></a></h2>
<blockquote>
It boils down to
<tt class="docutils literal">\xinttheexpr polname(numerical <span class="pre">expression)\relax</span></tt>.</blockquote>
</div>
<div class="section" id="poleval-polname-at-fraction">
<span id="polevalat"></span><h2><a class="toc-backref" href="#id104"><tt class="docutils literal"><span class="pre">\PolEval{polname}\At{fraction}</span></tt></a></h2>
<blockquote>
Evaluates the polynomial at value <tt class="docutils literal">fraction</tt> which must be in (or
expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.</blockquote>
</div>
<div class="section" id="polevalreduced-polname-atexpr-numerical-expression">
<span id="polevalreducedatexpr"></span><h2><a class="toc-backref" href="#id105"><tt class="docutils literal"><span class="pre">\PolEvalReduced{polname}\AtExpr{numerical</span> expression}</tt></a></h2>
<blockquote>
Boils down to <tt class="docutils literal">\xinttheexpr reduce(polname(numerical <span class="pre">expression))\relax</span></tt>.</blockquote>
</div>
<div class="section" id="polevalreduced-polname-at-fraction">
<span id="polevalreducedat"></span><h2><a class="toc-backref" href="#id106"><tt class="docutils literal"><span class="pre">\PolEvalReduced{polname}\At{fraction}</span></tt></a></h2>
<blockquote>
Evaluates the polynomial at value <tt class="docutils literal">fraction</tt> which must be in (or
expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros, and produce
an irreducible fraction.</blockquote>
</div>
<div class="section" id="polfloateval-polname-atexpr-numerical-expression">
<span id="polfloatevalatexpr"></span><h2><a class="toc-backref" href="#id107"><tt class="docutils literal"><span class="pre">\PolFloatEval{polname}\AtExpr{numerical</span> expression}</tt></a></h2>
<blockquote>
<p>Boils down to <tt class="docutils literal">\xintthefloatexpr polname(numerical <span class="pre">expression)\relax</span></tt>.</p>
<p>This is done via a Horner Scheme (see <a class="reference internal" href="#poldef">\poldef</a> and
<a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>), with already rounded
coefficients. <a class="footnote-reference" href="#id24" id="id22">[2]</a> To use the <em>exact coefficients</em> with <em>exactly
executed</em> additions and multiplications, just insert it in the float
expression as in this example: <a class="footnote-reference" href="#id25" id="id23">[3]</a></p>
<pre class="literal-block">
\xintthefloatexpr 3.27*\xintexpr f(2.53)\relax^2\relax
</pre>
<p>The <tt class="docutils literal">f(2.53)</tt> is exactly computed then rounded at the time of
getting raised to the power <tt class="docutils literal">2</tt>. Moving the <tt class="docutils literal">^2</tt> inside, that
operation would also be treated exactly.</p>
<table class="docutils footnote" frame="void" id="id24" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id22">[2]</a></td><td>Anyway each floating point operation starts by rounding its
operands to the floating point precision.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id25" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id23">[3]</a></td><td>The <tt class="docutils literal">\xintexpr</tt> here could be <tt class="docutils literal">\xinttheexpr</tt> but that
would be less efficient. Cf. <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> documentation about
nested expressions.</td></tr>
</tbody>
</table>
</blockquote>
</div>
<div class="section" id="polfloateval-polname-at-fraction">
<span id="polfloatevalat"></span><h2><a class="toc-backref" href="#id108"><tt class="docutils literal"><span class="pre">\PolFloatEval{polname}\At{fraction}</span></tt></a></h2>
<blockquote>
Evaluates the polynomial at value <tt class="docutils literal">fraction</tt> which must be in (or
expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros, and produces
a floating point number.</blockquote>
</div>
<div class="section" id="polifcoeffisplusorminusone-a-b">
<span id="polifcoeffisplusorminusone"></span><h2><a class="toc-backref" href="#id109"><tt class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{A}{B}</span></tt></a></h2>
<blockquote>
<p>This macro is a priori undefined.</p>
<p>It is defined via the default <a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{raw_coeff}</a> to be
used if needed in the execution of <a class="reference internal" href="#poltypesetmonomialcmd">\PolTypesetMonomialCmd</a>,
e.g. to insert a <tt class="docutils literal">\cdot</tt> in front of <tt class="docutils literal"><span class="pre">\PolVar^{\PolIndex}</span></tt> if
the coefficient is not plus or minus one.</p>
<p>The macro will execute <tt class="docutils literal">A</tt> if the coefficient has been found to be
plus or minus one, and <tt class="docutils literal">B</tt> if not.</p>
</blockquote>
</div>
<div class="section" id="polleadingcoeff-polname">
<span id="polleadingcoeff"></span><h2><a class="toc-backref" href="#id110"><tt class="docutils literal">\PolLeadingCoeff{polname}</tt></a></h2>
<blockquote>
Expands to the leading coefficient.</blockquote>
</div>
<div class="section" id="polnthcoeff-polname-number">
<span id="polnthcoeff"></span><h2><a class="toc-backref" href="#id111"><tt class="docutils literal"><span class="pre">\PolNthCoeff{polname}{number}</span></tt></a></h2>
<blockquote>
It expands to the raw <tt class="docutils literal">N</tt>-th coefficient (<tt class="docutils literal">0/1[0]</tt> if the index
number is out of range). With <tt class="docutils literal"><span class="pre">N=-1</span></tt>, <tt class="docutils literal"><span class="pre">-2</span></tt>, ... expands to the
leading coefficients.</blockquote>
</div>
<div class="section" id="poldegree-polname">
<span id="poldegree"></span><h2><a class="toc-backref" href="#id112"><tt class="docutils literal">\PolDegree{polname}</tt></a></h2>
<blockquote>
It expands to the degree. This is <tt class="docutils literal"><span class="pre">-1</span></tt> if zero polynomial but this
may change in future. Should it then expand to <tt class="docutils literal"><span class="pre">-\infty</span></tt> ?</blockquote>
</div>
<div class="section" id="policontent-polname">
<span id="policontent"></span><h2><a class="toc-backref" href="#id113"><tt class="docutils literal">\PolIContent{polname}</tt></a></h2>
<blockquote>
<p>It expands to the contents of the polynomial, i.e. to the positive
fraction such that dividing by this fraction produces a polynomial
with integer coefficients having no common prime divisor.</p>
<p>See <a class="reference internal" href="#polmakeprimitive">\PolMakePrimitive</a>.</p>
</blockquote>
</div>
<div class="section" id="poltoexpr-polname">
<span id="poltoexpr"></span><h2><a class="toc-backref" href="#id114"><tt class="docutils literal">\PolToExpr{polname}</tt></a></h2>
<blockquote>
<p>Expands <a class="footnote-reference" href="#id27" id="id26">[4]</a> to <tt class="docutils literal"><span class="pre">coeff_N*x^N+...</span></tt> (descending powers.)</p>
<table class="docutils footnote" frame="void" id="id27" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id26">[4]</a></td><td>in a <tt class="docutils literal">\write</tt>, <tt class="docutils literal">\edef</tt>, or <tt class="docutils literal"><span class="pre">\csname...\endcsname</span></tt>, but
not under <tt class="docutils literal"><span class="pre">\romannumeral-`0</span></tt>.</td></tr>
</tbody>
</table>
<p>By default zero coefficients are skipped (issue <tt class="docutils literal">\poltoexpralltrue</tt> to
get all of them in output).</p>
<p>By default, no <tt class="docutils literal">+</tt> sign before negative coefficients, for
compliance with Maple input format (but see
<a class="reference internal" href="#poltoexprtermprefix-raw-coeff">\PolToExprTermPrefix{raw_coeff}</a>.) Also, like the default
behaviour of <a class="reference internal" href="#poltypeset-polname">\PolTypeset{polname}</a>, does not print (for the non
constant terms) coefficients equal to plus or minus one. The degree
one monomial is output as <tt class="docutils literal">x</tt>, not <tt class="docutils literal">x^1</tt>. Complete customization is
possible, see next macros.</p>
<p>Of course <tt class="docutils literal">\PolToExpr{f}</tt> can be inserted in a <tt class="docutils literal">\poldef</tt>, as the
latter expands token by token, hence will force complete expansion
of <tt class="docutils literal">\PolToExpr{f}</tt>, but a simple <tt class="docutils literal">f(x)</tt> is more efficient for
the identical result.</p>
</blockquote>
<div class="section" id="poltoexproneterm-raw-coeff-number">
<span id="poltoexproneterm"></span><h3><a class="toc-backref" href="#id115"><tt class="docutils literal"><span class="pre">\PolToExprOneTerm{raw_coeff}{number}</span></tt></a></h3>
<blockquote>
<p>This two argument expandable command takes care of the monomial and
its coefficient. The default definition is done in order for
coefficients of absolute value <tt class="docutils literal">1</tt> not be printed explicitely
(except of course for the constant term). Also by default, the
monomial of degree one is <tt class="docutils literal">x</tt> not <tt class="docutils literal">x^1</tt>, and <tt class="docutils literal">x^0</tt> is skipped.</p>
<p>For compatibility with Maple input requirements, by default a <tt class="docutils literal">*</tt>
always precedes the <tt class="docutils literal">x^number</tt>, except if the coefficient is a one
or a minus one. See <a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a>.</p>
</blockquote>
</div>
<div class="section" id="poltoexpronetermstylea-raw-coeff-number">
<span id="poltoexpronetermstylea"></span><h3><a class="toc-backref" href="#id116"><tt class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{raw_coeff}{number}</span></tt></a></h3>
<blockquote>
Holds the default package meaning of
<a class="reference internal" href="#poltoexproneterm-raw-coeff-number">\PolToExprOneTerm{raw_coeff}{number}</a>.</blockquote>
</div>
<div class="section" id="poltoexpronetermstyleb-raw-coeff-number">
<span id="poltoexpronetermstyleb"></span><h3><a class="toc-backref" href="#id117"><tt class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{raw_coeff}{number}</span></tt></a></h3>
<blockquote>
<p>For output in this style:</p>
<pre class="literal-block">
2*x^11/3+3*x^8/7-x^5-x^4/4-x^3-x^2/2-2*x+1
</pre>
<p>issue <tt class="docutils literal">\let\PolToExprOneTerm\PolToExprOneTermStyleB</tt> before usage of
<tt class="docutils literal">\PolToExpr</tt>. Note that then <tt class="docutils literal">\PolToExprCmd</tt> isn't used at all.
To revert to package default, issue
<tt class="docutils literal">\let\PolToExprOneTerm\PolToExprOneTermStyleA</tt>.</p>
<p>To suppress the <tt class="docutils literal">*</tt>'s, cf. <a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a>.</p>
</blockquote>
</div>
<div class="section" id="poltoexprcmd-raw-coeff">
<span id="poltoexprcmd"></span><h3><a class="toc-backref" href="#id118"><tt class="docutils literal">\PolToExprCmd{raw_coeff}</tt></a></h3>
<blockquote>
It is the one-argument macro used by the package definition of
<tt class="docutils literal">\PolToExprOneTerm</tt> for the coefficients themselves (when not
equal to plus or minus one), and it defaults to
<tt class="docutils literal"><span class="pre">\xintPRaw{\xintRawWithZeros{#1}}</span></tt>. One will have to redefine it
to <tt class="docutils literal"><span class="pre">\xintIrr{#1}</span></tt> or to <tt class="docutils literal"><span class="pre">\xintPRaw{\xintIrr{#1}}</span></tt> to obtain in the
output forcefully reduced coefficients.</blockquote>
</div>
<div class="section" id="poltoexprtermprefix-raw-coeff">
<span id="poltoexprtermprefix"></span><h3><a class="toc-backref" href="#id119"><tt class="docutils literal">\PolToExprTermPrefix{raw_coeff}</tt></a></h3>
<blockquote>
Defined identically as <a class="reference internal" href="#poltypesetcmdprefix-raw-coeff">\PolTypesetCmdPrefix{raw_coeff}</a>. It
prefixes with a plus sign for non-negative coefficients, because
they don't carry one by themselves.</blockquote>
</div>
<div class="section" id="id28">
<span id="poltoexprvar"></span><h3><a class="toc-backref" href="#id120"><tt class="docutils literal">\PolToExprVar</tt></a></h3>
<blockquote>
This expands to the variable to use in output (it does not have to
be a single letter, may be an expandable macro.) Initial definition
is <tt class="docutils literal">x</tt>.</blockquote>
</div>
<div class="section" id="id29">
<span id="poltoexprtimes"></span><h3><a class="toc-backref" href="#id121"><tt class="docutils literal">\PolToExprTimes</tt></a></h3>
<blockquote>
This expands to the symbol used for multiplication of an
<tt class="docutils literal"><span class="pre">x^{number}</span></tt> by the corresponding coefficient. The default is
<tt class="docutils literal">*</tt>. Redefine the macro to expand to nothing to get rid of it (but
this will give output incompatible with some professional computer
algebra software).</blockquote>
</div>
</div>
<div class="section" id="id31">
<span id="id30"></span><h2><a class="toc-backref" href="#id122"><tt class="docutils literal"><span class="pre">\PolToExpr*{polname}</span></tt></a></h2>
<blockquote>
Expands to <tt class="docutils literal"><span class="pre">coeff_0+coeff_1*x+coeff_2*x^2+...</span></tt> (ascending powers).
Customizable like <a class="reference internal" href="#poltoexpr-polname">\PolToExpr{polname}</a> via the same macros.</blockquote>
</div>
<div class="section" id="poltofloatexpr-polname">
<span id="poltofloatexpr"></span><h2><a class="toc-backref" href="#id123"><tt class="docutils literal">\PolToFloatExpr{polname}</tt></a></h2>
<blockquote>
<p>Similar to <a class="reference internal" href="#poltoexpr-polname">\PolToExpr{polname}</a> but uses <a class="reference external" href="\PolToFloatExprCmd{raw_coeff}">\PolToFloatExprCmd</a>
which by default rounds and converts the coefficients to floating
point format.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>It is not necessary to have issued
<a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>. The rounded coefficients are
not easily recoverable from the <tt class="docutils literal">\xintfloatexpr</tt> polynomial
function hence <tt class="docutils literal">\PolToFloatExprCmd</tt> operates from the <em>exact</em>
coefficients anew.</p>
<p class="last">Attention that both macros obey the prevailing float precision.
If it is changed between those macro calls, then a mismatch
exists between the coefficients as used in <tt class="docutils literal">\xintfloatexpr</tt> and
those output by <tt class="docutils literal">\PolToFloatExpr{polname}</tt>.</p>
</div>
</blockquote>
<div class="section" id="poltofloatexproneterm-raw-coeff-number">
<span id="poltofloatexproneterm"></span><h3><a class="toc-backref" href="#id124"><tt class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{raw_coeff}{number}</span></tt></a></h3>
<blockquote>
Similar to <a class="reference external" href="\PolToExprOneTerm{raw_coeff}{number}">\PolToExprOneTerm</a>. But does not treat
especially coefficients equal to plus or minus one.</blockquote>
</div>
<div class="section" id="poltofloatexprcmd-raw-coeff">
<span id="id33"></span><h3><a class="toc-backref" href="#id125"><tt class="docutils literal">\PolToFloatExprCmd{raw_coeff}</tt></a></h3>
<blockquote>
<p>It is the one-argument macro used by <tt class="docutils literal">\PolToFloatExprOneTerm</tt>.
Its package definition is <tt class="docutils literal"><span class="pre">\xintFloat{#1}</span></tt>.</p>
<div class="admonition caution">
<p class="first admonition-title">Caution!</p>
<p>Currently (<a class="reference external" href="http://www.ctan.org/pkg/xint">xint</a> <tt class="docutils literal">1.3c</tt>) <tt class="docutils literal">\xintFloat{0}</tt> outputs <tt class="docutils literal">0.e0</tt>
which is perfectly acceptable input for Python, but not for
Maple. Thus, one should better leave the <a class="reference internal" href="#poltoexprallfalse">\poltoexprallfalse</a>
toggle to its default <tt class="docutils literal">\iffalse</tt> state, if one intends to use
the output in a Maple worksheet.</p>
<p>But even then the zero polynomial will cause a problem. Workaround:</p>
<pre class="literal-block">
\renewcommand\PolToFloatExprCmd[1]{\xintiiifZero{#1}{0.0}{\xintFloat{#1}}}
</pre>
<p class="last">Usage of <tt class="docutils literal">\xintiiifZero</tt> and not <tt class="docutils literal">\xintifZero</tt> is only for
optimization (I can't help it) because <tt class="docutils literal">#1</tt> is known to be
in <tt class="docutils literal">xintfrac</tt> raw format.</p>
</div>
</blockquote>
</div>
</div>
<div class="section" id="id35">
<span id="id34"></span><h2><a class="toc-backref" href="#id126"><tt class="docutils literal"><span class="pre">\PolToFloatExpr*{polname}</span></tt></a></h2>
<blockquote>
Typesets in ascending powers.</blockquote>
</div>
<div class="section" id="poltolist-polname">
<span id="poltolist"></span><h2><a class="toc-backref" href="#id127"><tt class="docutils literal">\PolToList{polname}</tt></a></h2>
<blockquote>
Expands to <tt class="docutils literal"><span class="pre">{coeff_0}{coeff_1}...{coeff_N}</span></tt> with <tt class="docutils literal">N</tt> = degree, and
<tt class="docutils literal">coeff_N</tt> the leading coefficient
(the zero polynomial does give <tt class="docutils literal">{0/1[0]}</tt> and not an
empty output.)</blockquote>
</div>
<div class="section" id="poltocsv-polname">
<span id="poltocsv"></span><h2><a class="toc-backref" href="#id128"><tt class="docutils literal">\PolToCSV{polname}</tt></a></h2>
<blockquote>
Expands to <tt class="docutils literal">coeff_0, coeff_1, coeff_2, <span class="pre">.....,</span> coeff_N</tt>, starting
with constant term and ending with leading coefficient. Converse
to <a class="reference internal" href="#polfromcsv-polname-csv">\PolFromCSV</a>.</blockquote>
</div>
<div class="section" id="polsturmchainlength-sturmname">
<span id="polsturmchainlength"></span><h2><a class="toc-backref" href="#id129"><tt class="docutils literal">\PolSturmChainLength{sturmname}</tt></a></h2>
<blockquote>
<p>Returns the integer <tt class="docutils literal">N</tt> such that <tt class="docutils literal">sturmname_N</tt> is the last one
in the Sturm chain <tt class="docutils literal">sturmname_0</tt>, <tt class="docutils literal">sturmname_1</tt>, ...</p>
<p>See <a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmifzeroexactlyknown-sturmname-index-a-b">
<span id="polsturmifzeroexactlyknown"></span><h2><a class="toc-backref" href="#id130"><tt class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</span></tt></a></h2>
<blockquote>
<p>Executes <tt class="docutils literal">A</tt> if the <tt class="docutils literal">index</tt>-th interval reduces to a singleton,
i.e. the root is known exactly, else <tt class="docutils literal">B</tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><tt class="docutils literal">index</tt> is allowed to be something like <tt class="docutils literal">1+2*3</tt> as it is fed
to <tt class="docutils literal"><span class="pre">\the\numexpr...\relax</span></tt>.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeroleft-sturmname-index">
<span id="polsturmisolatedzeroleft"></span><h2><a class="toc-backref" href="#id131"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{sturmname}{index}</span></tt></a></h2>
<blockquote>
<p>Expands to the left end-point for the <tt class="docutils literal">index</tt>-th interval, as
computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Of course, this is kept updated by macros such as
<a class="reference internal" href="#polrefineinterval-n">\PolRefineInterval{sturmname}{index}</a>.</p>
</div>
<p>The value is pre-formatted using <a class="reference internal" href="#poldectostring">\PolDecTostring</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeroright-sturmname-index">
<span id="polsturmisolatedzeroright"></span><h2><a class="toc-backref" href="#id132"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{sturmname}{index}</span></tt></a></h2>
<blockquote>
<p>Expands to the right end-point for the <tt class="docutils literal">index</tt>-th interval as
computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> and
possibly refined afterwards.</p>
<p>The value is pre-formatted using <a class="reference internal" href="#poldectostring">\PolDecTostring</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeromultiplicity-sturmname-index">
<span id="polsturmisolatedzeromultiplicity"></span><h2><a class="toc-backref" href="#id133"><tt class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</span></tt></a></h2>
<blockquote>
<p>Expands to the multiplicity of the unique root contained in the
<tt class="docutils literal">index</tt>-th interval.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last">A prior execution of <a class="reference internal" href="#id12">\PolSturmIsolateZeros*{sturmname}</a> is mandatory.</p>
</div>
<p>See <a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple
roots</a> for an example of use.</p>
</blockquote>
</div>
<div class="section" id="polsturmnbofisolatedzeros-sturmname">
<span id="polsturmnbofisolatedzeros"></span><h2><a class="toc-backref" href="#id134"><tt class="docutils literal">\PolSturmNbOfIsolatedZeros{sturmname}</tt></a></h2>
<blockquote>
Expands to the number of real roots of the polynomial
<tt class="docutils literal">&lt;sturmname&gt;_0</tt>, i.e. the number of distinct real roots of the
polynomial originally used to create the Sturm chain via
<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</blockquote>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The next few macros counting roots, with or without multiplicities,
less than or equal to some value, are under evaluation and may be
removed from the package if their utility is judged to be not high
enough. They can be re-coded at user level on the basis of the other
documented package macros anyway.</p>
</div>
<div class="section" id="polsturmnbofrootsof-sturmname-lessthanorequalto-value">
<h3><a class="toc-backref" href="#id135"><tt class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></tt></a></h3>
<blockquote>
<p>Expands to the number of distinct roots (of the polynomial used to
create the Sturm chain) less than or equal to the <tt class="docutils literal">value</tt> (i.e. a
number of fraction recognizable by the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros).</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> must have been executed
beforehand.</p>
<p class="last">And the argument is a <tt class="docutils literal">sturmname</tt>, not a <tt class="docutils literal">polname</tt> (this is
why the macro contains Sturm in its name), simply to be reminded
of the above constraint.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">
<h3><a class="toc-backref" href="#id136"><tt class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></tt></a></h3>
<blockquote>
<p>Expands to the number of distinct roots (of the polynomial
used to create the Sturm chain) which are less than or equal to the
given <tt class="docutils literal">expression</tt>.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">
<h3><a class="toc-backref" href="#id137"><tt class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></tt></a></h3>
<blockquote>
<p>Expands to the number counted with multiplicities of the roots (of
the polynomial used to create the Sturm chain) which are less than
or equal to the given <tt class="docutils literal">value</tt>.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id12">\PolSturmIsolateZeros*{sturmname}</a> (or the double starred
variant) must have been executed beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression">
<h3><a class="toc-backref" href="#id138"><tt class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></tt></a></h3>
<blockquote>
<p>Expands to the total number of roots (counted with multiplicities)
which are less than or equal to the given <tt class="docutils literal">expression</tt>.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id12">\PolSturmIsolateZeros*{sturmname}</a> (or the double starred
variant) must have been executed beforehand.</p>
</div>
</blockquote>
</div>
</div>
<div class="section" id="polsturmnbofrationalroots-sturmname">
<h2><a class="toc-backref" href="#id139"><tt class="docutils literal">\PolSturmNbOfRationalRoots{sturmname}</tt></a></h2>
<blockquote>
<p>Expands to the number of rational roots (without multiplicities).</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbofrationalrootswithmultiplicities-sturmname">
<h2><a class="toc-backref" href="#id140"><tt class="docutils literal">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</tt></a></h2>
<blockquote>
<p>Expands to the number of rational roots (counted with multiplicities).</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalroot-sturmname-k">
<h2><a class="toc-backref" href="#id141"><tt class="docutils literal"><span class="pre">\PolSturmRationalRoot{sturmname}{k}</span></tt></a></h2>
<blockquote>
<p>Expands to the <tt class="docutils literal">k</tt>th rational root (they are ordered and indexed
starting at 1 for the most negative).</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalrootindex-sturmname-k">
<h2><a class="toc-backref" href="#id142"><tt class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{sturmname}{k}</span></tt></a></h2>
<blockquote>
<p>Expands to <tt class="docutils literal">index</tt> of the <tt class="docutils literal">k</tt>th rational root as part of the
ordered real roots (without multiplicities). I.e., above macro
<a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{sturmname}{k}</a> is equivalent to this
nested call:</p>
<pre class="literal-block">
\PolSturmIsolatedZeroLeft{sturmname}{\PolSturmRationalRootIndex{sturmname}{k}}
</pre>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalrootmultiplicity-sturmname-k">
<h2><a class="toc-backref" href="#id143"><tt class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{sturmname}{k}</span></tt></a></h2>
<blockquote>
<p>Expands to the multiplicity of the <tt class="docutils literal">k</tt>th rational root.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last"><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polintervalwidth-sturmname-index">
<span id="polintervalwidth"></span><h2><a class="toc-backref" href="#id144"><tt class="docutils literal"><span class="pre">\PolIntervalWidth{sturmname}{index}</span></tt></a></h2>
<blockquote>
The <tt class="docutils literal">10^E</tt> width of the current <tt class="docutils literal">index</tt>-th root localization
interval. Output is in <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> raw <tt class="docutils literal">1/1[E]</tt> format (if not zero).</blockquote>
</div>
<div class="section" id="expandable-macros-for-use-within-execution-of-polprintintervals">
<h2><a class="toc-backref" href="#id145">Expandable macros for use within execution of <tt class="docutils literal">\PolPrintIntervals</tt></a></h2>
<p>These macros are for usage within custom user redefinitions of
<a class="reference internal" href="#polprintintervalsknownroot">\PolPrintIntervalsKnownRoot</a>, <a class="reference internal" href="#polprintintervalsunknownroot">\PolPrintIntervalsUnknownRoot</a>, or
in redefinitions of <a class="reference internal" href="#polprintintervalsprintexactzero">PolPrintIntervalsPrintExactZero</a> (used in the
default for the former) and of <a class="reference internal" href="#polprintintervalsprintleftendpoint">\PolPrintIntervalsPrintLeftEndPoint</a>,
<a class="reference internal" href="#polprintintervalsprintrightendpoint">\PolPrintIntervalsPrintRightEndPoint</a> (used in the default for the
latter).</p>
<div class="admonition attention">
<p class="first admonition-title">Attention!</p>
<p class="last">Some macros formerly mentioned here got removed at 0.7:
<tt class="docutils literal">\PolPrintIntervalsTheEndPoint</tt>,
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsPositive{A}{B}</span></tt>,
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsNegative{A}{B}</span></tt>,
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsZero{A}{B}</span></tt>.</p>
</div>
<div class="section" id="polprintintervalsthevar">
<h3><a class="toc-backref" href="#id146"><tt class="docutils literal">\PolPrintIntervalsTheVar</tt></a></h3>
<blockquote>
Expands to the name (default <tt class="docutils literal">Z</tt>) used for representing the roots,
which was passed as optional argument <tt class="docutils literal">varname</tt> to
<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a>.</blockquote>
</div>
<div class="section" id="polprintintervalstheindex">
<h3><a class="toc-backref" href="#id147"><tt class="docutils literal">\PolPrintIntervalsTheIndex</tt></a></h3>
<blockquote>
Expands to the index of the considered interval (indexing starting
at 1 for the leftmost interval).</blockquote>
</div>
<div class="section" id="polprintintervalsthesturmname">
<h3><a class="toc-backref" href="#id148"><tt class="docutils literal">\PolPrintIntervalsTheSturmName</tt></a></h3>
<blockquote>
Expands to the argument which was passed as <tt class="docutils literal">sturmname</tt> to
<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a>.</blockquote>
</div>
<div class="section" id="polprintintervalstheleftendpoint">
<h3><a class="toc-backref" href="#id149"><tt class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</tt></a></h3>
<blockquote>
The left end point of the interval, as would be produced by
<a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft</a> if it was
used with arguments the Sturm chain name and interval index returned
by <a class="reference internal" href="#polprintintervalsthesturmname">\PolPrintIntervalsTheSturmName</a> and
<a class="reference internal" href="#polprintintervalstheindex">\PolPrintIntervalsTheIndex</a>.</blockquote>
</div>
<div class="section" id="polprintintervalstherightendpoint">
<h3><a class="toc-backref" href="#id150"><tt class="docutils literal">\PolPrintIntervalsTheRightEndPoint</tt></a></h3>
<blockquote>
The right end point of the interval, as would be produced by
<a class="reference internal" href="#polsturmisolatedzeroright">\PolSturmIsolatedZeroRight</a> for
this Sturm chain name and index.</blockquote>
</div>
<div class="section" id="polprintintervalsthemultiplicity">
<h3><a class="toc-backref" href="#id151"><tt class="docutils literal">\PolPrintIntervalsTheMultiplicity</tt></a></h3>
<blockquote>
The multiplicity of the unique root within the interval of index
<a class="reference internal" href="#polprintintervalstheindex">\PolPrintIntervalsTheIndex</a>. Makes sense only if the starred (or
double-starred) variant of <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> was used earlier.</blockquote>
</div>
</div>
<div class="section" id="poldectostring-decimal-number">
<span id="poldectostring"></span><h2><a class="toc-backref" href="#id152"><tt class="docutils literal">\PolDecToString{decimal number}</tt></a></h2>
<blockquote>
<p>This is a utility macro to print decimal numbers. It has been
backported to <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> (release <tt class="docutils literal">1.3</tt> of <tt class="docutils literal">2018/03/01</tt>) under
the name <tt class="docutils literal">\xintDecToString</tt>, and the <tt class="docutils literal">polexpr</tt> macro is simply
now an alias to it.</p>
<p>For example
<tt class="docutils literal"><span class="pre">\PolDecToString{123.456e-8}</span></tt> will expand to <tt class="docutils literal">0.00000123456</tt>
and <tt class="docutils literal"><span class="pre">\PolDecToString{123.450e-8}</span></tt> to <tt class="docutils literal">0.00000123450</tt> which
illustrates that trailing zeros are not trimmed. To trim trailing
zeroes, one can use <tt class="docutils literal"><span class="pre">\PolDecToString{\xintREZ{#1}}</span></tt>.</p>
<p>The precise behaviour of this macro may evolve in future releases of
<a class="reference external" href="http://www.ctan.org/pkg/xint">xint</a>.</p>
</blockquote>
</div>
</div>
<div class="section" id="booleans-with-default-setting-as-indicated">
<h1><a class="toc-backref" href="#id153">Booleans (with default setting as indicated)</a></h1>
<div class="section" id="xintverbosefalse">
<h2><a class="toc-backref" href="#id154"><tt class="docutils literal">\xintverbosefalse</tt></a></h2>
<blockquote>
<p>This is actually an <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> configuration. Setting it to
<tt class="docutils literal">true</tt> triggers the writing of information to the log when new
polynomials are defined.</p>
<div class="admonition caution">
<p class="first admonition-title">Caution!</p>
<p class="last">The macro meanings as written to the log are to be considered
unstable and undocumented internal structures.</p>
</div>
</blockquote>
</div>
<div class="section" id="poltypesetallfalse">
<h2><a class="toc-backref" href="#id155"><tt class="docutils literal">\poltypesetallfalse</tt></a></h2>
<blockquote>
If <tt class="docutils literal">true</tt>, <a class="reference internal" href="#poltypeset-polname">\PolTypeset{polname}</a> will also typeset the vanishing
coefficients.</blockquote>
</div>
<div class="section" id="poltoexprallfalse">
<h2><a class="toc-backref" href="#id156"><tt class="docutils literal">\poltoexprallfalse</tt></a></h2>
<blockquote>
If <tt class="docutils literal">true</tt>, <a class="reference internal" href="#poltoexpr-polname">\PolToExpr{polname}</a> and <a class="reference internal" href="#poltofloatexpr-polname">\PolToFloatExpr{polname}</a> will
also include the vanishing coefficients in their outputs.</blockquote>
</div>
</div>
<div class="section" id="polexprsetup">
<h1><a class="toc-backref" href="#id157"><tt class="docutils literal">\polexprsetup</tt></a></h1>
<blockquote>
<p>Serves to customize the package. Currently only two keys are
recognized:</p>
<ul class="simple">
<li><tt class="docutils literal">norr</tt>: the postfix that <a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a>
should append to <tt class="docutils literal">sturmname</tt> to declare the primitive polynomial
obtained from original one after removal of all rational roots.
The default value is <tt class="docutils literal">_norr</tt> (standing for “no rational roots”).</li>
<li><tt class="docutils literal">sqfnorr</tt>: the postfix that <a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a>
should append to <tt class="docutils literal">sturmname</tt> to declare the primitive polynomial
obtained from original one after removal of all rational roots and
suppression of all multiplicities.
The default value is <tt class="docutils literal">_sqf_norr</tt> (standing for “square-free with
no rational roots”).</li>
</ul>
<p>The package executes <tt class="docutils literal">\polexprsetup{norr=_norr,
sqfnorr=_sqf_norr}</tt> as default.</p>
</blockquote>
</div>
<div class="section" id="technicalities">
<h1><a class="toc-backref" href="#id158">Technicalities</a></h1>
<ul>
<li><p class="first">The catcode of the semi-colon is reset temporarily by <a class="reference internal" href="#poldef">\poldef</a> macro in case some other package (for example the French
babel module) may have made it active. This will fail though if the
whole thing was already part of a macro argument, in such cases one
can use <a class="reference internal" href="#id2">\PolDef{f}{P(x)}</a>
rather. The colon in <tt class="docutils literal">:=</tt> may be active with no consequences.</p>
</li>
<li><p class="first">As a consequence of <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> addition and subtraction always using
least common multiples for the denominators <a class="footnote-reference" href="#id37" id="id36">[5]</a>, user-chosen common
denominators survive additions and multiplications. For example, this:</p>
<pre class="literal-block">
\poldef P(x):= 1/2 + 2/2*x + 3/2*x^3 + 4/2*x^4;
\poldef Q(x):= 1/3 + (2/3)x + (3/3)x^3 + (4/3)x^4;
\poldef PQ(x):= P(x)Q(x);
</pre>
<p>gives internally the polynomial:</p>
<pre class="literal-block">
1/6+4/6*x^1+4/6*x^2+6/6*x^3+20/6*x^4+16/6*x^5+9/6*x^6+24/6*x^7+16/6*x^8
</pre>
<p>where all coefficients have the same denominator 6. Notice though that
<tt class="docutils literal">\PolToExpr{PQ}</tt> outputs the <tt class="docutils literal">6/6*x^3</tt> as <tt class="docutils literal">x^3</tt> because (by
default) it recognizes and filters out coefficients equal to one or
minus one (since release <tt class="docutils literal">0.3</tt>). One can use for example
<tt class="docutils literal">\PolToCSV{PQ}</tt> to see the internally stored coefficients.</p>
<table class="docutils footnote" frame="void" id="id37" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id36">[5]</a></td><td><p class="first last">prior to <tt class="docutils literal">0.4.1</tt>, <tt class="docutils literal">polexpr</tt> used to temporarily patch
during the parsing of polynomials the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros. This
patch was backported to <a class="reference external" href="http://www.ctan.org/pkg/xint">xint</a> at release <tt class="docutils literal">1.3</tt>.</p>
</td></tr>
</tbody>
</table>
</li>
<li><p class="first"><a class="reference internal" href="#poldiff-polname-1-polname-2">\PolDiff{polname_1}{polname_2}</a> always applies <tt class="docutils literal">\xintIrr</tt> to the
resulting coefficients, except that the <em>power of ten</em> part <tt class="docutils literal">[N]</tt>
(for example an input in scientific notation such as <tt class="docutils literal">1.23e5</tt> gives
<tt class="docutils literal">123/1[3]</tt> internally in xintfrac) is not taken into account in the
reduction of the fraction. This is tentative and may change.</p>
<p>Same remark for <a class="reference internal" href="#polantidiff-polname-1-polname-2">\PolAntiDiff{polname_1}{polname_2}</a>.</p>
</li>
<li><p class="first">Currently, the package stores all coefficients from index <tt class="docutils literal">0</tt> to
index equal to the polynomial degree inside a single macro, as a list.
This data structure is obviously very inefficient for polynomials of
high degree and few coefficients (as an example with <tt class="docutils literal">\poldef
<span class="pre">f(x):=x^1000</span> + x^500;</tt> the subsequent definition <tt class="docutils literal">\poldef <span class="pre">g(x):=</span>
<span class="pre">f(x)^2;</span></tt> will do of the order of 1,000,000 multiplications and
additions involvings only zeroes... which does take time). This
may change in the future.</p>
</li>
<li><p class="first">As is to be expected internal structures of the package are barely
documented and unstable. Don't use them.</p>
</li>
</ul>
</div>
<div class="section" id="change-log">
<h1><a class="toc-backref" href="#id159">CHANGE LOG</a></h1>
<ul>
<li><p class="first">v0.1 (2018/01/11): initial release. Features:</p>
<ul class="simple">
<li>The <a class="reference internal" href="#poldef">\poldef</a> parser itself,</li>
<li>Differentiation and anti-differentiation,</li>
<li>Euclidean division and GCDs,</li>
<li>Various utilities such as <a class="reference internal" href="#polfromcsv">\PolFromCSV</a>,
<a class="reference internal" href="#polmapcoeffs">\PolMapCoeffs</a>,
<a class="reference internal" href="#poltocsv">\PolToCSV</a>, <a class="reference internal" href="#poltoexpr">\PolToExpr</a>, ...</li>
</ul>
<p>Only one-variable polynomials so far.</p>
</li>
<li><p class="first">v0.2 (2018/01/14)</p>
<ul class="simple">
<li>Fix: <tt class="docutils literal">&quot;README thinks \numexpr recognizes ^ operator&quot;</tt>.</li>
<li>Convert README to reStructuredText markup.</li>
<li>Move main documentation from README to separate <tt class="docutils literal">polexpr.txt</tt> file.</li>
<li>Provide <tt class="docutils literal">polexpr.html</tt> as obtained via <a class="reference external" href="http://docutils.sourceforge.net/docs/index.html">DocUtils</a> <tt class="docutils literal">rst2html.py</tt>.</li>
<li>Convert README to (CTAN compatible) Markdown markup.</li>
</ul>
<p>Due to lack of available time the test suite might not be extensive
enough. Bug reports are very welcome!</p>
</li>
<li><p class="first">v0.3 (2018/01/17)</p>
<ul>
<li><p class="first">bug fixes:</p>
<ul>
<li><p class="first">the <tt class="docutils literal">0.1</tt> <a class="reference internal" href="#polevalat">\PolEval</a> accepted expressions for its second
argument, but this was removed by mistake at <tt class="docutils literal">0.2</tt>. Restored.</p>
<p><strong>Attention</strong>: at <tt class="docutils literal">0.4</tt> this has been reverted again, and
<a class="reference internal" href="#polevalatexpr">\PolEval{P}\AtExpr{foo}</a> syntax is needed for
using expressions in the second argument.</p>
</li>
</ul>
</li>
<li><p class="first">incompatible or breaking changes:</p>
<ul class="simple">
<li><a class="reference internal" href="#poltoexpr">\PolToExpr</a> now by default uses <em>descending</em>
powers (it also treats differently coefficients equal to 1 or -1.)
Use <a class="reference internal" href="#id30">\PolToExpr*</a> for <em>ascending</em> powers.</li>
<li><a class="reference internal" href="#polevalat">\PolEval</a> reduced the output to smallest terms,
but as this is costly with big fractions and not needed if e.g.
wrapped in an <tt class="docutils literal">\xintRound</tt> or <tt class="docutils literal">\xintFloat</tt>, this step has been
removed; the former meaning is available as <a class="reference internal" href="#polevalreducedat">\PolEvalReduced</a>.</li>
</ul>
</li>
<li><p class="first">new (or newly documented) macros:</p>
<ul class="simple">
<li><a class="reference internal" href="#poltypesetcmd">\PolTypesetCmd</a></li>
<li><a class="reference internal" href="#poltypesetcmdprefix">\PolTypesetCmdPrefix</a></li>
<li><a class="reference internal" href="#poltypesetmonomialcmd">\PolTypesetMonomialCmd</a></li>
<li><a class="reference internal" href="#polevalreducedat">\PolEvalReducedAt</a></li>
<li><a class="reference internal" href="#poltofloatexpr">\PolToFloatExpr</a></li>
<li><a class="reference internal" href="#poltoexproneterm">\PolToExprOneTerm</a></li>
<li><a class="reference internal" href="#poltofloatexproneterm">\PolToFloatExprOneTerm</a></li>
<li><a class="reference internal" href="#poltoexprcmd">\PolToExprCmd</a></li>
<li><a class="reference internal" href="#id33">\PolToFloatExprCmd</a></li>
<li><a class="reference internal" href="#poltoexprtermprefix">\PolToExprTermPrefix</a></li>
<li><a class="reference internal" href="#poltoexprvar">\PolToExprVar</a></li>
<li><a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a></li>
</ul>
</li>
<li><p class="first">improvements:</p>
<ul>
<li><p class="first">documentation has a table of contents, internal hyperlinks,
standardized signature notations and added explanations.</p>
</li>
<li><p class="first">one can do <tt class="docutils literal"><span class="pre">\PolLet{g}={f}</span></tt> or <tt class="docutils literal"><span class="pre">\PolLet{g}{f}</span></tt>.</p>
</li>
<li><p class="first"><tt class="docutils literal">\PolToExpr{f}</tt> is highly customizable.</p>
</li>
<li><p class="first"><a class="reference internal" href="#poldef">\poldef</a> and other defining macros prepare the polynomial
functions for usage within <tt class="docutils literal">\xintthefloatexpr</tt> (or
<tt class="docutils literal">\xintdeffloatvar</tt>). Coefficients are pre-rounded to the
floating point precision. Indispensible for numerical algorithms,
as exact fractions, even reduced, quickly become very big. See the
documentation about how to use the exact polynomials also in
floating point context.</p>
<p><strong>Attention</strong>: this has been reverted at <tt class="docutils literal">0.4</tt>. The macro
<a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a> must be used for
generation floating point polynomial functions.</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.3.1 (2018/01/18)</p>
<p>Fixes two typos in example code included in the documentation.</p>
</li>
<li><p class="first">v0.4 (2018/02/16)</p>
<ul>
<li><p class="first">bug fixes:</p>
<ul class="simple">
<li>when Euclidean division gave a zero remainder, the internal
representation of this zero polynomial could be faulty; this
could cause mysterious bugs in conjunction with other package
macros such as <a class="reference internal" href="#polmapcoeffs">\PolMapCoeffs</a>.</li>
<li><a class="reference internal" href="#polgcd">\PolGCD</a> was buggy in case of first polynomial being
of lesser degree than the second one.</li>
</ul>
</li>
<li><p class="first">breaking changes:</p>
<ul>
<li><p class="first">formerly <a class="reference internal" href="#polevalat">\PolEval{P}\At{foo}</a> allowed <tt class="docutils literal">foo</tt> to
be an expression, which was transparently handled via
<tt class="docutils literal">\xinttheexpr</tt>. Now, <tt class="docutils literal">foo</tt> must be a fraction (or a macro
expanding to such) in the format acceptable by <tt class="docutils literal">xintfrac.sty</tt>
macros. Use <a class="reference internal" href="#polevalatexpr">\PolEval{P}\AtExpr{foo}</a> for more
general arguments using expression syntax. E.g., if <tt class="docutils literal">foo</tt> is the
name of a variable known to <tt class="docutils literal">\xintexpr</tt>.</p>
<p>The same holds for <a class="reference internal" href="#polevalreducedat">\PolEvalReduced</a>
and <a class="reference internal" href="#polfloatevalat">\PolFloatEval</a>.</p>
</li>
<li><p class="first">the <tt class="docutils literal">3.0</tt> automatic generation of floating point variants has
been reverted. Not only do <em>not</em> the package macros automatically
generate floating point variants of newly created polynomials,
they actually make pre-existing such variant undefined.</p>
<p>See <a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a>.</p>
</li>
</ul>
</li>
<li><p class="first">new non-expandable macros:</p>
<ul class="simple">
<li><a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a></li>
<li><a class="reference internal" href="#polgloballet">\PolGlobalLet</a></li>
<li><a class="reference internal" href="#poltypesetone">\PolTypesetOne</a></li>
<li><a class="reference internal" href="#polquo">\PolQuo</a></li>
<li><a class="reference internal" href="#polrem">\PolRem</a></li>
<li><a class="reference internal" href="#poltosturm">\PolToSturm</a></li>
<li><a class="reference internal" href="#id9">\PolToSturm*</a></li>
<li><a class="reference internal" href="#polsettosturmchainsignchangesat">\PolSetToSturmChainSignChangesAt</a></li>
<li><a class="reference internal" href="#polsettonbofzeroswithin">\PolSetToNbOfZerosWithin</a></li>
<li><a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a></li>
<li><a class="reference internal" href="#polrefineinterval">\PolRefineInterval*</a></li>
<li><a class="reference internal" href="#polrefineinterval-n">\PolRefineInterval[N]</a></li>
<li><a class="reference internal" href="#polensureintervallength">\PolEnsureIntervalLength</a></li>
<li><a class="reference internal" href="#polensureintervallengths">\PolEnsureIntervalLengths</a></li>
<li><a class="reference internal" href="#polprintintervals">\PolPrintIntervals</a></li>
<li><a class="reference internal" href="#polprintintervalsprintexactzero">\PolPrintIntervalsPrintExactZero</a></li>
<li><a class="reference internal" href="#polprintintervalsprintleftendpoint">\PolPrintIntervalsPrintLeftEndPoint</a></li>
<li><a class="reference internal" href="#polprintintervalsprintrightendpoint">\PolPrintIntervalsPrintRightEndPoint</a></li>
<li><a class="reference internal" href="#id20">\PolReduceCoeffs*</a></li>
<li><a class="reference internal" href="#polmakemonic">\PolMakeMonic</a></li>
</ul>
</li>
<li><p class="first">new expandable macros:</p>
<ul class="simple">
<li><a class="reference internal" href="#poltoexpronetermstylea">\PolToExprOneTermStyleA</a></li>
<li><a class="reference internal" href="#polifcoeffisplusorminusone">\PolIfCoeffIsPlusOrMinusOne</a></li>
<li><a class="reference internal" href="#polleadingcoeff">\PolLeadingCoeff</a></li>
<li><a class="reference internal" href="#polsturmchainlength">\PolSturmChainLength</a></li>
<li><a class="reference internal" href="#polsturmnbofisolatedzeros">\PolSturmNbOfIsolatedZeros</a></li>
<li><a class="reference internal" href="#polsturmifzeroexactlyknown">\PolSturmIfZeroExactlyKnown</a></li>
<li><a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft</a></li>
<li><a class="reference internal" href="#polsturmisolatedzeroright">\PolSturmIsolatedZeroRight</a></li>
<li><tt class="docutils literal">\PolPrintIntervalsTheEndPoint</tt> (removed at 0.7)</li>
<li><a class="reference internal" href="#polprintintervalstheindex">\PolPrintIntervalsTheIndex</a></li>
<li><tt class="docutils literal">\PolIfEndPointIsPositive</tt> (removed at 0.7)</li>
<li><tt class="docutils literal">\PolIfEndPointIsNegative</tt> (removed at 0.7)</li>
<li><tt class="docutils literal">\PolIfEndPointIsZero</tt> (removed at 0.7)</li>
<li><a class="reference internal" href="#polintervalwidth">\PolIntervalWidth</a></li>
<li><a class="reference internal" href="#poldectostring">\PolDecToString</a></li>
</ul>
</li>
<li><p class="first">improvements:</p>
<p>The main new feature is implementation of the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm algorithm</a>
for localization of the real roots of polynomials.</p>
</li>
</ul>
</li>
<li><p class="first">v0.4.1 (2018/03/01)</p>
<p>Synced with xint 1.3.</p>
</li>
<li><p class="first">v0.4.2 (2018/03/03)</p>
<p>Documentation fix.</p>
</li>
<li><p class="first">v0.5 (2018/04/08)</p>
<ul class="simple">
<li>bug fixes:<ul>
<li><a class="reference internal" href="#polget-polname-fromarray-macro">\PolGet{polname}\fromarray\macro</a> crashed when <tt class="docutils literal">\macro</tt> was
an <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> array macro with no items. It now produces the zero
polynomial.</li>
</ul>
</li>
<li>breaking changes:<ul>
<li><a class="reference internal" href="#poltosturm">\PolToSturm</a> creates primitive integer coefficients polynomials.
This speeds up localization of roots via
<a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a>. In case of user protests the author
will make available again the code producing the bona fide Sturm
polynomials as used formerly.</li>
<li>polynomials created from <a class="reference internal" href="#polfromcsv">\PolFromCSV</a> or <a class="reference internal" href="#polget">\PolGet</a>
get their coefficients normalized via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s <tt class="docutils literal">\xintRaw</tt>.</li>
</ul>
</li>
<li>experimental change:<ul>
<li>optional argument to <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> (see <a class="reference internal" href="#the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots">The
degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2
as roots</a> for usage). It will presumably be replaced in future by
an interval specification.</li>
</ul>
</li>
<li>new non-expandable macro:<ul>
<li><a class="reference internal" href="#polmakeprimitive">\PolMakePrimitive</a></li>
</ul>
</li>
<li>new expandable macro:<ul>
<li><a class="reference internal" href="#policontent">\PolIContent</a></li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.5.1 (2018/04/22)</p>
<ul class="simple">
<li>new feature:<ul>
<li>the character <tt class="docutils literal">'</tt> can be used in polynomial names.</li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.6 (2018/11/20)</p>
<ul class="simple">
<li>bugfix:<ul>
<li>the starred variant <a class="reference internal" href="#id10">\PolToSturm*{polname}{sturmname}</a> was
broken. On the occasion of the fix, its meaning has been modified,
see its documentation.</li>
<li>using <a class="reference internal" href="#poltosturm">\PolToSturm</a> with a constant polynomial
caused a division by zero error.</li>
</ul>
</li>
<li>new macro:<ul>
<li><a class="reference internal" href="#id11">\PolSturmIsolateZeros*</a>
acts like the <a class="reference internal" href="#polsturmisolatezeros">non-starred variant</a> then computes all the multiplicities.</li>
</ul>
</li>
<li>new expandable macros:<ul>
<li><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a></li>
<li><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a></li>
<li><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a></li>
<li><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a></li>
<li><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a></li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09)</p>
<ul class="simple">
<li>breaking changes:<ul>
<li>although <a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a> default output
remains the same, some auxiliary macros for user-customization
have been removed: <tt class="docutils literal">\PolPrintIntervalsTheEndPoint</tt>,
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsPositive{A}{B}</span></tt>,
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsNegative{A}{B}</span></tt>, and
<tt class="docutils literal"><span class="pre">\PolIfEndPointIsZero{A}{B}</span></tt>.</li>
</ul>
</li>
<li>bugfix:<ul>
<li>it could happen that, contrarily to documentation, an interval
computed by <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> had zero as an
endpoint,</li>
<li><a class="reference internal" href="#polensureintervallength-sturmname-index-e">\PolEnsureIntervalLength{sturmname}{index}{E}</a> could under
certain circumstances erroneously replace a non-zero root by
zero,</li>
<li><a class="reference internal" href="#polensureintervallengths-sturmname-e">\PolEnsureIntervalLengths{sturmname}{E}</a> crashed when used with
a polynomial with no real roots, hence for which no isolation intervals
existed (thanks to Thomas Söll for report).</li>
</ul>
</li>
<li>new macros:<ul>
<li><a class="reference internal" href="#id14">\PolSturmIsolateZeros**{sturmname}</a></li>
<li><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</a></li>
<li><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</a></li>
<li><a class="reference internal" href="#polexprsetup">\polexprsetup</a></li>
<li><a class="reference internal" href="#id18">\PolPrintIntervals*</a></li>
<li><a class="reference internal" href="#polprintintervalsnorealroots">\PolPrintIntervalsNoRealRoots</a></li>
<li><a class="reference internal" href="#polprintintervalsbeginenv">\PolPrintIntervalsBeginEnv</a></li>
<li><a class="reference internal" href="#polprintintervalsendenv">\PolPrintIntervalsEndEnv</a></li>
<li><a class="reference internal" href="#polprintintervalsknownroot">\PolPrintIntervalsKnownRoot</a></li>
<li><a class="reference internal" href="#polprintintervalsunknownroot">\PolPrintIntervalsUnknownRoot</a></li>
<li><a class="reference internal" href="#polprintintervalsprintmultiplicity">\PolPrintIntervalsPrintMultiplicity</a></li>
</ul>
</li>
<li>new expandable macros:<ul>
<li><a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{sturmname}</a></li>
<li><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</a></li>
<li><a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{sturmname}{k}</a></li>
<li><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k">\PolSturmRationalRootIndex{sturmname}{k}</a></li>
<li><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k">\PolSturmRationalRootMultiplicity{sturmname}{k}</a></li>
<li><a class="reference internal" href="#polprintintervalsthevar">\PolPrintIntervalsTheVar</a></li>
<li><a class="reference internal" href="#polprintintervalsthesturmname">\PolPrintIntervalsTheSturmName</a></li>
<li><a class="reference internal" href="#polprintintervalsthemultiplicity">\PolPrintIntervalsTheMultiplicity</a></li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.7.3 (2019/02/04)</p>
<ul class="simple">
<li>bugfix:<ul>
<li>Debugging information not destined to user showed in log if root
finding was done under <tt class="docutils literal">\xintverbosetrue</tt> regime.</li>
<li><a class="reference internal" href="#polprintintervalsthevar">\PolPrintIntervalsTheVar</a> remained defined after
<a class="reference internal" href="#polprintintervals">\PolPrintIntervals</a> but was left undefined after
<a class="reference internal" href="#id18">\PolPrintIntervals*</a> (reported by Jürgen Gilg). Now remains
defined in both cases, and <a class="reference internal" href="#polprintintervalsthesturmname">\PolPrintIntervalsTheSturmName</a>
also.</li>
<li>Polynomial names ending in digits caused errors (reported by Thomas
Söll).</li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.7.4 (2019/02/12)</p>
<ul class="simple">
<li>bugfix:<ul>
<li>20000000000 is too big for <tt class="docutils literal">\numexpr</tt>, shouldn't I know that?
Thanks to Jürgen Gilg for report.</li>
</ul>
</li>
</ul>
</li>
<li><p class="first">v0.7.5 (2020/01/31)</p>
<p>Synced with xint 1.4. Requires it.</p>
</li>
</ul>
</div>
<div class="section" id="acknowledgments">
<h1><a class="toc-backref" href="#id160">Acknowledgments</a></h1>
<p>Thanks to Jürgen Gilg whose question about <a class="reference external" href="http://www.ctan.org/pkg/xint">xint</a> usage for
differentiating polynomials was the initial trigger leading to this
package, and to Jürgen Gilg and Thomas Söll for testing it on some
concrete problems.</p>
<p>Renewed thanks to them on occasion of the <tt class="docutils literal">0.6</tt> and <tt class="docutils literal">0.7</tt> releases for their
continued interest.</p>
<p>See README.md for the License.</p>
</div>
</div>
</body>
</html>