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
#![allow(non_camel_case_types)]

//! See the [FLINT documentation](http://flintlib.org/doc/fmpq_poly.html).

use crate::deps::*;
use crate::flint::*;
use crate::fmpz::{fmpz, fmpz_t, fmpz_preinvn_struct};
use crate::fmpq::fmpq;
use crate::fmpz_poly::fmpz_poly_struct;
use libc::{c_char, c_int, FILE};


#[repr(C)]
#[derive(Debug, Copy, Clone, Hash)]
pub struct fmpq_poly_struct {
    pub coeffs: *mut fmpz,
    pub den: fmpz_t,
    pub alloc: mp_limb_signed_t,
    pub length: mp_limb_signed_t,
}

pub type fmpq_poly_t = [fmpq_poly_struct; 1usize];

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fmpq_poly_powers_precomp_struct {
    pub powers: *mut fmpq_poly_struct,
    pub len: mp_limb_signed_t,
}

pub type fmpq_poly_powers_precomp_t = [fmpq_poly_powers_precomp_struct; 1usize];

extern "C" {
    pub fn fmpq_poly_init(poly: *mut fmpq_poly_struct);
    pub fn fmpq_poly_init2(poly: *mut fmpq_poly_struct, alloc: mp_limb_signed_t);
    pub fn fmpq_poly_realloc(poly: *mut fmpq_poly_struct, alloc: mp_limb_signed_t);
    pub fn fmpq_poly_fit_length(poly: *mut fmpq_poly_struct, len: mp_limb_signed_t);
    pub fn _fmpq_poly_set_length(poly: *mut fmpq_poly_struct, len: mp_limb_signed_t);
    pub fn fmpq_poly_clear(poly: *mut fmpq_poly_struct);
    pub fn _fmpq_poly_normalise(poly: *mut fmpq_poly_struct);
    pub fn fmpq_poly_get_numerator(res: *mut fmpz_poly_struct, poly: *const fmpq_poly_struct);
    pub fn fmpq_poly_get_denominator(den: *mut fmpz, poly: *const fmpq_poly_struct);
    pub fn _fmpq_poly_canonicalise(rpoly: *mut fmpz, den: *mut fmpz, len: mp_limb_signed_t);
    pub fn fmpq_poly_canonicalise(poly: *mut fmpq_poly_struct);
    pub fn _fmpq_poly_is_canonical(
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_is_canonical(poly: *const fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_degree(poly: *const fmpq_poly_struct) -> mp_limb_signed_t;
    pub fn fmpq_poly_length(poly: *const fmpq_poly_struct) -> mp_limb_signed_t;
    pub fn fmpq_poly_randtest(
        f: *mut fmpq_poly_struct,
        state: *const flint_rand_s,
        len: mp_limb_signed_t,
        bits_in: mp_limb_t,
    );
    pub fn fmpq_poly_randtest_unsigned(
        f: *mut fmpq_poly_struct,
        state: *const flint_rand_s,
        len: mp_limb_signed_t,
        bits_in: mp_limb_t,
    );
    pub fn fmpq_poly_randtest_not_zero(
        f: *mut fmpq_poly_struct,
        state: *const flint_rand_s,
        len: mp_limb_signed_t,
        bits_in: mp_limb_t,
    );
    pub fn fmpq_poly_set(poly1: *mut fmpq_poly_struct, poly2: *const fmpq_poly_struct);
    pub fn fmpq_poly_set_si(poly: *mut fmpq_poly_struct, x: mp_limb_signed_t);
    pub fn fmpq_poly_set_ui(poly: *mut fmpq_poly_struct, x: mp_limb_t);
    pub fn fmpq_poly_set_fmpz(poly: *mut fmpq_poly_struct, x: *const fmpz);
    pub fn fmpq_poly_set_fmpq(poly: *mut fmpq_poly_struct, x: *const fmpq);
    pub fn fmpq_poly_set_mpz(poly: *mut fmpq_poly_struct, x: *const __mpz_struct);
    pub fn fmpq_poly_set_mpq(poly: *mut fmpq_poly_struct, x: *const __mpq_struct);
    pub fn fmpq_poly_set_fmpz_poly(rop: *mut fmpq_poly_struct, op: *const fmpz_poly_struct);
    //pub fn _fmpq_poly_get_nmod_poly(rop: *mut nmod_poly_struct, op: *const fmpq_poly_struct);
    /*
    pub fn fmpq_poly_get_nmod_poly_den(
        rop: *mut nmod_poly_struct,
        op: *const fmpq_poly_struct,
        den: c_int,
    );
    pub fn fmpq_poly_get_nmod_poly(rop: *mut nmod_poly_struct, op: *const fmpq_poly_struct);
    pub fn fmpq_poly_set_nmod_poly(rop: *mut fmpq_poly_struct, op: *const nmod_poly_struct);
    */
    pub fn _fmpq_poly_set_array_mpq(
        poly: *mut fmpz,
        den: *mut fmpz,
        a: *const mpq_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_set_array_mpq(
        poly: *mut fmpq_poly_struct,
        a: *const mpq_t,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_set_str(
        poly: *mut fmpz,
        den: *mut fmpz,
        str_: *const c_char,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_set_str(
        poly: *mut fmpq_poly_struct,
        str_: *const c_char,
    ) -> c_int;
    pub fn fmpq_poly_get_str(poly: *const fmpq_poly_struct) -> *mut c_char;
    pub fn fmpq_poly_get_str_pretty(
        poly: *const fmpq_poly_struct,
        var: *const c_char,
    ) -> *mut c_char;
    pub fn _fmpq_poly_get_str_pretty(
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        var: *const c_char,
    ) -> *mut c_char;
    pub fn fmpq_poly_zero(poly: *mut fmpq_poly_struct);
    pub fn fmpq_poly_one(poly: *mut fmpq_poly_struct);
    pub fn fmpq_poly_neg(poly1: *mut fmpq_poly_struct, poly2: *const fmpq_poly_struct);
    pub fn fmpq_poly_inv(poly1: *mut fmpq_poly_struct, poly2: *const fmpq_poly_struct);
    pub fn fmpq_poly_swap(poly1: *mut fmpq_poly_struct, poly2: *mut fmpq_poly_struct);
    pub fn fmpq_poly_truncate(poly: *mut fmpq_poly_struct, n: mp_limb_signed_t);
    pub fn fmpq_poly_set_trunc(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_get_slice(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        i: mp_limb_signed_t,
        j: mp_limb_signed_t,
    );
    pub fn fmpq_poly_reverse(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_get_coeff_fmpz(x: *mut fmpz, poly: *const fmpq_poly_struct, n: mp_limb_signed_t);
    pub fn fmpq_poly_get_coeff_fmpq(x: *mut fmpq, poly: *const fmpq_poly_struct, n: mp_limb_signed_t);
    pub fn fmpq_poly_get_coeff_mpq(
        x: *mut __mpq_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_set_coeff_si(
        poly: *mut fmpq_poly_struct,
        n: mp_limb_signed_t,
        x: mp_limb_signed_t,
    );
    pub fn fmpq_poly_set_coeff_ui(poly: *mut fmpq_poly_struct, n: mp_limb_signed_t, x: mp_limb_t);
    pub fn fmpq_poly_set_coeff_fmpz(poly: *mut fmpq_poly_struct, n: mp_limb_signed_t, x: *const fmpz);
    pub fn fmpq_poly_set_coeff_fmpq(poly: *mut fmpq_poly_struct, n: mp_limb_signed_t, x: *const fmpq);
    pub fn fmpq_poly_set_coeff_mpz(
        poly: *mut fmpq_poly_struct,
        n: mp_limb_signed_t,
        x: *const __mpz_struct,
    );
    pub fn fmpq_poly_set_coeff_mpq(
        poly: *mut fmpq_poly_struct,
        n: mp_limb_signed_t,
        x: *const __mpq_struct,
    );
    pub fn fmpq_poly_equal(
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    ) -> c_int;
    pub fn _fmpq_poly_cmp(
        lpoly: *const fmpz,
        lden: *const fmpz,
        rpoly: *const fmpz,
        rden: *const fmpz,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_cmp(
        left: *const fmpq_poly_struct,
        right: *const fmpq_poly_struct,
    ) -> c_int;
    pub fn _fmpq_poly_equal_trunc(
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_equal_trunc(
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_is_zero(poly: *const fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_is_one(poly: *const fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_is_gen(op: *const fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_add_si(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sub_si(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: mp_limb_signed_t,
    );
    pub fn fmpq_poly_si_sub(
        res: *mut fmpq_poly_struct,
        c: mp_limb_signed_t,
        poly: *const fmpq_poly_struct,
    );
    pub fn fmpq_poly_add_fmpz(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: *const fmpz,
    );
    pub fn fmpq_poly_sub_fmpz(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: *const fmpz,
    );
    pub fn fmpq_poly_fmpz_sub(
        res: *mut fmpq_poly_struct,
        c: *const fmpz,
        poly: *const fmpq_poly_struct,
    );
    pub fn fmpq_poly_add_fmpq(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: *const fmpq,
    );
    pub fn fmpq_poly_sub_fmpq(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        c: *const fmpq,
    );
    pub fn fmpq_poly_fmpq_sub(
        res: *mut fmpq_poly_struct,
        c: *const fmpq,
        poly: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_add(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    );
    pub fn fmpq_poly_add(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_add_can(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        can: c_int,
    );
    pub fn fmpq_poly_add_can(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        can: c_int,
    );
    pub fn _fmpq_poly_add_series(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_add_series(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_add_series_can(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
        can: c_int,
    );
    pub fn fmpq_poly_add_series_can(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
        can: c_int,
    );
    pub fn _fmpq_poly_sub(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sub(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_sub_can(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        can: c_int,
    );
    pub fn fmpq_poly_sub_can(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        can: c_int,
    );
    pub fn _fmpq_poly_sub_series(
        rpoly: *mut fmpz,
        rden: *const fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sub_series(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_sub_series_can(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
        can: c_int,
    );
    pub fn fmpq_poly_sub_series_can(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
        can: c_int,
    );
    pub fn _fmpq_poly_scalar_mul_si(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_scalar_mul_ui(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: mp_limb_t,
    );
    pub fn _fmpq_poly_scalar_mul_fmpz(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: *const fmpz,
    );
    pub fn _fmpq_poly_scalar_mul_fmpq(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        r: *const fmpz,
        s: *const fmpz,
    );
    pub fn fmpq_poly_scalar_mul_si(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: mp_limb_signed_t,
    );
    pub fn fmpq_poly_scalar_mul_ui(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: mp_limb_t,
    );
    pub fn fmpq_poly_scalar_mul_fmpz(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const fmpz,
    );
    pub fn fmpq_poly_scalar_mul_fmpq(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const fmpq,
    );
    pub fn fmpq_poly_scalar_mul_mpz(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const __mpz_struct,
    );
    pub fn fmpq_poly_scalar_mul_mpq(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const __mpq_struct,
    );
    pub fn _fmpq_poly_scalar_div_si(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_scalar_div_ui(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: mp_limb_t,
    );
    pub fn _fmpq_poly_scalar_div_fmpz(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        c: *const fmpz,
    );
    pub fn _fmpq_poly_scalar_div_fmpq(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        r: *const fmpz,
        s: *const fmpz,
    );
    pub fn fmpq_poly_scalar_div_si(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: mp_limb_signed_t,
    );
    pub fn fmpq_poly_scalar_div_ui(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: mp_limb_t,
    );
    pub fn fmpq_poly_scalar_div_fmpz(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const fmpz,
    );
    pub fn fmpq_poly_scalar_div_fmpq(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const fmpq,
    );
    pub fn fmpq_poly_scalar_div_mpz(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const __mpz_struct,
    );
    pub fn fmpq_poly_scalar_div_mpq(
        rop: *mut fmpq_poly_struct,
        op: *const fmpq_poly_struct,
        c: *const __mpq_struct,
    );
    pub fn _fmpq_poly_mul(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    );
    pub fn fmpq_poly_mul(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_mullow(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_mullow(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_addmul(
        rop: *mut fmpq_poly_struct,
        op1: *const fmpq_poly_struct,
        op2: *const fmpq_poly_struct,
    );
    pub fn fmpq_poly_submul(
        rop: *mut fmpq_poly_struct,
        op1: *const fmpq_poly_struct,
        op2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_pow(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        e: mp_limb_t,
    );
    pub fn fmpq_poly_pow(rpoly: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct, e: mp_limb_t);
    pub fn _fmpq_poly_pow_trunc(
        res: *mut fmpz,
        resden: *mut fmpz,
        f: *const fmpz,
        fden: *const fmpz,
        flen: mp_limb_signed_t,
        exp: mp_limb_t,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_pow_trunc(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        exp: mp_limb_t,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_shift_left(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_shift_right(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_divrem(
        Q: *mut fmpz,
        q: *mut fmpz,
        R: *const fmpz,
        r: *const fmpz,
        A: *const fmpz,
        a: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        b: *const fmpz,
        lenB: mp_limb_signed_t,
        inv: *const fmpz_preinvn_struct,
    );
    pub fn fmpq_poly_divrem(
        Q: *mut fmpq_poly_struct,
        R: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_div(
        Q: *mut fmpz,
        q: *mut fmpz,
        A: *const fmpz,
        a: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        b: *const fmpz,
        lenB: mp_limb_signed_t,
        inv: *const fmpz_preinvn_struct,
    );
    pub fn fmpq_poly_div(
        Q: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_rem(
        R: *mut fmpz,
        r: *mut fmpz,
        A: *const fmpz,
        a: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        b: *const fmpz,
        lenB: mp_limb_signed_t,
        inv: *const fmpz_preinvn_struct,
    );
    pub fn fmpq_poly_rem(
        R: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_powers_precompute(
        B: *const fmpz,
        denB: *mut fmpz,
        len: mp_limb_signed_t,
    ) -> *mut fmpq_poly_struct;
    pub fn fmpq_poly_powers_precompute(
        pinv: *mut fmpq_poly_powers_precomp_struct,
        poly: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_powers_clear(powers: *const fmpq_poly_struct, len: mp_limb_signed_t);
    pub fn fmpq_poly_powers_clear(pinv: *const fmpq_poly_powers_precomp_struct);
    pub fn _fmpq_poly_rem_powers_precomp(
        A: *mut fmpz,
        denA: *mut fmpz,
        m: mp_limb_signed_t,
        B: *const fmpz,
        denB: *const fmpz,
        n: mp_limb_signed_t,
        powers: *const fmpq_poly_struct,
    );
    pub fn fmpq_poly_rem_powers_precomp(
        R: *mut fmpq_poly_struct,
        A: *const fmpq_poly_struct,
        B: *const fmpq_poly_struct,
        B_inv: *const fmpq_poly_powers_precomp_struct,
    );
    pub fn _fmpq_poly_divides(
        qpoly: *mut fmpz,
        qden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_divides(
        q: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    ) -> c_int;
    pub fn fmpq_poly_remove(
        q: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    ) -> mp_limb_signed_t;
    pub fn _fmpq_poly_inv_series_newton(
        Qinv: *mut fmpz,
        Qinvden: *mut fmpz,
        Q: *const fmpz,
        Qden: *const fmpz,
        Qlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_inv_series_newton(
        Qinv: *mut fmpq_poly_struct,
        Q: *mut fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_inv_series(
        Qinv: *mut fmpz,
        Qinvden: *mut fmpz,
        Q: *const fmpz,
        Qden: *const fmpz,
        Qlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_inv_series(
        Qinv: *mut fmpq_poly_struct,
        Q: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_div_series(
        Q: *mut fmpz,
        denQ: *mut fmpz,
        A: *const fmpz,
        denA: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        denB: *const fmpz,
        lenB: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_div_series(
        Q: *mut fmpq_poly_struct,
        A: *const fmpq_poly_struct,
        B: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_gcd(
        G: *mut fmpz,
        denG: *mut fmpz,
        A: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        lenB: mp_limb_signed_t,
    );
    pub fn fmpq_poly_gcd(
        G: *mut fmpq_poly_struct,
        A: *const fmpq_poly_struct,
        B: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_xgcd(
        G: *mut fmpz,
        denG: *mut fmpz,
        S: *mut fmpz,
        denS: *mut fmpz,
        T: *mut fmpz,
        denT: *mut fmpz,
        A: *const fmpz,
        denA: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        denB: *const fmpz,
        lenB: mp_limb_signed_t,
    );
    pub fn fmpq_poly_xgcd(
        G: *mut fmpq_poly_struct,
        S: *mut fmpq_poly_struct,
        T: *mut fmpq_poly_struct,
        A: *const fmpq_poly_struct,
        B: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_lcm(
        G: *mut fmpz,
        denG: *mut fmpz,
        A: *const fmpz,
        lenA: mp_limb_signed_t,
        B: *const fmpz,
        lenB: mp_limb_signed_t,
    );
    pub fn fmpq_poly_lcm(
        L: *mut fmpq_poly_struct,
        A: *const fmpq_poly_struct,
        B: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_resultant(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    );
    pub fn fmpq_poly_resultant(r: *mut fmpq, f: *const fmpq_poly_struct, g: *const fmpq_poly_struct);
    pub fn _fmpq_poly_resultant_div(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        divisor: *const fmpz,
        nbits: mp_limb_signed_t,
    );
    pub fn fmpq_poly_resultant_div(
        r: *mut fmpq,
        f: *const fmpq_poly_struct,
        g: *const fmpq_poly_struct,
        divisor: *const fmpz,
        nbits: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_derivative(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_derivative(res: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct);
    pub fn _fmpq_poly_integral(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_integral(res: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct);
    pub fn _fmpq_poly_invsqrt_series(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_invsqrt_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_sqrt_series(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sqrt_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_power_sums(
        res: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        len: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_power_sums(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_power_sums_to_poly(
        res: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_power_sums_to_fmpz_poly(res: *mut fmpz_poly_struct, Q: *const fmpq_poly_struct);
    pub fn fmpq_poly_power_sums_to_poly(res: *mut fmpq_poly_struct, Q: *const fmpq_poly_struct);
    pub fn _fmpq_poly_log_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        f: *const fmpz,
        fden: *const fmpz,
        flen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_log_series(
        res: *mut fmpq_poly_struct,
        f: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_exp_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_exp_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_atan_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_atan_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_atanh_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_atanh_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_asin_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_asin_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_asinh_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_asinh_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_tan_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_tan_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_sin_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sin_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_cos_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_cos_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_sin_cos_series(
        s: *mut fmpz,
        sden: *mut fmpz,
        c: *mut fmpz,
        cden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sin_cos_series(
        res1: *mut fmpq_poly_struct,
        res2: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_sinh_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_sinh_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_cosh_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_cosh_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_tanh_series(
        g: *mut fmpz,
        gden: *mut fmpz,
        h: *const fmpz,
        hden: *const fmpz,
        hlen: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_tanh_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_legendre_p(coeffs: *mut fmpz, den: *mut fmpz, n: mp_limb_t);
    pub fn fmpq_poly_legendre_p(poly: *mut fmpq_poly_struct, n: mp_limb_t);
    pub fn _fmpq_poly_laguerre_l(coeffs: *mut fmpz, den: *mut fmpz, n: mp_limb_t);
    pub fn fmpq_poly_laguerre_l(poly: *mut fmpq_poly_struct, n: mp_limb_t);
    pub fn _fmpq_poly_gegenbauer_c(coeffs: *mut fmpz, den: *mut fmpz, n: mp_limb_t, a: *const fmpq);
    pub fn fmpq_poly_gegenbauer_c(poly: *mut fmpq_poly_struct, n: mp_limb_t, a: *const fmpq);
    pub fn _fmpq_poly_evaluate_fmpz(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        a: *const fmpz,
    );
    pub fn fmpq_poly_evaluate_fmpz(res: *mut fmpq, poly: *const fmpq_poly_struct, a: *const fmpz);
    pub fn _fmpq_poly_evaluate_fmpq(
        rnum: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        anum: *const fmpz,
        aden: *const fmpz,
    );
    pub fn fmpq_poly_evaluate_fmpq(res: *mut fmpq, poly: *const fmpq_poly_struct, a: *const fmpq);
    pub fn fmpq_poly_evaluate_mpz(
        res: *mut __mpq_struct,
        poly: *const fmpq_poly_struct,
        a: *const __mpz_struct,
    );
    pub fn fmpq_poly_evaluate_mpq(
        res: *mut __mpq_struct,
        poly: *const fmpq_poly_struct,
        a: *const __mpq_struct,
    );
    pub fn _fmpq_poly_interpolate_fmpz_vec(
        poly: *mut fmpz,
        den: *mut fmpz,
        xs: *const fmpz,
        ys: *const fmpz,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_interpolate_fmpz_vec(
        poly: *mut fmpq_poly_struct,
        xs: *const fmpz,
        ys: *const fmpz,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_compose(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
    );
    pub fn fmpq_poly_compose(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
    );
    pub fn _fmpq_poly_rescale(
        res: *mut fmpz,
        denr: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        xnum: *const fmpz,
        xden: *const fmpz,
    );
    pub fn fmpq_poly_rescale(res: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct, x: *const fmpq);
    pub fn _fmpq_poly_compose_series_horner(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_compose_series_horner(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_compose_series_brent_kung(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_compose_series_brent_kung(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_compose_series(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        poly2: *const fmpz,
        den2: *const fmpz,
        len2: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_compose_series(
        res: *mut fmpq_poly_struct,
        poly1: *const fmpq_poly_struct,
        poly2: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_revert_series_lagrange(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_revert_series_lagrange(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_revert_series_lagrange_fast(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_revert_series_lagrange_fast(
        res: *mut fmpq_poly_struct,
        poly: *mut fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_revert_series_newton(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_revert_series_newton(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_revert_series(
        res: *mut fmpz,
        den: *mut fmpz,
        poly1: *const fmpz,
        den1: *const fmpz,
        len1: mp_limb_signed_t,
        n: mp_limb_signed_t,
    );
    pub fn fmpq_poly_revert_series(
        res: *mut fmpq_poly_struct,
        poly: *const fmpq_poly_struct,
        n: mp_limb_signed_t,
    );
    pub fn _fmpq_poly_content(
        res: *mut fmpq,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_content(res: *mut fmpq, poly: *const fmpq_poly_struct);
    pub fn _fmpq_poly_primitive_part(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_primitive_part(res: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct);
    pub fn _fmpq_poly_is_monic(
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_is_monic(poly: *const fmpq_poly_struct) -> c_int;
    pub fn _fmpq_poly_make_monic(
        rpoly: *mut fmpz,
        rden: *mut fmpz,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    );
    pub fn fmpq_poly_make_monic(res: *mut fmpq_poly_struct, poly: *const fmpq_poly_struct);
    pub fn fmpq_poly_is_squarefree(poly: *const fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_debug(poly: *const fmpq_poly_struct) -> c_int;
    pub fn _fmpq_poly_fprint(
        file: *mut FILE,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_fprint(file: *mut FILE, poly: *const fmpq_poly_struct) -> c_int;
    pub fn _fmpq_poly_fprint_pretty(
        file: *mut FILE,
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        x: *const c_char,
    ) -> c_int;
    pub fn fmpq_poly_fprint_pretty(
        file: *mut FILE,
        poly: *const fmpq_poly_struct,
        var: *const c_char,
    ) -> c_int;
    pub fn _fmpq_poly_print(
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
    ) -> c_int;
    pub fn fmpq_poly_print(poly: *const fmpq_poly_struct) -> c_int;
    pub fn _fmpq_poly_print_pretty(
        poly: *const fmpz,
        den: *const fmpz,
        len: mp_limb_signed_t,
        x: *const c_char,
    ) -> c_int;
    pub fn fmpq_poly_print_pretty(
        poly: *const fmpq_poly_struct,
        var: *const c_char,
    ) -> c_int;
    pub fn fmpq_poly_fread(file: *const FILE, poly: *mut fmpq_poly_struct) -> c_int;
    pub fn fmpq_poly_read(poly: *mut fmpq_poly_struct) -> c_int;
}