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 - basemath - FpX.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30849-48ff4d246c) Lines: 1978 2156 91.7 %
Date: 2026-05-01 09:26:53 Functions: 213 228 93.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fp2_norm 18961
Fp2_sqrt 19392
FpVV_polint_tree 15
FpV_FpM_polint 0
FpV_inv 34307
FpV_invVandermonde 31866
FpV_polint 22
FpV_producttree 31881
FpV_roots_to_pol 93537
FpXC_FpXQV_eval 1470
FpXC_FpXQ_eval 588
FpXM_FpXQV_eval 315
FpXM_FpX_mul2 36106
FpXM_mul2 17253
FpXQM_autsum 147
FpXQM_autsum_mul 315
FpXQM_autsum_sqr 217
FpXQ_autpow 4476
FpXQ_autpow_msqr 42
FpXQ_autpow_sqr 4570
FpXQ_autpowers 1736
FpXQ_autsum 2807
FpXQ_autsum_mul 3093
FpXQ_autsum_sqr 2933
FpXQ_auttrace 434
FpXQ_auttrace_mul 360
FpXQ_auttrace_sqr 317
FpXQ_charpoly 15
FpXQ_conjvec 8
FpXQ_div 530976
FpXQ_inv 1097242
FpXQ_invsafe 1097241
FpXQ_issquare 401772
FpXQ_log 707980
FpXQ_matrix_pow 66291
FpXQ_minpoly 14027
FpXQ_mul 13202924
FpXQ_norm 363850
FpXQ_order 1814
FpXQ_pow 1565984
FpXQ_pow_Frobenius 842097
FpXQ_powers 390271
FpXQ_powu 608403
FpXQ_red 17785837
FpXQ_sqr 6334076
FpXQ_sqrt 78673
FpXQ_sqrtl_spec 543
FpXQ_sqrtn 1222
FpXQ_sqrtn_spec 858
FpXQ_sumautsum 1266
FpXQ_sumautsum_msqr 1123
FpXQ_sumautsum_sqr 2264
FpXQ_trace 21066
FpXQ_transmul 7175
FpXQ_transmul_init 1660
FpXT_red 1664060
FpXT_sqr 7602
FpXV_FpX_fromdigits 4564
FpXV_chinese 588
FpXV_chinese_tree 588
FpXV_chinesetree 588
FpXV_factorback 23258
FpXV_invdivexact 588
FpXV_prod 312021
FpXV_producttree 588
FpXV_producttree_dbl 32469
FpXV_red 404373
FpXV_sqr 588
FpXXkX_FpXXk_divexact 1008
FpXXkX_FpXXk_divexact_s 1176
FpXXkX_FpXXk_divides_s 10080
FpXXk_FpX_div 602
FpXXk_FpX_div_i 245
FpXXk_content 3150
FpXXk_content_FpX 5061
FpXXk_divexact_i 175
FpXXk_divexact_s 5607
FpXXk_divides 2926
FpXXk_divides_i 4725
FpXXk_divides_s 136864
FpXXk_gcd_i 12817
FpXXk_primpart_FpX 1617
FpXXk_rec 1617
FpX_FpV_multieval 0
FpX_FpV_multieval_tree 31881
FpX_FpXM_qmul 17162
FpX_FpXQV_eval 418251
FpX_FpXQ_eval 796501
FpX_FpXV_multirem 0
FpX_FpXV_multirem_dbl_tree 32469
FpX_FpXV_multirem_tree 588
FpX_Fp_add 895435
FpX_Fp_add_shallow 0
FpX_Fp_div 611490
FpX_Fp_mul 6288684
FpX_Fp_mul_to_monic 140566
FpX_Fp_mulspec 6303231
FpX_Fp_sub 588322
FpX_Fp_sub_shallow 11146
FpX_Frobenius 462655
FpX_Laplace 597
FpX_Newton 523679
FpX_add 18311463
FpX_addmulmul 87863
FpX_center 314339
FpX_center_i 2247460
FpX_chinese_coprime 0
FpX_convol 1008
FpX_deriv 1634905
FpX_digits 11403
FpX_disc 42
FpX_div_by_X_x 166693
FpX_divrem 14480170
FpX_divrem_Barrett 815417
FpX_divrem_Barrettspec 816162
FpX_divrem_basecase 67386814
FpX_divu 8610
FpX_dotproduct 61210
FpX_eval 967988
FpX_extgcd 1443521
FpX_extgcd_basecase 583992
FpX_extgcd_halfgcd 13757
FpX_extresultant 77
FpX_extresultant_basecase 24
FpX_fromNewton 11355
FpX_gcd 1037701
FpX_gcd_basecase 53064
FpX_gcd_check 814
FpX_get_red 1625250
FpX_halfgcd 977
FpX_halfgcd_all 16690
FpX_halfgcd_all_i 16550
FpX_halfres 106
FpX_halfres_basecase 33802
FpX_halfres_i 52762
FpX_halfres_split 18960
FpX_halfres_update 3749
FpX_halve 92694
FpX_integ 0
FpX_integXn 55575
FpX_invBarrett 5484
FpX_invBarrett_Newton 1492
FpX_invBarrett_basecase 3939
FpX_invLaplace 186
FpX_is_squarefree 716104
FpX_matFrobenius 31492
FpX_mul 28483738
FpX_mulhigh_i 115055
FpX_mulspec 9202951
FpX_mulu 479232
FpX_neg 688979
FpX_normalize 1856976
FpX_powu 318342
FpX_recipspec 1638190
FpX_red 97797998
FpX_rem 73270079
FpX_rescale 178996
FpX_resultant 417097
FpX_resultant_basecase 4028
FpX_shift 985418
FpX_sqr 6526818
FpX_sub 14577815
FpX_subspec 15393974
FpX_valrem 254737
FpXk_gcd 490
FpXk_mul 1309
FpXk_red 4514377
FpXk_renormalize 60424
FpXk_sub 3718568
FpXn_div 6412
FpXn_exp 0
FpXn_expint 17263
FpXn_inv 6412
FpXn_mul 2564811
FpXn_mulhigh 59480
FpXn_recip 534537
FpXn_red 204530
FpXn_sqr 0
Fp_FpXQ_log 544095
Fp_FpX_sub 25671
Fp_issquare 1336383
Fp_neg_FpX 1025
Fp_red_FpX 24327
FqV_inv 0
Fq_ispower 70
Fq_issquare 1631319
Fq_log 2478424
RgXV_to_RgM_lg 417549
RgXXk_modXn 6027
RgXXk_shift 6027
RgX_blocks_RgM 417556
RgXk_var_lowest 10864
Rg_is_FpXk 0
Rg_to_FpXk 65632
ZX_lgrenormalizespec 1662751
Z_to_FpX 1831
_FpXQ_add 0
_FpXQ_easylog 469
_FpXQ_mul 2712766
_FpXQ_one 219152
_FpXQ_pow 826923
_FpXQ_rand 679
_FpXQ_red 59395
_FpXQ_sqr 5838431
_FpXQ_sub 52941
_FpXQ_zero 3360
_FpX_add 20062
_FpX_divrem 134778
_FpX_mul 373808
_FpX_one 0
_FpX_pow 35493
_FpX_red 0
_FpX_sqr 86660
_FpX_zero 0
bounded_order 4379
gc_chinese 588
gener_FpXQ 7030
gener_FpXQ_i 84146
gener_FpXQ_local 84111
get_FpXQ_algebra 10199
get_FpXQ_star 2807
get_FpX_algebra 0
get_FpX_red 87766991
matJ2_FpXM 8
matid2_FpXM 24
random_FpX 257765
to_Flx 44781036
to_Flxq 2137521

Generated by: LCOV version 1.16