Skip to content

C2 Exactness and leading error ​

IDGroupTypeBackendsFigureProgram
C2ContractsCCPU (gfortran R4P, R8P, R16P; nvfortran); the CI matrixnogideon_test_tables

Case and scope ​

C1 checks the rows as fractions; this case checks the compiled kernels, in the working kind, against the same meaning. A kernel of exact degree K must return the exact target on every monomial x0…xK, and on xK+1 it must miss by exactly the leading error the generator derived, not by more and not by less. The second half catches what exactness alone would not: a row that is exact but wrong beyond its degree (a different stencil of the same order), or a compiled coefficient off by more than its rounding.

Models and numerics ​

ItemChoiceCode
Datathe monomial xj on the kernel's window (h=1, x0=0): point values, or exact cell averages (bj+1−aj+1)/(j+1)gideon_test_functions.F90 data_monomial
Targetthe n-th derivative at 0, or its average over cell 0target_monomial
Kernelsall of them, through the registry's apply (one select case over the 332 kernels)gideon_test_registry.F90 (generated)
Asserted, j≤K|k(xj)−T(xj)|≤64ε∑k|ck|max(|q|,1)gideon_test_tables.F90
Asserted, j=K+1|(k−T)−E|≤ the same tolerance, E the exact leading error (kerror, derived by leading_error in the generator)

The tolerance, 64 ε of the scale, was frozen before the kernels were written: the round-off of a dot product of a few terms, with margin. In R4P it also covers the two coefficients whose literal rounds before the division (Precision).

Program ​

bash
./exe/gideon_test_tables                 # R8P
./exe-r4/gideon_test_tables              # R4P
./exe-r16/gideon_test_tables             # R16P

Results ​

BuildKernelsChecks (x^0 … x^(K+1))Failures
gfortran, R4P33226260
gfortran, R8P33226260
gfortran, R16P33226260
nvfortran -acc, R8P33226260

The checks are K+2 per kernel (x0…xK+1); the count is recomputed from the generator's rows when this table is written, and must match the program's.

