Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - headers - pariinl.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30565-738e569de9) Lines: 1420 1532 92.7 %
Date: 2025-11-30 09:23:42 Functions: 648 704 92.0 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
F2m_clear 0
F2m_coeff 8038890
F2m_copy 200497
F2m_flip 1554050
F2m_set 798
F2v_clear 12355392
F2v_coeff 661327935
F2v_copy 4487
F2v_ei 42
F2v_flip 1554050
F2v_set 101404088
F2v_to_F2x 37835
F2xX_shift 0
F2x_clear 12355402
F2x_coeff 667876984
F2x_copy 60450305
F2x_div 1570079
F2x_equal 4657828
F2x_equal1 2873986
F2x_flip 1554050
F2x_renormalize 115181227
F2x_set 124716730
F2xqX_div 33173
F3m_coeff 3256769
F3m_copy 0
F3m_set 0
Flm_copy 6433739
Flm_row 8742312
Flv_copy 2555266
Flx_constant 334023
Flx_copy 173798828
Flx_div 1999056
Flx_div_pre 21705496
Flx_equal1 8331193
Flx_lead 980590
Flx_mulu 1105503
FlxqX_div 0
FlxqX_div_pre 165416
Flxq_add 0
Flxq_sub 0
FpV_FpC_mul 0
FpXQX_div 4526
FpXQX_renormalize 4693737
FpXQ_add 0
FpXQ_sub 0
FpXX_renormalize 849896
FpXY_Fq_evaly 20587
FpX_div 5581249
FpX_renormalize 144579738
Fp_add 181635177
Fp_addmul 11384761
Fp_center 77233864
Fp_center_i 18053029
Fp_div 15035130
Fp_divu 15129588
Fp_double 22311159
Fp_halve 247348
Fp_inv 23440206
Fp_invsafe 1100560
Fp_mul 201084860
Fp_muls 17780
Fp_mulu 70732346
Fp_neg 31478984
Fp_red 82084860
Fp_sqr 64859937
Fp_sub 203937005
FqXQ_add 0
FqXQ_div 0
FqXQ_inv 0
FqXQ_invsafe 0
FqXQ_mul 22766
FqXQ_pow 0
FqXQ_sqr 0
FqXQ_sub 0
FqX_Fp_mul 572114
FqX_Fq_mul 427289
FqX_add 127694
FqX_ddf 7
FqX_degfact 47786
FqX_deriv 40061
FqX_div 38567
FqX_div_by_X_x 69629
FqX_divrem 0
FqX_extgcd 445047
FqX_factor 141072
FqX_factor_squarefree 7
FqX_gcd 8288
FqX_get_red 6090
FqX_halfgcd 0
FqX_halve 19411
FqX_integ 0
FqX_is_squarefree 683802
FqX_mul 367814
FqX_mulu 21942
FqX_neg 24956
FqX_normalize 4144
FqX_powu 1295
FqX_red 25354
FqX_rem 37743
FqX_roots 7273
FqX_sqr 71855
FqX_sub 68607
FqX_to_mod 175
FqXn_exp 0
FqXn_expint 6590
FqXn_inv 7126
FqXn_mul 263403
FqXn_sqr 0
Fq_red 3106374
Fq_to_FpXQ 73792
GENbinbase 964392878
QV_isscalar 54402080
Q_abs 8063973
Q_abs_shallow 120244
Qtoss 35322
R_abs 0
R_abs_shallow 13097
RgC_fpnorml2 622070
RgC_gtofp 34012833
RgC_gtomp 574
RgM_dimensions 9742277
RgM_fpnorml2 22788
RgM_gtofp 8252443
RgM_gtomp 21
RgM_minor 1036
RgM_shallowcopy 22170733
RgV_gtofp 56
RgV_is_QV 140757
RgV_is_ZV 32167242
RgV_isin 110144
RgV_isin_i 110144
RgV_isscalar 1210304
RgXQX_div 1904
RgXQX_rem 127635
RgX_coeff 2669861
RgX_copy 103409240
RgX_div 7000740
RgX_equal_var 26883188
RgX_fpnorml2 61607
RgX_gtofp 7147660
RgX_is_QX 400138
RgX_is_ZX 22422748
RgX_is_monomial 1331798
RgX_is_rational 68309
RgX_isscalar 0
RgX_renormalize 349807
RgX_shift_inplace 479367
RgX_shift_inplace_init 479367
RgX_to_RgV 140
Rg_col_ei 1451352
Rg_to_Fq 756
ZC_hnfrem 10690819
ZM_ZV_mod 596634
ZM_hnfrem 363855
ZM_lll 7112427
ZV_ZV_mod 8131286
ZV_dvd 23485
ZV_isscalar 23098190
ZV_to_zv 3211413
ZXQ_mul 2162077
ZXQ_sqr 961100
ZX_equal1 12893
ZX_is_monic 7376020
ZX_renormalize 155001611
Z_ispower 98
Z_issquare 458923
abgrp_get_cyc 12230153
abgrp_get_gen 1765019
abgrp_get_no 355183
absfrac 46643654
absfrac_shallow 28237
addmuliu 535773
addmuliu_inplace 59698866
affc_fixlg 249621
affgr 898866
bid_get_MOD 2157249
bid_get_U 3680230
bid_get_arch 41188
bid_get_archp 2397067
bid_get_cyc 5739520
bid_get_fact 2498910
bid_get_fact2 2201567
bid_get_gen 64274
bid_get_gen_nocheck 0
bid_get_grp 5804369
bid_get_ideal 72842
bid_get_mod 1521921
bid_get_no 0
bid_get_sarch 48594
bid_get_sprk 2157970
bin_copy 497346593
bit_accuracy 3162840427
bit_accuracy_mul 3175472
bit_prec 142677623
bnf_get_clgp 5374916
bnf_get_cyc 3686068
bnf_get_fu 25859
bnf_get_fu_nocheck 289081
bnf_get_gen 1680298
bnf_get_logfu 2874719
bnf_get_nf 9863703
bnf_get_no 8372
bnf_get_reg 648
bnf_get_sunits 1367778
bnf_get_tuN 283013
bnf_get_tuU 303586
bnr_get_bid 2045858
bnr_get_bnf 3750903
bnr_get_clgp 2830008
bnr_get_cyc 2522325
bnr_get_gen 7847
bnr_get_gen_nocheck 70
bnr_get_mod 77116
bnr_get_nf 1368106
bnr_get_no 277490
both_odd 123991471
cbrtr 0
cbrtr_abs 0
cgetalloc 10166
cgetc 975459
cgiv 102119724
checkell_i 5593292
closure_arity 371248303
closure_codestr 321382439
closure_get_code 0
closure_get_data 321332717
closure_get_dbg 13621
closure_get_frame 14170438
closure_get_oper 321358385
closure_get_text 37051
closure_is_variadic 44821374
col_ei 5925968
coltrunc_init 740250
const_col 9729875
const_vec 34480579
const_vecsmall 19707203
constant_coeff 1441408
cxcompotor 18221463
cxnorm 90945503
cxtofp 9084874
cxtoreal 337206
cyc_get_expo 2757786
cyclic_perm 99911
dbllog2r 92831068
degpol 5520346650
div_content 58476
divsBIL 8096736436
ellQp_get_p 1134
ellQp_get_prec 308
ellQp_get_zero 1463
ellR_get_prec 232750
ellR_get_sign 371535
ell_get_a1 8997081
ell_get_a2 7106181
ell_get_a3 8814049
ell_get_a4 8536722
ell_get_a6 10370960
ell_get_b2 7371030
ell_get_b4 2550216
ell_get_b6 3863115
ell_get_b8 3297414
ell_get_c4 11018333
ell_get_c6 13474651
ell_get_disc 16815617
ell_get_j 2126227
ell_get_type 12499279
ell_is_inf 52432845
ellff_get_a4a6 800027
ellff_get_field 2036854
ellinf 1869381
ellnf_get_bnf 126
ellnf_get_nf 2027652
equali1 1175184717
equalim1 139505881
err_get_compo 294
err_get_num 62523
gaddgs 123248627
gal_get_den 27874
gal_get_e 91
gal_get_gen 15449
gal_get_group 80394
gal_get_invvdm 27881
gal_get_mod 23772
gal_get_orders 6678
gal_get_p 6020
gal_get_pol 36337
gal_get_roots 32753
gc_GEN 256219265
gc_INT 4104081629
gc_INT_affii 8486607
gc_all 110007556
gc_leaf 1138474715
gc_slice 2204893
gc_upto 1949177062
gchar_copy_precs 1225
gchar_get_DLdata 190673
gchar_get_S 36995
gchar_get_U 0
gchar_get_Ui 10983
gchar_get_basis 32816
gchar_get_bnf 205373
gchar_get_cyc 16177
gchar_get_evalprec 4011
gchar_get_hnf 0
gchar_get_loccyc 50519
gchar_get_m0 3318
gchar_get_mod 8225
gchar_get_modP 4095
gchar_get_nalg 2044
gchar_get_nc 37261
gchar_get_nf 243946
gchar_get_nfprec 13468
gchar_get_nfree 322
gchar_get_nm 1869
gchar_get_ns 36995
gchar_get_ntors 322
gchar_get_prec 18795
gchar_get_r1 17444
gchar_get_r2 623
gchar_get_sfu 1743
gchar_get_u0 4252
gchar_get_zm 281911
gchar_set_HUUi 630
gchar_set_basis 1575
gchar_set_cyc 1575
gchar_set_evalprec 1813
gchar_set_m0 945
gchar_set_nalg 630
gchar_set_nf 2110
gchar_set_nfprec 2968
gchar_set_nfree 630
gchar_set_ntors 630
gchar_set_prec 1225
gchar_set_u0 2121
gcmpgs 761910
gdivsg 531592
gen_I 1269852
gener_Fq_local 29932
gequalgs 29176
get_F2x_degree 1928974
get_F2x_mod 2499160
get_F2x_var 2534107
get_F2xqX_degree 200851
get_F2xqX_mod 343
get_F2xqX_var 375375
get_Flx_degree 83757253
get_Flx_mod 25604291
get_Flx_var 68399361
get_FlxqX_degree 317565
get_FlxqX_mod 8033
get_FlxqX_var 264420
get_FpXQX_degree 3589
get_FpXQX_mod 146583
get_FpXQX_var 51630
get_FpX_degree 6424891
get_FpX_mod 3394559
get_FpX_var 6957856
gisdouble 2988044
gmax_shallow 13510220
gmaxsg 0
gmin_shallow 878347
gminsg 0
gmulgs 22499933
gmulgu 282059385
gsubgs 1724809
gtodouble 60797901
gtofp 254251004
gtomp 22428
gtos 85854578
gtou 98319
guncloneNULL 48232088
guncloneNULL_deep 1447278
gval 6230
hash_str 2756815
hash_str_len 31550432
icopy_avma 8035550303
idealchineseinit 5427
idealred 138522
identity_ZV 8113
identity_perm 3242666
identity_zv 3267016
inf_get_sign 1453140
inv_content 0
is_bigint 562606747
is_const_t 4888405758
is_extscalar_t 6876
is_intreal_t 9583982
is_matvec_t 659358001
is_noncalc_t 85864349
is_pm1 2204167210
is_qfb_t 0
is_rational_t 5035316
is_real_t 62063859
is_recursive_t 9239230474
is_scalar_t 375669978
is_universal_constant 325893572
is_vec_t 43964184
isint1 17586638
isintm1 5711186
isintzero 2838167689
ismpzero 9583870
isonstack 8261215839
killblock 1931925
leading_coeff 170557455
leafcopy_avma 577426629
lg_increase 318873756
lgcols 350258733
lgpol 2690443548
lincombii 38199797
locs_get_Lgenfil 1288
locs_get_Lsprk 193935
locs_get_cyc 52136
locs_get_famod 1288
locs_get_m_infty 209475
locs_get_mod 8225
logint 754892
matpascal 3983
matslice 16817791
mkcol 10640914
mkcol2 156852251
mkcol2s 4416244
mkcol3 88314
mkcol3s 315
mkcol4 103467
mkcol4s 0
mkcol5 94
mkcol6 232589
mkcolcopy 33502
mkcols 40411
mkcomplex 91636780
mkerr 0
mkfrac 41641833
mkfraccopy 4999269
mkfracss 1209563
mkintmod 8092623
mkintmodu 1813
mkmat 4750927
mkmat2 33657904
mkmat22 50276198
mkmat22s 207578
mkmat3 17001
mkmat4 84
mkmat5 0
mkmatcopy 122242
mkmoo 108851
mkoo 1332032
mkpadic 2009
mkpolmod 3105125
mkqfb 27919334
mkquad 69118
mkrfrac 698439
mkrfraccopy 14
mkvec 71145934
mkvec2 185450171
mkvec2copy 114570
mkvec2s 220416
mkvec3 122207638
mkvec3s 524441
mkvec4 10106296
mkvec4s 21
mkvec5 15185248
mkveccopy 122521
mkvecs 168
mkvecsmall 131682158
mkvecsmall2 233637590
mkvecsmall3 104041095
mkvecsmall4 17825103
mkvecsmall5 1731128
modpr_get_T 13867713
modpr_get_p 1888432
modpr_get_pr 31238448
mul_content 2654083
mul_denom 10710320
mulsubii 3881934
nbits2extraprec 1456639547
nbits2ndec 228
nbits2nlong 12677923
nbits2prec 186144979
nbrows 157481263
nchar2nlong 127412402
ndec2nbits 8270
ndec2nlong 41549
ndec2prec 33279
nfV_to_scalar_or_alg 26300
nf_get_G 303577
nf_get_M 21171992
nf_get_Tr 22083
nf_get_degree 71351598
nf_get_diff 4438
nf_get_disc 463866
nf_get_index 3711341
nf_get_invzk 9766161
nf_get_pol 98060175
nf_get_r1 22892523
nf_get_r2 4154
nf_get_ramified_primes 64813
nf_get_roots 1627837
nf_get_roundG 1746606
nf_get_sign 519552
nf_get_varn 1503726
nf_get_zk 4382
nf_get_zkden 5462559
nf_get_zkprimpart 5416722
normalize_frac 17205173
odd 2084580937
pari_calloc 47699
pari_err_BUG 14
pari_err_COMPONENT 214
pari_err_CONSTPOL 21
pari_err_COPRIME 84
pari_err_DIM 718
pari_err_DOMAIN 2862
pari_err_FILE 0
pari_err_FILEDESC 36
pari_err_FLAG 98
pari_err_IMPL 539
pari_err_INV 20018
pari_err_IRREDPOL 63
pari_err_MAXPRIME 0
pari_err_MODULUS 1316
pari_err_OP 406
pari_err_OVERFLOW 156
pari_err_PACKAGE 0
pari_err_PREC 238
pari_err_PRIME 98
pari_err_PRIORITY 238
pari_err_ROOTS0 63
pari_err_SQRTN 7084
pari_err_TYPE 15370
pari_err_TYPE2 3493
pari_err_VAR 371
pari_free 510759463
pari_malloc 746656117
pari_realloc 1890
pari_realloc_ip 2267886
pari_stack_alloc 1019616380
pari_stack_base 1025208604
pari_stack_delete 5634610
pari_stack_init 6084115
pari_stack_new 924909792
pari_stack_pushp 5851
perm_conj 418299
perm_inv 2782948
perm_mul 80932300
perm_sqr 728
pol0_F2x 13240729
pol0_Flx 103507725
pol1_F2x 3957266
pol1_Flx 55079821
pol_0 83002159
pol_1 3756449
pol_x 3858389
pol_xn 2249981
pol_xnall 294
polx_F2x 1078495
polx_Flx 37829585
polx_zx 0
polxn_Flx 371
powIs 1561
powii 43178353
pr_get_e 15952944
pr_get_f 26041827
pr_get_gen 12062754
pr_get_p 91709670
pr_get_tau 48872366
pr_is_inert 16910254
pr_norm 1088598
prec2lg 4466231733
prec2nbits 103961690
prec2nbits_mul 581163
prec2ndec 9778
precdbl 475514
qfb_disc 18514537
qfb_disc3 4990612
qfb_is_qfi 62945468
quad_disc 1085
quadnorm 69881
random_Fq 0
remsBIL 8005811750
rnf_get_absdegree 1392746
rnf_get_alpha 1428
rnf_get_degree 2506307
rnf_get_disc 357
rnf_get_idealdisc 1386
rnf_get_index 105
rnf_get_invzk 1225
rnf_get_k 1225
rnf_get_map 135659
rnf_get_nf 786030
rnf_get_nfdegree 21455
rnf_get_nfpol 255354
rnf_get_nfvarn 4886
rnf_get_nfzk 7245
rnf_get_pol 2845164
rnf_get_polabs 327628
rnf_get_ramified_primes 2849
rnf_get_varn 574
rnf_get_zk 4830
row 763997
row_i 987
rowcopy 204988
rowpermute 14709734
rowslice 79347755
rowslicepermute 184684
rowsplice 273
ser_isexactzero 10120284
shallowcopy 27640201
sqrfrac 4148154
sqrti 6666044
sqrtnr 2808776
sqrtr 80366994
sstoQ 1097215
sturm 385
submulii 32847732
submuliu 7742
submuliu_inplace 60197403
truecoef 0
trunc_safe 0
ulogint 1717019
upr_norm 346133
uutoQ 1600198
vec_append 3465581
vec_ei 1714591
vec_lengthen 18946
vec_prepend 313999
vec_setconst 0
vec_shorten 11557
vec_to_vecsmall 4036826
veclast 9372669
vecmodii 0
vecmoduu 49784
vecpermute 20529658
vecreverse 697235
vecreverse_inplace 2605
vecslice 656313876
vecslicepermute 2689667
vecsmall_append 4111378
vecsmall_coincidence 0
vecsmall_concat 1464429
vecsmall_copy 4404204
vecsmall_ei 584714
vecsmall_indexmax 21
vecsmall_indexmin 21
vecsmall_isin 84
vecsmall_lengthen 547
vecsmall_lexcmp 7043259
vecsmall_max 1164703
vecsmall_min 2345
vecsmall_pack 84
vecsmall_prefixcmp 108088071
vecsmall_prepend 186991
vecsmall_reverse 3052
vecsmall_shorten 74578
vecsmall_to_col 7837698
vecsmall_to_vec 511809
vecsmall_to_vec_inplace 3304
vecsmallpermute 78736660
vecsmalltrunc_append 101543683
vecsmalltrunc_init 190974947
vecsplice 384918
vectrunc_append 16161866
vectrunc_append_batch 12306
vectrunc_init 12066640
zc_to_ZC 7823516
zero_F2m 0
zero_F2m_copy 845094
zero_F2v 3648067
zero_F2x 1350
zero_Flm 2830230
zero_Flm_copy 235927
zero_Flv 59495714
zero_Flx 1426902
zero_zm 0
zero_zv 36736825
zero_zx 0
zerocol 122289450
zeromat 109135
zeromatcopy 14240245
zeropadic 855699
zeropadic_shallow 17024
zeropol 42358743
zeroser 138908
zerovec 28455616
zerovec_block 28947
zm_copy 0
zm_row 0
zm_to_zxV 0
zm_transpose 266
znstar_get_N 38655073
znstar_get_U 176107
znstar_get_Ui 46788
znstar_get_conreycyc 7979693
znstar_get_conreygen 3290176
znstar_get_cyc 262088
znstar_get_faN 7331711
znstar_get_gen 16150
znstar_get_no 14
znstar_get_pe 2869063
zv_copy 2184016
zv_to_ZV 503010
zv_to_zx 104146
zx_renormalize 14049
zx_shift 0
zx_to_zv 0

Generated by: LCOV version 1.16