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 30563-682842a727) Lines: 1420 1532 92.7 %
Date: 2025-11-29 09:23:24 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 8038867
F2m_copy 200506
F2m_flip 1554047
F2m_set 798
F2v_clear 12355382
F2v_coeff 661327685
F2v_copy 4487
F2v_ei 42
F2v_flip 1554047
F2v_set 101404127
F2v_to_F2x 37836
F2xX_shift 0
F2x_clear 12355387
F2x_coeff 667844768
F2x_copy 60411003
F2x_div 1570098
F2x_equal 4657166
F2x_equal1 2873959
F2x_flip 1554047
F2x_renormalize 115158195
F2x_set 124700663
F2xqX_div 33173
F3m_coeff 3256668
F3m_copy 0
F3m_set 0
Flm_copy 6433575
Flm_row 8741873
Flv_copy 2555219
Flx_constant 334028
Flx_copy 173812540
Flx_div 1999014
Flx_div_pre 21706050
Flx_equal1 8331153
Flx_lead 979976
Flx_mulu 1105468
FlxqX_div 0
FlxqX_div_pre 165414
Flxq_add 0
Flxq_sub 0
FpV_FpC_mul 0
FpXQX_div 4526
FpXQX_renormalize 4693512
FpXQ_add 0
FpXQ_sub 0
FpXX_renormalize 849896
FpXY_Fq_evaly 20587
FpX_div 5581150
FpX_renormalize 144578501
Fp_add 181834173
Fp_addmul 11440389
Fp_center 77269309
Fp_center_i 18062023
Fp_div 15035159
Fp_divu 15129567
Fp_double 22429285
Fp_halve 247348
Fp_inv 23439993
Fp_invsafe 1100548
Fp_mul 201192894
Fp_muls 17780
Fp_mulu 70839254
Fp_neg 31477765
Fp_red 82086326
Fp_sqr 65204644
Fp_sub 204202459
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 572124
FqX_Fq_mul 427281
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 445050
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 367812
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 3106425
Fq_to_FpXQ 73792
GENbinbase 964384035
QV_isscalar 54401964
Q_abs 8064115
Q_abs_shallow 120240
Qtoss 35322
R_abs 0
R_abs_shallow 13097
RgC_fpnorml2 622076
RgC_gtofp 34012713
RgC_gtomp 574
RgM_dimensions 9742107
RgM_fpnorml2 22788
RgM_gtofp 8252389
RgM_gtomp 21
RgM_minor 1036
RgM_shallowcopy 22170211
RgV_gtofp 56
RgV_is_QV 140762
RgV_is_ZV 32167248
RgV_isin 110144
RgV_isin_i 110144
RgV_isscalar 1210306
RgXQX_div 1904
RgXQX_rem 127635
RgX_coeff 2669861
RgX_copy 103409022
RgX_div 7000740
RgX_equal_var 26883192
RgX_fpnorml2 61607
RgX_gtofp 7147599
RgX_is_QX 400151
RgX_is_ZX 22422666
RgX_is_monomial 1331887
RgX_is_rational 68312
RgX_isscalar 0
RgX_renormalize 349807
RgX_shift_inplace 479366
RgX_shift_inplace_init 479366
RgX_to_RgV 140
Rg_col_ei 1451337
Rg_to_Fq 756
ZC_hnfrem 10690937
ZM_ZV_mod 596612
ZM_hnfrem 363861
ZM_lll 7112323
ZV_ZV_mod 8131299
ZV_dvd 23485
ZV_isscalar 23097813
ZV_to_zv 3211415
ZXQ_mul 2161978
ZXQ_sqr 961012
ZX_equal1 12893
ZX_is_monic 7375986
ZX_renormalize 154992571
Z_ispower 98
Z_issquare 458922
abgrp_get_cyc 12230182
abgrp_get_gen 1765032
abgrp_get_no 355191
absfrac 46643882
absfrac_shallow 28237
addmuliu 535737
addmuliu_inplace 59703178
affc_fixlg 249619
affgr 898866
bid_get_MOD 2157261
bid_get_U 3680239
bid_get_arch 41188
bid_get_archp 2397074
bid_get_cyc 5739532
bid_get_fact 2498919
bid_get_fact2 2201580
bid_get_gen 64274
bid_get_gen_nocheck 0
bid_get_grp 5804386
bid_get_ideal 72842
bid_get_mod 1521922
bid_get_no 0
bid_get_sarch 48594
bid_get_sprk 2157987
bin_copy 497341209
bit_accuracy 3162727524
bit_accuracy_mul 3175472
bit_prec 142675400
bnf_get_clgp 5374929
bnf_get_cyc 3686064
bnf_get_fu 25859
bnf_get_fu_nocheck 289091
bnf_get_gen 1680317
bnf_get_logfu 2874715
bnf_get_nf 9863726
bnf_get_no 8372
bnf_get_reg 648
bnf_get_sunits 1367780
bnf_get_tuN 283004
bnf_get_tuU 303576
bnr_get_bid 2045866
bnr_get_bnf 3750895
bnr_get_clgp 2830016
bnr_get_cyc 2522340
bnr_get_gen 7847
bnr_get_gen_nocheck 70
bnr_get_mod 77119
bnr_get_nf 1368125
bnr_get_no 277499
both_odd 123927586
cbrtr 0
cbrtr_abs 0
cgetalloc 10166
cgetc 975455
cgiv 102123227
checkell_i 5593349
closure_arity 371283485
closure_codestr 321419979
closure_get_code 0
closure_get_data 321369338
closure_get_dbg 13621
closure_get_frame 14170176
closure_get_oper 321398174
closure_get_text 37051
closure_is_variadic 44820947
col_ei 5925921
coltrunc_init 740250
const_col 9729902
const_vec 34481542
const_vecsmall 19706871
constant_coeff 1441402
cxcompotor 18219575
cxnorm 90943988
cxtofp 9083902
cxtoreal 337203
cyc_get_expo 2757787
cyclic_perm 99911
dbllog2r 92828958
degpol 5521584353
div_content 58477
divsBIL 8097117276
ellQp_get_p 1134
ellQp_get_prec 308
ellQp_get_zero 1463
ellR_get_prec 232750
ellR_get_sign 371535
ell_get_a1 8997090
ell_get_a2 7106177
ell_get_a3 8814058
ell_get_a4 8536718
ell_get_a6 10370956
ell_get_b2 7371043
ell_get_b4 2550216
ell_get_b6 3863115
ell_get_b8 3297414
ell_get_c4 11018441
ell_get_c6 13474848
ell_get_disc 16815822
ell_get_j 2126227
ell_get_type 12499437
ell_is_inf 52456224
ellff_get_a4a6 800037
ellff_get_field 2036856
ellinf 1869412
ellnf_get_bnf 126
ellnf_get_nf 2027635
equali1 1175188414
equalim1 139505848
err_get_compo 294
err_get_num 62523
gaddgs 123248616
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 256225818
gc_INT 4105211558
gc_INT_affii 8489966
gc_all 110007675
gc_leaf 1138774947
gc_slice 2204819
gc_upto 1949180816
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 761929
gdivsg 531591
gen_I 1269832
gener_Fq_local 29932
gequalgs 29176
get_F2x_degree 1928917
get_F2x_mod 2499132
get_F2x_var 2534046
get_F2xqX_degree 200851
get_F2xqX_mod 343
get_F2xqX_var 375375
get_Flx_degree 83759683
get_Flx_mod 25605027
get_Flx_var 68403098
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 3394536
get_FpX_var 6957809
gisdouble 2987453
gmax_shallow 13510220
gmaxsg 0
gmin_shallow 878310
gminsg 0
gmulgs 22502338
gmulgu 282059385
gsubgs 1724809
gtodouble 60795183
gtofp 254253914
gtomp 22428
gtos 85854571
gtou 98308
guncloneNULL 48227111
guncloneNULL_deep 1442417
gval 6230
hash_str 2756815
hash_str_len 31550264
icopy_avma 8036130051
idealchineseinit 5427
idealred 138521
identity_ZV 8113
identity_perm 3242666
identity_zv 3267016
inf_get_sign 1453219
inv_content 0
is_bigint 562613758
is_const_t 4889038139
is_extscalar_t 6876
is_intreal_t 9583728
is_matvec_t 659388534
is_noncalc_t 85864468
is_pm1 2204069074
is_qfb_t 0
is_rational_t 5035327
is_real_t 62063858
is_recursive_t 9239028619
is_scalar_t 375670654
is_universal_constant 325884409
is_vec_t 43964171
isint1 17586500
isintm1 5711057
isintzero 2838300099
ismpzero 9583615
isonstack 8262851424
killblock 1929500
leading_coeff 170557387
leafcopy_avma 577378632
lg_increase 319185091
lgcols 350252747
lgpol 2691110675
lincombii 38188438
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 754888
matpascal 3983
matslice 16817516
mkcol 10640933
mkcol2 156867279
mkcol2s 4416244
mkcol3 88314
mkcol3s 315
mkcol4 103467
mkcol4s 0
mkcol5 94
mkcol6 232589
mkcolcopy 33502
mkcols 40411
mkcomplex 91626342
mkerr 0
mkfrac 41642111
mkfraccopy 4999317
mkfracss 1209563
mkintmod 8092807
mkintmodu 1813
mkmat 4750846
mkmat2 33657855
mkmat22 50278867
mkmat22s 207578
mkmat3 17001
mkmat4 84
mkmat5 0
mkmatcopy 122235
mkmoo 108847
mkoo 1332112
mkpadic 2009
mkpolmod 3105127
mkqfb 27919222
mkquad 69118
mkrfrac 698439
mkrfraccopy 14
mkvec 71176676
mkvec2 185506524
mkvec2copy 114569
mkvec2s 220418
mkvec3 122209974
mkvec3s 524441
mkvec4 10106262
mkvec4s 21
mkvec5 15185365
mkveccopy 122521
mkvecs 168
mkvecsmall 131678098
mkvecsmall2 233641075
mkvecsmall3 104051380
mkvecsmall4 17837505
mkvecsmall5 1731090
modpr_get_T 13867732
modpr_get_p 1888431
modpr_get_pr 31238456
mul_content 2654043
mul_denom 10710507
mulsubii 3881365
nbits2extraprec 1456612373
nbits2ndec 228
nbits2nlong 12677518
nbits2prec 186141376
nbrows 157478541
nchar2nlong 127411187
ndec2nbits 8270
ndec2nlong 41549
ndec2prec 33279
nfV_to_scalar_or_alg 26300
nf_get_G 303478
nf_get_M 21171654
nf_get_Tr 22084
nf_get_degree 71350983
nf_get_diff 4438
nf_get_disc 463863
nf_get_index 3711337
nf_get_invzk 9766075
nf_get_pol 98058602
nf_get_r1 22892276
nf_get_r2 4154
nf_get_ramified_primes 64813
nf_get_roots 1627739
nf_get_roundG 1746514
nf_get_sign 519551
nf_get_varn 1503738
nf_get_zk 4382
nf_get_zkden 5462613
nf_get_zkprimpart 5416705
normalize_frac 17205174
odd 2084941098
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 510748919
pari_malloc 746650945
pari_realloc 1890
pari_realloc_ip 2268018
pari_stack_alloc 1019670623
pari_stack_base 1025243081
pari_stack_delete 5617671
pari_stack_init 6083989
pari_stack_new 924962918
pari_stack_pushp 5851
perm_conj 418299
perm_inv 2782859
perm_mul 80930974
perm_sqr 728
pol0_F2x 13237878
pol0_Flx 103505912
pol1_F2x 3956789
pol1_Flx 55082480
pol_0 83002190
pol_1 3756367
pol_x 3858431
pol_xn 2249927
pol_xnall 294
polx_F2x 1078431
polx_Flx 37834673
polx_zx 0
polxn_Flx 371
powIs 1561
powii 43178227
pr_get_e 15952511
pr_get_f 26041092
pr_get_gen 12062502
pr_get_p 91708570
pr_get_tau 48871357
pr_is_inert 16909868
pr_norm 1088464
prec2lg 4466532623
prec2nbits 103962058
prec2nbits_mul 581166
prec2ndec 9778
precdbl 475502
qfb_disc 18514492
qfb_disc3 4990563
qfb_is_qfi 62955949
quad_disc 1085
quadnorm 69881
random_Fq 0
remsBIL 8006298597
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 764011
row_i 987
rowcopy 204988
rowpermute 14709501
rowslice 79347784
rowslicepermute 184696
rowsplice 273
ser_isexactzero 10120284
shallowcopy 27639962
sqrfrac 4148324
sqrti 6665941
sqrtnr 2808606
sqrtr 80364649
sstoQ 1097215
sturm 385
submulii 32847732
submuliu 7742
submuliu_inplace 60198906
truecoef 0
trunc_safe 0
ulogint 1722842
upr_norm 346136
uutoQ 1600198
vec_append 3465556
vec_ei 1714606
vec_lengthen 18946
vec_prepend 313994
vec_setconst 0
vec_shorten 11556
vec_to_vecsmall 4036828
veclast 9372662
vecmodii 0
vecmoduu 49784
vecpermute 20531316
vecreverse 697235
vecreverse_inplace 2605
vecslice 656294004
vecslicepermute 2689817
vecsmall_append 4111371
vecsmall_coincidence 0
vecsmall_concat 1464336
vecsmall_copy 4404147
vecsmall_ei 584747
vecsmall_indexmax 21
vecsmall_indexmin 21
vecsmall_isin 84
vecsmall_lengthen 547
vecsmall_lexcmp 7043259
vecsmall_max 1164689
vecsmall_min 2345
vecsmall_pack 84
vecsmall_prefixcmp 108088071
vecsmall_prepend 186991
vecsmall_reverse 3052
vecsmall_shorten 74580
vecsmall_to_col 7837779
vecsmall_to_vec 511809
vecsmall_to_vec_inplace 3304
vecsmallpermute 78735476
vecsmalltrunc_append 101568219
vecsmalltrunc_init 191088883
vecsplice 384918
vectrunc_append 16161058
vectrunc_append_batch 12306
vectrunc_init 12066878
zc_to_ZC 7823598
zero_F2m 0
zero_F2m_copy 845111
zero_F2v 3648082
zero_F2x 1350
zero_Flm 2830146
zero_Flm_copy 235918
zero_Flv 59493482
zero_Flx 1426633
zero_zm 0
zero_zv 36735795
zero_zx 0
zerocol 122288239
zeromat 109069
zeromatcopy 14240049
zeropadic 855735
zeropadic_shallow 17024
zeropol 42358739
zeroser 138908
zerovec 28455605
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 2183964
zv_to_ZV 503010
zv_to_zx 104146
zx_renormalize 14049
zx_shift 0
zx_to_zv 0

Generated by: LCOV version 1.16