The exact leading error of every kernel
KernelOrderExact degree KFirst monomial missedExact error on it (h=1)
fd_face_c221x21/4
fd_face_c443x4−9/16
fd_face_c665x6225/64
fd_face_c887x8−11025/256
fd_face_c10109x10893025/1024
fd_d1_c222x31
fd_d1_c444x5−4
fd_d1_c666x736
fd_d1_c888x9−576
fd_d1_c101010x1114400
fd_d2_c223x42
fd_d2_c445x6−8
fd_d2_c667x872
fd_d2_c889x10−1152
fd_d2_c101011x1228800
fd_d3_c224x530
fd_d3_c446x7−294
fd_d3_c668x94920
fd_d3_c8810x11−126456
fd_d4_c225x6120
fd_d4_c447x8−1176
fd_d4_c669x1019680
fd_d4_c8811x12−505824
fd_d5_c226x71680
fd_d5_c448x9−32760
fd_d5_c6610x11917400
fd_d6_c227x810080
fd_d6_c449x10−196560
fd_d6_c6611x125504400
fv_face_c221x21/3
fv_face_c443x4−4/5
fv_face_c665x636/7
fv_face_c887x8−64
fv_face_c10109x1014400/11
fv_face_d1_c222x31/2
fv_face_d1_c444x5−4/3
fv_face_d1_c666x79
fv_face_d1_c888x9−576/5
fv_face_d1_c101010x112400
fv_face_d2_c223x46
fv_face_d2_c445x6−42
fv_face_d2_c667x81640/3
fv_face_d2_c889x10−11496
fv_face_d3_c224x520
fv_face_d3_c446x7−147
fv_face_d3_c668x91968
fv_face_d3_c8810x11−42152
fv_face_d4_c225x6240
fv_face_d4_c447x8−3640
fv_face_d4_c669x1083400
fv_face_d5_c226x71260
fv_face_d5_c448x9−19656
fv_face_d5_c6610x11458700
fv_d1_c222x31
fv_d1_c444x5−4
fv_d1_c666x736
fv_d1_c888x9−576
fv_d1_c101010x1114400
fv_d2_c223x42
fv_d2_c445x6−8
fv_d2_c667x872
fv_d2_c889x10−1152
fv_d2_c101011x1228800
fv_d3_c224x530
fv_d3_c446x7−294
fv_d3_c668x94920
fv_d3_c8810x11−126456
fv_d4_c225x6120
fv_d4_c447x8−1176
fv_d4_c669x1019680
fv_d4_c8811x12−505824
fv_d5_c226x71680
fv_d5_c448x9−32760
fv_d5_c6610x11917400
fv_d6_c227x810080
fv_d6_c449x10−196560
fv_d6_c6611x125504400
fv_face_ur110x11/2
fv_face_ul110x1−1/2
fv_face_ur221x2−2/3
fv_face_ul221x2−2/3
fv_face_ur332x33/2
fv_face_ul332x3−3/2
fv_face_ur443x4−24/5
fv_face_ul443x4−24/5
fv_face_ur554x520
fv_face_ul554x5−20
fv_face_ur665x6−720/7
fv_face_ul665x6−720/7
fv_face_ur776x7630
fv_face_ul776x7−630
fv_face_ur887x8−4480
fv_face_ul887x8−4480
fv_face_ur998x936288
fv_face_ul998x9−36288
fv_face_d1_ur111x22
fv_face_d1_ul111x2−2
fv_face_d1_ur222x3−11/2
fv_face_d1_ul222x3−11/2
fv_face_d1_ur333x420
fv_face_d1_ul333x4−20
fv_face_d1_ur444x5−274/3
fv_face_d1_ul444x5−274/3
fv_face_d1_ur555x6504
fv_face_d1_ul555x6−504
fv_face_d1_ur666x7−3267
fv_face_d1_ul666x7−3267
fv_face_d1_ur777x824352
fv_face_d1_ul777x8−24352
fv_face_d1_ur888x9−1026576/5
fv_face_d1_ul888x9−1026576/5
fv_face_d2_ur112x39
fv_face_d2_ul112x3−9
fv_face_d2_ur223x4−42
fv_face_d2_ul223x4−42
fv_face_d2_ur334x5225
fv_face_d2_ul334x5−225
fv_face_d2_ur445x6−1392
fv_face_d2_ul445x6−1392
fv_face_d2_ur556x79849
fv_face_d2_ul556x7−9849
fv_face_d2_ur667x8−236248/3
fv_face_d2_ul667x8−236248/3
fv_face_d2_ur778x9703620
fv_face_d2_ul778x9−703620
fv_face_d3_ur113x448
fv_face_d3_ul113x4−48
fv_face_d3_ur224x5−340
fv_face_d3_ul224x5−340
fv_face_d3_ur335x62520
fv_face_d3_ul335x6−2520
fv_face_d3_ur446x7−20307
fv_face_d3_ul446x7−20307
fv_face_d3_ur557x8179424
fv_face_d3_ul557x8−179424
fv_face_d3_ur668x9−1736832
fv_face_d3_ul668x9−1736832
fv_face_d4_ur114x5300
fv_face_d4_ul114x5−300
fv_face_d4_ur225x6−3000
fv_face_d4_ul225x6−3000
fv_face_d4_ur336x729400
fv_face_d4_ul336x7−29400
fv_face_d4_ur447x8−299320
fv_face_d4_ul447x8−299320
fv_face_d4_ur558x93231900
fv_face_d4_ul558x9−3231900
fv_face_d5_ur115x62160
fv_face_d5_ul115x6−2160
fv_face_d5_ur226x7−28980
fv_face_d5_ul226x7−28980
fv_face_d5_ur337x8362880
fv_face_d5_ul337x8−362880
fv_face_d5_ur448x9−4555656
fv_face_d5_ul448x9−4555656
fv_d1_ur111x21
fv_d1_ul111x2−1
fv_d1_ur222x3−2
fv_d1_ul222x3−2
fv_d1_ur333x46
fv_d1_ul333x4−6
fv_d1_ur444x5−24
fv_d1_ul444x5−24
fv_d1_ur555x6120
fv_d1_ul555x6−120
fv_d1_ur666x7−720
fv_d1_ul666x7−720
fv_d1_ur777x85040
fv_d1_ul777x8−5040
fv_d1_ur888x9−40320
fv_d1_ul888x9−40320
fv_d1_ur999x10362880
fv_d1_ul999x10−362880
fv_d2_ur112x36
fv_d2_ul112x3−6
fv_d2_ur223x4−22
fv_d2_ul223x4−22
fv_d2_ur334x5100
fv_d2_ul334x5−100
fv_d2_ur445x6−548
fv_d2_ul445x6−548
fv_d2_ur556x73528
fv_d2_ul556x7−3528
fv_d2_ur667x8−26136
fv_d2_ul667x8−26136
fv_d2_ur778x9219168
fv_d2_ul778x9−219168
fv_d2_ur889x10−2053152
fv_d2_ul889x10−2053152
fv_d3_ur113x436
fv_d3_ul113x4−36
fv_d3_ur224x5−210
fv_d3_ul224x5−210
fv_d3_ur335x61350
fv_d3_ul335x6−1350
fv_d3_ur446x7−9744
fv_d3_ul446x7−9744
fv_d3_ur557x878792
fv_d3_ul557x8−78792
fv_d3_ur668x9−708744
fv_d3_ul668x9−708744
fv_d3_ur779x107036200
fv_d3_ul779x10−7036200
fv_d4_ur114x5240
fv_d4_ul114x5−240
fv_d4_ur225x6−2040
fv_d4_ul225x6−2040
fv_d4_ur336x717640
fv_d4_ul336x7−17640
fv_d4_ur447x8−162456
fv_d4_ul447x8−162456
fv_d4_ur558x91614816
fv_d4_ul558x9−1614816
fv_d4_ur669x10−17368320
fv_d4_ul669x10−17368320
fv_d5_ur115x61800
fv_d5_ul115x6−1800
fv_d5_ur226x7−21000
fv_d5_ul226x7−21000
fv_d5_ur337x8235200
fv_d5_ul337x8−235200
fv_d5_ur448x9−2693880
fv_d5_ul448x9−2693880
fv_d5_ur559x1032319000
fv_d5_ul559x10−32319000
fv_d6_ur116x715120
fv_d6_ul116x7−15120
fv_d6_ur227x8−231840
fv_d6_ul227x8−231840
fv_d6_ur338x93265920
fv_d6_ul338x9−3265920
fv_d6_ur449x10−45556560
fv_d6_ul449x10−45556560
fv_point_c443x4−9/80
fd_average_c443x417/240
fv_point_c665x6225/448
fd_average_c665x6−367/1344
fv_point_c887x8−1225/256
fd_average_c887x827859/11520
fv_point_c10109x10893025/11264
fd_average_c10109x10−1295803/33792
fv_point_c121211x12−108056025/53248
fd_average_c121211x125329242827/5591040
fd_face_d1_c222x31/4
fd_face_d1_c444x5−9/16
fd_face_d1_c666x7225/64
fd_face_d1_c888x9−11025/256
fd_face_d1_c101010x11893025/1024
fd_face_d2_c223x45
fd_face_d2_c445x6−259/8
fd_face_d2_c667x83229/8
fd_face_d2_c889x10−1057221/128
fd_face_d3_c224x515
fd_face_d3_c446x7−777/8
fd_face_d3_c668x99687/8
fd_face_d3_c8810x11−3171663/128
fd_face_d4_c225x6210
fd_face_d4_c447x8−2961
fd_face_d4_c669x10259215/4
fd_face_d5_c226x71050
fd_face_d5_c448x9−14805
fd_face_d5_c6610x111296075/4
fd_face_ur110x11/2
fd_face_ul110x1−1/2
fd_face_ur221x2−3/4
fd_face_ul221x2−3/4
fd_face_ur332x315/8
fd_face_ul332x3−15/8
fd_face_ur443x4−105/16
fd_face_ul443x4−105/16
fd_face_ur554x5945/32
fd_face_ul554x5−945/32
fd_face_ur665x6−10395/64
fd_face_ul665x6−10395/64
fd_face_ur776x7135135/128
fd_face_ul776x7−135135/128
fd_face_ur887x8−2027025/256
fd_face_ul887x8−2027025/256
fd_face_ur998x934459425/512
fd_face_ul998x9−34459425/512
fd_face_br332x3−3/8
fd_face_bl332x33/8
fd_face_br554x545/32
fd_face_bl554x5−45/32
fd_face_br776x7−1575/128
fd_face_bl776x71575/128
fd_face_br998x999225/512
fd_face_bl998x9−99225/512
fd_face_diss_c222x31/4
fv_face_diss_c222x31/2
fd_face_diss_c424x515
fv_face_diss_c424x520
fd_face_diss_c626x71050
fv_face_diss_c626x71260
fd_face_diss_c828x9105840
fv_face_diss_c828x9120960
fd_face_diss_c10210x1114968800
fv_face_diss_c10210x1116632000
fv_face_br332x3−1/2
fv_face_bl332x31/2
fv_face_br554x52
fv_face_bl554x5−2
fv_face_br776x7−18
fv_face_bl776x718
fv_face_br998x9288
fv_face_bl998x9−288
fd_face_diss_br324x515
fd_face_diss_bl324x515
fd_face_diss_br526x71050
fd_face_diss_bl526x71050
fd_face_diss_br728x9105840
fd_face_diss_bl728x9105840
fd_face_diss_br9210x1114968800
fd_face_diss_bl9210x1114968800
fv_face_diss_br324x520
fv_face_diss_bl324x520
fv_face_diss_br526x71260
fv_face_diss_bl526x71260
fv_face_diss_br728x9120960
fv_face_diss_bl728x9120960
fv_face_diss_br9210x1116632000
fv_face_diss_bl9210x1116632000
fd_filter_c221x21/2
fv_filter_c221x21/2
fd_filter_c443x4−3/2
fv_filter_c443x4−3/2
fd_filter_c665x645/4
fv_filter_c665x645/4
fd_filter_c887x8−315/2
fv_filter_c887x8−315/2
fd_filter_c10109x1014175/4
fv_filter_c10109x1014175/4

Findings ​

  • Every kernel is exact to its degree and misses the next monomial by the derived amount, in every kind: the compiled rows are the derived ones, neither less nor more exact.
  • The leading error is the constant of the order: at step h the error of a kernel on a smooth u is Ehpu(K+1)/(K+1)! to leading order. Two kernels of the same derivative and order compare by |E|, and the one-sided rows pay for their window (Choose an operator):

In 40 of the 40 groups (data, operator, order) that have both a centred and an upwind kernel, the upwind |E| is the larger.

Released under your choice of GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT.