@triton.jit
def tenth_order_bwd(coord_ptr: tl.tensor, coord_grad_ptr: tl.tensor,
    sph_grad_ptr: tl.tensor, block_size: tl.constexpr, coord_numel: tl.
    constexpr, output_numel: tl.constexpr, col_offset: tl.constexpr,
    output_stride: tl.constexpr):
    block_id = tl.program_id(0)
    coord_stride = 3
    coord_striding = tl.arange(0, block_size) * coord_stride
    coord_row_offset = coord_striding + block_size * coord_stride * block_id
    x = tl.load(coord_ptr + coord_row_offset, mask=coord_row_offset <
        coord_numel)
    y = tl.load(coord_ptr + coord_row_offset + 1, mask=coord_row_offset + 1 <
        coord_numel)
    z = tl.load(coord_ptr + coord_row_offset + 2, mask=coord_row_offset + 2 <
        coord_numel)
    output_striding = tl.arange(0, block_size) * output_stride
    output_row_offset = (output_striding + block_size * output_stride *
        block_id + col_offset)
    g_0 = tl.load(sph_grad_ptr + output_row_offset, mask=output_row_offset <
        output_numel)
    g_1 = tl.load(sph_grad_ptr + output_row_offset + 1, mask=
        output_row_offset + 1 < output_numel)
    g_2 = tl.load(sph_grad_ptr + output_row_offset + 2, mask=
        output_row_offset + 2 < output_numel)
    g_3 = tl.load(sph_grad_ptr + output_row_offset + 3, mask=
        output_row_offset + 3 < output_numel)
    g_4 = tl.load(sph_grad_ptr + output_row_offset + 4, mask=
        output_row_offset + 4 < output_numel)
    g_5 = tl.load(sph_grad_ptr + output_row_offset + 5, mask=
        output_row_offset + 5 < output_numel)
    g_6 = tl.load(sph_grad_ptr + output_row_offset + 6, mask=
        output_row_offset + 6 < output_numel)
    g_7 = tl.load(sph_grad_ptr + output_row_offset + 7, mask=
        output_row_offset + 7 < output_numel)
    g_8 = tl.load(sph_grad_ptr + output_row_offset + 8, mask=
        output_row_offset + 8 < output_numel)
    g_9 = tl.load(sph_grad_ptr + output_row_offset + 9, mask=
        output_row_offset + 9 < output_numel)
    g_10 = tl.load(sph_grad_ptr + output_row_offset + 10, mask=
        output_row_offset + 10 < output_numel)
    g_11 = tl.load(sph_grad_ptr + output_row_offset + 11, mask=
        output_row_offset + 11 < output_numel)
    g_12 = tl.load(sph_grad_ptr + output_row_offset + 12, mask=
        output_row_offset + 12 < output_numel)
    g_13 = tl.load(sph_grad_ptr + output_row_offset + 13, mask=
        output_row_offset + 13 < output_numel)
    g_14 = tl.load(sph_grad_ptr + output_row_offset + 14, mask=
        output_row_offset + 14 < output_numel)
    g_15 = tl.load(sph_grad_ptr + output_row_offset + 15, mask=
        output_row_offset + 15 < output_numel)
    g_16 = tl.load(sph_grad_ptr + output_row_offset + 16, mask=
        output_row_offset + 16 < output_numel)
    g_17 = tl.load(sph_grad_ptr + output_row_offset + 17, mask=
        output_row_offset + 17 < output_numel)
    g_18 = tl.load(sph_grad_ptr + output_row_offset + 18, mask=
        output_row_offset + 18 < output_numel)
    g_19 = tl.load(sph_grad_ptr + output_row_offset + 19, mask=
        output_row_offset + 19 < output_numel)
    g_20 = tl.load(sph_grad_ptr + output_row_offset + 20, mask=
        output_row_offset + 20 < output_numel)
    CONST000 = 2.0
    CONST002 = 4.0
    CONST003 = 4.82870805793735
    CONST004 = 6.0
    CONST005 = 4.9743298563255
    CONST006 = 8.0
    CONST007 = 4.9743298563255
    CONST008 = 10.5521471197994
    CONST009 = 3.0
    CONST010 = 5.0
    CONST011 = 7.0
    CONST012 = 13.264879616868
    CONST014 = 12.1657520803952
    CONST015 = 16.7271353825295
    CONST016 = -2030.35546709287
    CONST017 = 19.3148322317494
    CONST018 = -6131.53904851919
    CONST019 = 22.862985426232
    CONST020 = 23.213539329519
    CONST021 = 24.6216766128653
    CONST022 = 17.5869118663323
    CONST024 = 28.9722483476241
    CONST025 = 33.9852909359329
    CONST026 = 33.9852909359329
    CONST027 = 35.5238206489124
    CONST028 = 6180.7463141598
    CONST029 = 38.6296644634988
    CONST030 = 39.794638850604
    CONST031 = 38.6296644634988
    CONST032 = -2007.25624590353
    CONST033 = -2007.25624590353
    CONST034 = 45.8257569495584
    CONST035 = 45.725970852464
    CONST037 = 56.3871618715269
    CONST038 = 56.2781179722634
    CONST039 = -1989.33395633909
    CONST040 = -1989.33395633909
    CONST041 = 59.691958275906
    CONST042 = 66.9085415301178
    CONST043 = 69.640617988557
    CONST044 = -8121.42186837148
    CONST045 = 77.2593289269976
    CONST046 = 78.6510608948335
    CONST047 = -1969.73412902922
    CONST048 = 77.3468749368712
    CONST049 = -1969.73412902922
    CONST050 = -9.65741611587469
    CONST051 = 90.1358837481638
    CONST053 = 94.9693240781945
    CONST055 = 96.5741611587469
    CONST057 = 98.486706451461
    CONST058 = 100.362812295177
    CONST059 = 101.517773354644
    CONST060 = 106.571461946737
    CONST061 = 106.571461946737
    CONST062 = 109.491768723557
    CONST063 = 109.491768723557
    CONST064 = 112.774323743054
    CONST065 = 112.774323743054
    CONST067 = 2165.26701586663
    CONST070 = 133.817083060236
    CONST071 = 139.281235977114
    CONST072 = 139.281235977114
    CONST073 = 141.5719096107
    CONST074 = 142.09528259565
    CONST075 = 147.730059677192
    CONST076 = 150.544218442765
    CONST077 = 150.074981259369
    CONST079 = 2202.22970505534
    CONST080 = -3939.46825805844
    CONST081 = -5968.00186901728
    CONST082 = 176.592751833137
    CONST083 = 176.178376404427
    CONST085 = 185.708314636152
    CONST087 = 196.973412902922
    CONST089 = 225.548647486108
    CONST090 = 225.548647486108
    CONST091 = 4330.53403173327
    CONST093 = 244.831037842559
    CONST094 = -1804.38917988886
    CONST095 = -1804.38917988886
    CONST097 = 2317.77986780993
    CONST098 = 278.562471954228
    CONST100 = 284.190565191299
    CONST101 = -1761.78376404427
    CONST103 = -9946.66978169547
    CONST104 = 9.948659712651
    CONST108 = -7878.93651611688
    CONST111 = 338.322971229162
    CONST112 = 360.877835977772
    CONST114 = -1671.37483172537
    CONST116 = 2436.42656051144
    CONST119 = 393.946825805844
    CONST120 = -1648.19901710928
    CONST121 = 401.451249180707
    CONST122 = 406.071093418574
    CONST123 = 412.04975427732
    CONST125 = -1624.2843736743
    CONST126 = 426.285847786949
    CONST127 = 426.285847786948
    CONST128 = 2486.66744542387
    CONST130 = 451.097294972216
    CONST131 = 451.097294972216
    CONST132 = 451.097294972215
    CONST133 = 6606.68911516602
    CONST134 = 6606.68911516602
    CONST135 = -1575.78730322338
    CONST136 = -1575.78730322338
    CONST137 = -3608.77835977772
    CONST139 = -1545.18657853995
    CONST140 = -1545.18657853995
    CONST142 = 535.268332240943
    CONST143 = 4635.55973561985
    CONST144 = 541.428124558099
    CONST145 = -3545.5214322526
    CONST146 = 557.124943908456
    CONST147 = -3523.56752808854
    CONST148 = -5571.24943908456
    CONST151 = 15.7883647328499
    CONST153 = 2642.67564606641
    CONST154 = 2642.67564606641
    CONST155 = 2676.34166120471
    CONST156 = 629.208487158668
    CONST158 = 4727.36190967013
    CONST159 = -1392.81235977114
    CONST160 = -1390.66792068596
    CONST162 = 663.111318779698
    CONST163 = -3427.63452979582
    CONST164 = -1378.81389032045
    CONST165 = 676.645942458323
    CONST167 = -1338.17083060236
    CONST168 = -1338.17083060236
    CONST169 = 721.755671955545
    CONST171 = 2785.62471954228
    CONST173 = 772.593289269975
    CONST175 = 787.893651611688
    CONST176 = 787.893651611688
    CONST177 = 6.632439808434
    CONST178 = 812.142186837148
    CONST180 = -1218.21328025572
    CONST181 = -1202.92611992591
    CONST182 = -1202.92611992591
    CONST183 = -3248.56874734859
    CONST184 = -3248.56874734859
    CONST185 = -5285.35129213281
    CONST186 = -1181.84047741753
    CONST190 = 2936.30627340712
    CONST192 = 2954.60119354383
    CONST193 = -1114.24988781691
    CONST194 = -16.581099521085
    CONST195 = -1101.11485252767
    CONST196 = -1081.63060497797
    CONST197 = 15.7302121789667
    CONST199 = 984.86706451461
    CONST202 = -1027.70719569249
    CONST203 = -1021.9231747532
    CONST204 = -3065.7695242596
    CONST205 = -1015.17773354644
    CONST206 = 3090.3731570799
    CONST207 = -994.666978169547
    CONST208 = -984.86706451461
    CONST209 = -984.86706451461
    CONST210 = -979.324151370235
    CONST211 = 1070.53666448189
    CONST212 = -979.324151370235
    CONST213 = 3151.57460644675
    CONST216 = -927.111947123971
    CONST217 = -927.11194712397
    CONST218 = -5.63871618715269
    CONST219 = -2954.60119354383
    CONST220 = -902.194589944431
    CONST221 = -900.449887556215
    CONST222 = -880.891882022136
    CONST223 = -880.891882022136
    CONST224 = -875.934149788456
    CONST226 = -4944.59705132784
    CONST228 = 3248.56874734859
    CONST229 = -835.687415862684
    CONST230 = 1218.21328025572
    CONST231 = -824.099508554641
    CONST232 = -824.863625092051
    CONST233 = -824.863625092051
    CONST234 = -812.142186837148
    CONST235 = 5352.68332240943
    CONST236 = -787.893651611688
    CONST237 = -787.893651611688
    CONST238 = -772.593289269976
    CONST239 = -742.833258544608
    CONST240 = -2785.62471954228
    CONST241 = -734.07656835178
    CONST242 = 1321.3378230332
    CONST243 = 1321.3378230332
    CONST244 = -706.371007332549
    CONST245 = -696.40617988557
    CONST246 = 1353.29188491665
    CONST247 = -675.337415667161
    CONST248 = -675.337415667161
    CONST250 = 3427.63452979582
    CONST251 = -669.085415301178
    CONST252 = -669.085415301178
    CONST253 = -669.085415301178
    CONST255 = -663.111318779698
    CONST256 = -2707.14062279049
    CONST258 = 1392.81235977114
    CONST259 = 1412.7420146651
    CONST260 = -4727.36190967013
    CONST261 = -2676.34166120471
    CONST262 = -618.07463141598
    CONST263 = -611.735236846792
    CONST264 = -611.735236846792
    CONST265 = 1443.51134391109
    CONST266 = -590.920238708766
    CONST267 = -10828.562491162
    CONST268 = -580.101562026534
    CONST269 = -2626.31217203896
    CONST272 = 5571.24943908456
    CONST273 = -12.8765548211663
    CONST274 = -557.124943908456
    CONST275 = -557.124943908456
    CONST277 = -541.428124558099
    CONST278 = -6685.49932690147
    CONST279 = 7664.42381064899
    CONST280 = -525.262434407792
    CONST281 = 1532.8847621298
    CONST283 = -497.333489084773
    CONST284 = -497.333489084773
    CONST285 = -492.433532257305
    CONST286 = 1575.78730322338
    CONST287 = 1575.78730322338
    CONST288 = -463.555973561985
    CONST289 = -450.224943778107
    CONST290 = -450.224943778107
    CONST291 = -450.224943778108
    CONST292 = -437.967074894228
    CONST293 = -2472.29852566392
    CONST294 = 1624.2843736743
    CONST295 = -2472.29852566392
    CONST296 = -406.071093418574
    CONST297 = -393.946825805844
    CONST298 = -393.946825805844
    CONST299 = -2436.42656051144
    CONST300 = -386.296644634988
    CONST301 = -386.296644634988
    CONST302 = -4456.99955126765
    CONST303 = -337.668707833581
    CONST304 = -337.668707833581
    CONST305 = -331.555659389849
    CONST306 = -331.555659389849
    CONST307 = -2363.68095483506
    CONST309 = -309.03731570799
    CONST310 = -4404.45941011068
    CONST311 = -309.03731570799
    CONST312 = -305.867618423396
    CONST313 = -305.867618423396
    CONST314 = -305.867618423396
    CONST315 = -300.731529981477
    CONST316 = 9946.66978169547
    CONST318 = -290.050781013267
    CONST319 = -284.190565191299
    CONST320 = -278.562471954228
    CONST321 = -278.562471954228
    CONST322 = -2317.77986780993
    CONST323 = -10505.2486881558
    CONST324 = -251.683394863467
    CONST325 = -251.683394863467
    CONST326 = -246.216766128653
    CONST327 = -244.831037842559
    CONST328 = -2285.08968653055
    CONST329 = -2285.08968653055
    CONST330 = 3862.96644634988
    CONST331 = -223.028471767059
    CONST332 = -220.222970505534
    CONST333 = -206.215906273013
    CONST334 = -203.035546709287
    CONST335 = -196.973412902922
    CONST336 = -196.973412902922
    CONST337 = -182.903883409856
    CONST338 = -2228.49977563382
    CONST340 = 16.4144510752435
    CONST341 = 3939.46825805844
    CONST342 = 3939.46825805844
    CONST343 = -154.518657853995
    CONST344 = -154.518657853995
    CONST345 = -150.074981259369
    CONST346 = -147.730059677191
    CONST347 = -146.815313670356
    CONST348 = -142.09528259565
    CONST349 = -131.315608601948
    CONST350 = -131.315608601948
    CONST351 = -130.52285145597
    CONST352 = -125.841697431734
    CONST353 = -125.841697431734
    CONST354 = -112.556235944527
    CONST355 = -103.107953136506
    CONST356 = -101.517773354644
    CONST357 = 1949.9373036796
    CONST358 = -98.486706451461
    CONST359 = -98.486706451461
    CONST360 = -2141.07332896377
    CONST361 = -2141.07332896377
    CONST362 = -92.854157318076
    CONST363 = -88.2963759165686
    CONST366 = -77.3468749368713
    CONST367 = 8121.42186837148
    CONST369 = -67.6645942458323
    CONST372 = -59.691958275906
    CONST373 = -49.2433532257305
    CONST374 = -49.2433532257305
    CONST375 = -45.1097294972216
    CONST376 = -45.1097294972216
    CONST377 = -42.2085884791976
    CONST378 = -27.2034486491732
    CONST379 = -24.6216766128653
    CONST380 = -22.862985426232
    CONST381 = -19.7354559160624
    CONST383 = -17.5869118663323
    CONST384 = -16.4144510752435
    CONST385 = -16.0956935264578
    CONST386 = -14.5025390506634
    CONST388 = -16.581099521085
    CONST389 = -15.7883647328499
    CONST390 = -14.0695294930659
    CONST391 = -11.2774323743054
    CONST392 = -11.2774323743054
    CONST393 = -13.264879616868
    CONST394 = -6.632439808434
    CONST395 = -5.63871618715269
    CONST396 = -4.82870805793735
    CONST397 = -3.21913870529156
    CONST398 = -11.2774323743054
    VAR05 = x * x * x * x * x
    VAR06 = x * x * x * x
    VAR07 = x * x * x
    VAR08 = x * x
    VAR01 = VAR05 * VAR06
    VAR02 = VAR06 * VAR06
    VAR03 = VAR06 * VAR07
    VAR04 = VAR07 * VAR07
    VAR14 = y * y * y * y * y
    VAR15 = y * y * y * y
    VAR16 = y * y * y
    VAR17 = y * y
    VAR10 = VAR14 * VAR15
    VAR11 = VAR15 * VAR15
    VAR12 = VAR15 * VAR16
    VAR13 = VAR16 * VAR16
    VAR23 = z * z * z * z * z
    VAR24 = z * z * z * z
    VAR25 = z * z * z
    VAR26 = z * z
    VAR19 = VAR23 * VAR24
    VAR20 = VAR24 * VAR24
    VAR21 = VAR24 * VAR25
    VAR22 = VAR25 * VAR25
    g_x = tl.load(coord_grad_ptr + coord_row_offset, mask=coord_row_offset <
        coord_numel)
    g_y = tl.load(coord_grad_ptr + coord_row_offset + 1, mask=
        coord_row_offset + 1 < coord_numel)
    g_z = tl.load(coord_grad_ptr + coord_row_offset + 2, mask=
        coord_row_offset + 2 < coord_numel)
    g_x += g_0 * (CONST093 * VAR02 * z + CONST210 * VAR08 * VAR21 + 
        CONST250 * VAR06 * VAR23 + CONST328 * VAR04 * VAR25 - CONST378 * VAR19
        ) + g_1 * y * (CONST062 * VAR20 + CONST063 * VAR02 + CONST204 *
        VAR04 * VAR26 + CONST204 * VAR08 * VAR22 + CONST279 * VAR06 * VAR24
        ) + g_10 * (CONST000 * x * (CONST089 * VAR17 * VAR22 + CONST169 *
        VAR13 * VAR26 + CONST220 * VAR15 * VAR24 + CONST355 * VAR11 + 
        CONST395 * VAR20) + CONST002 * VAR07 * (CONST111 * VAR17 * VAR24 + 
        CONST112 * VAR13 + CONST220 * VAR15 * VAR26 + CONST392 * VAR22) + 
        CONST004 * VAR05 * (CONST090 * VAR17 * VAR26 + CONST315 * VAR15 + 
        CONST392 * VAR24) + CONST006 * VAR03 * (CONST037 * VAR17 + CONST218 *
        VAR26) + CONST391 * VAR01) + g_11 * (CONST070 * VAR21 * x * y + 
        VAR23 * (CONST121 * VAR07 * y + CONST168 * VAR16 * x) + VAR25 * (
        CONST121 * VAR05 * y + CONST261 * VAR07 * VAR16 - CONST361 * VAR14 *
        x) + z * (CONST070 * VAR03 * y + CONST167 * VAR05 * VAR16 + 
        CONST263 * VAR12 * x - CONST361 * VAR07 * VAR14)) + g_12 * (
        CONST000 * x * (CONST003 * VAR20 - CONST301 * VAR15 * VAR24 + 
        CONST343 * VAR17 * VAR22 + CONST363 * VAR11) + CONST002 * VAR07 * (
        CONST123 * VAR13 + CONST300 * VAR15 * VAR26 - CONST397 * VAR22) + 
        CONST004 * VAR05 * (CONST301 * VAR15 - CONST344 * VAR17 * VAR26 + 
        CONST397 * VAR24) + CONST006 * VAR03 * (CONST045 * VAR17 + CONST396 *
        VAR26) + CONST385 * VAR01) + g_13 * (CONST221 * VAR12 * x * z + 
        VAR14 * (-CONST260 * VAR07 * z + CONST286 * VAR25 * x) + VAR16 * (
        CONST080 * VAR07 * VAR25 + CONST145 * VAR05 * z + CONST297 * VAR23 *
        x) + y * (-CONST237 * VAR05 * VAR25 - CONST297 * VAR07 * VAR23 - 
        CONST298 * VAR03 * z)) + g_14 * (CONST000 * x * (CONST005 * VAR20 -
        CONST159 * VAR15 * VAR24 + CONST193 * VAR13 * VAR26 + CONST320 *
        VAR17 * VAR22) + CONST002 * VAR07 * (CONST020 * VAR22 + CONST085 *
        VAR13 + CONST245 * VAR17 * VAR24 + CONST258 * VAR15 * VAR26) + 
        CONST004 * VAR05 * (CONST020 * VAR24 + CONST320 * VAR15 + CONST320 *
        VAR17 * VAR26) + CONST006 * VAR03 * (CONST007 * VAR26 + CONST043 *
        VAR17) + CONST388 * VAR01) + g_15 * (VAR14 * (-CONST147 * VAR07 * z +
        CONST147 * VAR25 * x) + VAR16 * (CONST153 * VAR23 * x + CONST190 *
        VAR07 * VAR25 + CONST310 * VAR05 * z) + y * (CONST156 * VAR03 * z +
        CONST222 * VAR07 * VAR23 + CONST324 * VAR21 * x)) + g_16 * (
        CONST000 * x * (CONST047 * VAR15 * VAR24 + CONST175 * VAR17 * VAR22 +
        CONST380 * VAR20) + CONST002 * VAR07 * (-CONST047 * VAR15 * VAR26 +
        CONST379 * VAR22) + CONST004 * VAR05 * (CONST021 * VAR24 + CONST236 *
        VAR17 * VAR26 + CONST349 * VAR15) + CONST006 * VAR03 * (CONST019 *
        VAR26 + CONST038 * VAR17) + CONST383 * VAR01) + g_17 * (VAR16 * (
        CONST183 * VAR23 * x + CONST184 * VAR05 * z - CONST267 * VAR07 *
        VAR25) + y * (CONST178 * VAR03 * z + CONST234 * VAR07 * VAR23 - 
        CONST268 * VAR21 * x + CONST299 * VAR05 * VAR25)) + g_18 * (
        CONST060 * VAR20 * x + CONST126 * VAR03 * VAR26 + CONST283 * VAR05 *
        VAR24 + CONST305 * VAR07 * VAR22 + CONST381 * VAR01 + VAR17 * (
        CONST039 * VAR22 * x + CONST081 * VAR05 * VAR26 + CONST316 * VAR07 *
        VAR24 - CONST319 * VAR03)) + g_19 * y * (CONST018 * VAR05 * VAR25 -
        CONST018 * VAR07 * VAR23 - CONST224 * VAR03 * z + CONST224 * VAR21 * x
        ) + g_2 * (CONST074 * VAR02 * z + CONST100 * VAR08 * VAR21 + 
        CONST255 * VAR04 * VAR25 + CONST389 * VAR19 + VAR17 * (CONST040 *
        VAR04 * z + CONST081 * VAR08 * VAR23 - CONST103 * VAR06 * VAR25 - 
        CONST319 * VAR21)) + g_20 * (CONST163 * VAR05 * VAR24 - CONST212 *
        VAR03 * VAR26 + CONST327 * VAR20 * x - CONST329 * VAR07 * VAR22 + 
        CONST378 * VAR01) + g_3 * (VAR16 * (CONST044 * VAR08 * VAR24 + 
        CONST144 * VAR22 + CONST277 * VAR04 + CONST367 * VAR06 * VAR26) + y *
        (CONST016 * VAR04 * VAR26 - CONST205 * VAR06 * VAR24 + CONST230 *
        VAR08 * VAR22 - CONST351 * VAR02 + CONST356 * VAR20)) + g_4 * (
        CONST008 * VAR19 + CONST009 * VAR08 * (CONST175 * VAR17 * VAR23 + 
        CONST269 * VAR15 * VAR25 + CONST390 * VAR21) + CONST010 * VAR06 * (
        CONST175 * VAR15 * z + CONST176 * VAR17 * VAR25 + CONST373 * VAR23) +
        CONST011 * VAR04 * (CONST303 * VAR17 * z + CONST390 * VAR25) + 
        CONST053 * VAR02 * z + CONST175 * VAR15 * VAR23 + CONST304 * VAR17 *
        VAR21) + g_5 * (VAR14 * (CONST185 * VAR08 * VAR26 - CONST222 *
        VAR06 - CONST223 * VAR24) + VAR16 * (CONST079 * VAR08 * VAR24 + 
        CONST133 * VAR06 * VAR26 + CONST202 * VAR04 + CONST241 * VAR22) + y *
        (CONST046 * VAR20 + CONST073 * VAR02 + CONST195 * VAR06 * VAR24 + 
        CONST222 * VAR04 * VAR26)) + g_6 * (CONST009 * VAR08 * (CONST098 *
        VAR17 * VAR23 + CONST239 * VAR13 * z + CONST393 * VAR21) + CONST010 *
        VAR06 * (-CONST193 * VAR15 * z + CONST320 * VAR17 * VAR25) + 
        CONST011 * VAR04 * (CONST012 * VAR25 + CONST321 * VAR17 * z) + 
        CONST041 * VAR02 * z + CONST098 * VAR17 * VAR21 + CONST193 * VAR15 *
        VAR23 - CONST239 * VAR13 * VAR25 + CONST394 * VAR19) + g_7 * (VAR12 *
        (CONST289 * VAR08 - CONST290 * VAR26) + VAR14 * (-CONST049 * VAR06 +
        CONST186 * VAR24 + CONST307 * VAR08 * VAR26) + VAR16 * (CONST164 *
        VAR04 + CONST192 * VAR08 * VAR24 + CONST199 * VAR06 * VAR26 - 
        CONST266 * VAR22) + y * (CONST075 * VAR02 + CONST285 * VAR06 *
        VAR24 + CONST297 * VAR08 * VAR22 + CONST374 * VAR20)) + g_8 * (
        CONST009 * VAR08 * (-CONST140 * VAR15 * VAR25 + CONST231 * VAR13 *
        z - CONST273 * VAR21 + CONST288 * VAR17 * VAR23) + CONST010 * VAR06 *
        (CONST017 * VAR23 + CONST173 * VAR15 * z + CONST288 * VAR17 * VAR25
        ) + CONST011 * VAR04 * (-CONST273 * VAR25 + CONST344 * VAR17 * z) +
        CONST024 * VAR02 * z + CONST082 * VAR11 * z + CONST173 * VAR15 *
        VAR23 + CONST231 * VAR13 * VAR25 + CONST344 * VAR17 * VAR21 - 
        CONST397 * VAR19) + g_9 * (CONST009 * VAR08 * (CONST042 * VAR22 * y +
        CONST211 * VAR14 * VAR26 + CONST251 * VAR16 * VAR24 + CONST312 *
        VAR12) + CONST010 * VAR06 * (CONST058 * VAR24 * y + CONST142 *
        VAR14 + CONST252 * VAR16 * VAR26) + CONST011 * VAR04 * (CONST042 *
        VAR26 * y + CONST331 * VAR16) + CONST015 * VAR20 * y + CONST025 *
        VAR10 + CONST076 * VAR02 * y + CONST142 * VAR14 * VAR24 + CONST312 *
        VAR12 * VAR26 + CONST331 * VAR16 * VAR22)
    g_y += CONST000 * g_18 * y * (CONST027 * VAR02 + CONST027 * VAR20 + 
        CONST128 * VAR06 * VAR24 + CONST207 * VAR04 * VAR26 + CONST207 *
        VAR08 * VAR22) + CONST000 * g_2 * y * (-CONST039 * VAR05 * VAR25 + 
        CONST039 * VAR07 * VAR23 + CONST319 * VAR03 * z - CONST319 * VAR21 * x
        ) + g_1 * (CONST014 * VAR01 + CONST062 * VAR20 * x + CONST203 *
        VAR07 * VAR22 + CONST281 * VAR05 * VAR24 + CONST292 * VAR03 * VAR26
        ) + g_10 * (CONST034 * VAR10 + CONST064 * VAR20 * y + CONST065 *
        VAR02 * y + CONST067 * VAR14 * VAR24 + CONST182 * VAR16 * VAR22 + 
        CONST233 * VAR12 * VAR26 + VAR04 * (CONST131 * VAR26 * y + CONST181 *
        VAR16) + VAR06 * (CONST067 * VAR14 + CONST137 * VAR16 * VAR26 + 
        CONST165 * VAR24 * y) + VAR08 * (CONST091 * VAR14 * VAR26 + 
        CONST130 * VAR22 * y + CONST137 * VAR16 * VAR24 + CONST232 * VAR12)
        ) + g_11 * (CONST015 * VAR19 + VAR21 * (CONST042 * VAR08 + CONST253 *
        VAR17) + VAR23 * (CONST033 * VAR08 * VAR17 + CONST058 * VAR06 + 
        CONST155 * VAR15) + VAR25 * (CONST032 * VAR06 * VAR17 + CONST042 *
        VAR04 + CONST235 * VAR08 * VAR15 + CONST361 * VAR13) + z * (
        CONST015 * VAR02 + CONST155 * VAR06 * VAR15 + CONST253 * VAR04 *
        VAR17 - CONST312 * VAR11 + CONST360 * VAR08 * VAR13)) + g_12 * (-
        CONST140 * VAR16 * VAR22 - CONST244 * VAR12 * VAR26 + CONST293 *
        VAR14 * VAR24 + CONST343 * VAR20 * y - CONST344 * VAR02 * y + VAR04 *
        (CONST140 * VAR16 - CONST311 * VAR26 * y) + VAR06 * (CONST139 *
        VAR16 * VAR26 - CONST295 * VAR14) + VAR08 * (-CONST140 * VAR16 *
        VAR24 + CONST244 * VAR12 + CONST309 * VAR22 * y)) + g_13 * (
        CONST009 * VAR17 * (CONST208 * VAR06 * VAR25 + CONST266 * VAR04 * z +
        CONST335 * VAR08 * VAR23 - CONST336 * VAR21) + CONST010 * VAR15 * (
        CONST176 * VAR08 * VAR25 - CONST186 * VAR06 * z + CONST298 * VAR23) +
        CONST011 * VAR13 * (CONST077 * VAR25 + CONST290 * VAR08 * z) - 
        CONST350 * VAR04 * VAR25 - CONST358 * VAR06 * VAR23 - CONST374 *
        VAR02 * z + CONST384 * VAR19) + g_14 * (CONST071 * VAR02 * y + 
        CONST072 * VAR20 * y - CONST193 * VAR14 * VAR24 + CONST193 * VAR16 *
        VAR22 + VAR04 * (CONST193 * VAR16 + CONST274 * VAR26 * y) + VAR06 *
        (CONST159 * VAR24 * y - CONST193 * VAR14 + CONST272 * VAR16 * VAR26
        ) + VAR08 * (-CONST148 * VAR16 * VAR24 + CONST274 * VAR22 * y + 
        CONST278 * VAR14 * VAR26)) + g_15 * (CONST009 * VAR17 * (CONST241 *
        VAR04 * z - CONST241 * VAR06 * VAR25 + CONST242 * VAR08 * VAR23 + 
        CONST347 * VAR21) + CONST010 * VAR15 * (CONST083 * VAR23 + CONST101 *
        VAR08 * VAR25 - CONST223 * VAR06 * z) + CONST046 * VAR02 * z + 
        CONST197 * VAR19 + CONST332 * VAR06 * VAR23 + CONST352 * VAR08 * VAR21
        ) + g_16 * (-CONST108 * VAR06 * VAR16 * VAR26 - CONST280 * VAR16 *
        VAR22 - CONST354 * VAR02 * y + CONST354 * VAR20 * y + VAR04 * (
        CONST135 * VAR26 * y + CONST280 * VAR16) + VAR08 * (CONST108 *
        VAR16 * VAR24 + CONST287 * VAR22 * y)) + g_17 * (CONST009 * VAR17 *
        (CONST048 * VAR21 + CONST125 * VAR08 * VAR23 - CONST256 * VAR06 *
        VAR25 + CONST277 * VAR04 * z) + CONST059 * VAR02 * z + CONST296 *
        VAR04 * VAR25 - CONST318 * VAR08 * VAR21 + CONST334 * VAR06 * VAR23 +
        CONST386 * VAR19) + g_19 * (CONST014 * VAR19 + CONST062 * VAR02 * z +
        CONST203 * VAR04 * VAR25 + CONST281 * VAR06 * VAR23 + CONST292 *
        VAR08 * VAR21) + g_3 * (CONST009 * VAR17 * (CONST144 * VAR22 * x + 
        CONST256 * VAR07 * VAR24 + CONST294 * VAR05 * VAR26 + CONST366 *
        VAR03) + CONST122 * VAR07 * VAR22 + CONST318 * VAR03 * VAR26 - 
        CONST334 * VAR05 * VAR24 + CONST356 * VAR20 * x - CONST386 * VAR01
        ) + g_4 * (CONST248 * VAR03 * y * z + VAR05 * (CONST213 * VAR16 * z +
        CONST286 * VAR25 * y) + VAR07 * (CONST287 * VAR23 * y + CONST323 *
        VAR16 * VAR25) + x * (CONST213 * VAR16 * VAR23 + CONST247 * VAR21 * y)
        ) + g_5 * (CONST009 * VAR17 * (-CONST241 * VAR07 * VAR24 + CONST241 *
        VAR22 * x + CONST243 * VAR05 * VAR26 + CONST347 * VAR03) + CONST010 *
        VAR15 * (CONST083 * VAR05 + CONST101 * VAR07 * VAR26 - CONST223 *
        VAR24 * x) + CONST046 * VAR20 * x + CONST197 * VAR01 + CONST332 *
        VAR05 * VAR24 + CONST353 * VAR03 * VAR26) + g_6 * (CONST275 * VAR03 *
        y * z + VAR05 * (CONST274 * VAR25 * y - CONST302 * VAR16 * z) + 
        VAR07 * (CONST146 * VAR23 * y + CONST302 * VAR14 * z) + x * (
        CONST146 * VAR21 * y - CONST302 * VAR14 * VAR25 + CONST302 * VAR16 *
        VAR23)) + g_7 * (CONST009 * VAR17 * (CONST087 * VAR05 * VAR26 - 
        CONST209 * VAR07 * VAR24 - CONST266 * VAR22 * x + CONST336 * VAR03) +
        CONST010 * VAR15 * (CONST186 * VAR24 * x + CONST237 * VAR07 * VAR26 -
        CONST298 * VAR05) + CONST011 * VAR13 * (-CONST290 * VAR26 * x + 
        CONST345 * VAR07) + CONST340 * VAR01 + CONST350 * VAR07 * VAR22 + 
        CONST358 * VAR05 * VAR24 + CONST374 * VAR20 * x) + g_8 * (CONST311 *
        VAR03 * y * z + VAR05 * (CONST206 * VAR16 * z + CONST216 * VAR25 *
        y) + VAR07 * (CONST028 * VAR16 * VAR25 + CONST216 * VAR23 * y + 
        CONST226 * VAR14 * z) + x * (CONST206 * VAR16 * VAR23 + CONST226 *
        VAR14 * VAR25 + CONST259 * VAR12 * z + CONST311 * VAR21 * y)) + g_9 * (
        CONST015 * VAR01 + VAR03 * (CONST042 * VAR26 + CONST253 * VAR17) + 
        VAR05 * (CONST033 * VAR17 * VAR26 + CONST058 * VAR24 + CONST155 *
        VAR15) + VAR07 * (CONST032 * VAR17 * VAR24 + CONST042 * VAR22 + 
        CONST235 * VAR15 * VAR26 + CONST361 * VAR13) + x * (CONST015 *
        VAR20 + CONST155 * VAR15 * VAR24 + CONST253 * VAR17 * VAR22 - 
        CONST314 * VAR11 + CONST361 * VAR13 * VAR26))
    g_z += g_0 * (CONST093 * VAR20 * x + CONST210 * VAR03 * VAR26 + 
        CONST250 * VAR05 * VAR24 + CONST328 * VAR07 * VAR22 - CONST378 * VAR01
        ) + g_1 * y * (-CONST018 * VAR05 * VAR25 + CONST018 * VAR07 * VAR23 +
        CONST224 * VAR03 * z - CONST224 * VAR21 * x) + g_10 * (CONST095 *
        VAR15 * VAR23 + CONST132 * VAR17 * VAR21 + CONST265 * VAR13 * VAR25 +
        CONST333 * VAR11 * z + CONST391 * VAR19 + CONST398 * VAR02 * z + 
        VAR04 * (CONST131 * VAR17 * z + CONST376 * VAR25) + VAR06 * (
        CONST094 * VAR15 * z + CONST246 * VAR17 * VAR25 + CONST369 * VAR23) +
        VAR08 * (CONST137 * VAR15 * VAR25 + CONST246 * VAR17 * VAR23 + 
        CONST265 * VAR13 * z + CONST375 * VAR21)) + g_11 * (CONST009 *
        VAR26 * (CONST042 * VAR04 * y + CONST211 * VAR08 * VAR14 + CONST251 *
        VAR06 * VAR16 + CONST313 * VAR12) + CONST010 * VAR24 * (CONST058 *
        VAR06 * y + CONST142 * VAR14 + CONST252 * VAR08 * VAR16) + CONST011 *
        VAR22 * (CONST042 * VAR08 * y + CONST331 * VAR16) + CONST015 *
        VAR02 * y + CONST026 * VAR10 + CONST076 * VAR20 * y + CONST142 *
        VAR06 * VAR14 + CONST314 * VAR08 * VAR12 + CONST331 * VAR04 * VAR16
        ) + g_12 * (CONST050 * VAR02 * z + CONST082 * VAR11 * z + CONST097 *
        VAR15 * VAR23 + CONST120 * VAR13 * VAR25 + CONST262 * VAR17 * VAR21 -
        CONST385 * VAR19 + VAR04 * (CONST273 * VAR25 - CONST311 * VAR17 * z
        ) + VAR06 * (CONST017 * VAR23 + CONST238 * VAR15 * z) + VAR08 * (
        CONST029 * VAR21 - CONST140 * VAR15 * VAR25 + CONST217 * VAR17 * VAR23)
        ) + g_13 * (VAR12 * (CONST290 * VAR08 - CONST290 * VAR26) + VAR14 *
        (CONST049 * VAR24 - CONST186 * VAR06 - CONST307 * VAR08 * VAR26) + 
        VAR16 * (-CONST164 * VAR22 + CONST209 * VAR08 * VAR24 + CONST219 *
        VAR06 * VAR26 + CONST266 * VAR04) + y * (-CONST285 * VAR06 * VAR24 -
        CONST297 * VAR04 * VAR26 + CONST346 * VAR20 - CONST374 * VAR02)
        ) + g_14 * (CONST104 * VAR02 * z + CONST114 * VAR15 * VAR23 + 
        CONST146 * VAR17 * VAR21 + CONST194 * VAR19 - CONST239 * VAR13 *
        VAR25 + VAR04 * (CONST274 * VAR17 * z - CONST362 * VAR25) + VAR06 *
        (CONST072 * VAR23 + CONST171 * VAR15 * z + CONST240 * VAR17 * VAR25
        ) + VAR08 * (CONST030 * VAR21 + CONST114 * VAR17 * VAR23 - CONST148 *
        VAR15 * VAR25 + CONST338 * VAR13 * z)) + g_15 * (VAR14 * (CONST185 *
        VAR08 * VAR26 - CONST222 * VAR24 - CONST223 * VAR06) + VAR16 * (
        CONST079 * VAR06 * VAR26 + CONST134 * VAR08 * VAR24 + CONST202 *
        VAR22 + CONST241 * VAR04) + y * (CONST046 * VAR02 + CONST073 *
        VAR20 + CONST195 * VAR06 * VAR24 + CONST223 * VAR08 * VAR22)
        ) + g_16 * (CONST022 * VAR19 + CONST035 * VAR02 * z + CONST175 *
        VAR15 * VAR23 + CONST291 * VAR17 * VAR21 + VAR04 * (CONST057 *
        VAR25 + CONST135 * VAR17 * z) + VAR06 * (CONST341 * VAR15 * z + 
        CONST346 * VAR23) + VAR08 * (CONST108 * VAR15 * VAR25 + CONST158 *
        VAR17 * VAR23 + CONST337 * VAR21)) + g_17 * (VAR16 * (-CONST044 *
        VAR06 * VAR26 + CONST044 * VAR08 * VAR24 + CONST144 * VAR22 + 
        CONST277 * VAR04) + y * (-CONST016 * VAR08 * VAR22 + CONST059 *
        VAR02 + CONST180 * VAR04 * VAR26 + CONST205 * VAR06 * VAR24 + 
        CONST351 * VAR20)) + g_18 * (CONST061 * VAR02 * z + CONST127 *
        VAR08 * VAR21 + CONST284 * VAR06 * VAR23 + CONST306 * VAR04 * VAR25 +
        CONST381 * VAR19 + VAR17 * (CONST039 * VAR04 * z + CONST081 * VAR08 *
        VAR23 + CONST316 * VAR06 * VAR25 - CONST319 * VAR21)) + g_19 * y * (
        CONST062 * VAR02 + CONST063 * VAR20 + CONST204 * VAR04 * VAR26 + 
        CONST204 * VAR08 * VAR22 + CONST279 * VAR06 * VAR24) + g_2 * (
        CONST151 * VAR01 + CONST162 * VAR07 * VAR22 + CONST319 * VAR03 *
        VAR26 + CONST348 * VAR20 * x + VAR17 * (-CONST040 * VAR22 * x - 
        CONST081 * VAR05 * VAR26 + CONST103 * VAR07 * VAR24 + CONST319 * VAR03)
        ) + g_20 * (-CONST163 * VAR06 * VAR23 + CONST212 * VAR08 * VAR21 - 
        CONST327 * VAR02 * z + CONST329 * VAR04 * VAR25 - CONST378 * VAR19
        ) + g_3 * (VAR16 * (-CONST183 * VAR23 * x + CONST228 * VAR05 * z + 
        CONST267 * VAR07 * VAR25) + y * (CONST116 * VAR07 * VAR23 - 
        CONST234 * VAR05 * VAR25 + CONST234 * VAR21 * x + CONST268 * VAR03 * z)
        ) + g_4 * (CONST008 * VAR01 + VAR03 * (CONST303 * VAR17 + CONST377 *
        VAR26) + VAR05 * (CONST175 * VAR15 - CONST307 * VAR17 * VAR26 + 
        CONST326 * VAR24) + VAR07 * (CONST108 * VAR15 * VAR26 + CONST341 *
        VAR17 * VAR24 + CONST359 * VAR22) + x * (CONST053 * VAR20 + 
        CONST307 * VAR17 * VAR22 + CONST341 * VAR15 * VAR24)) + g_5 * (
        VAR14 * (CONST147 * VAR07 * z - CONST147 * VAR25 * x) + VAR16 * (
        CONST154 * VAR05 * z + CONST190 * VAR07 * VAR25 + CONST310 * VAR23 *
        x) + y * (CONST156 * VAR21 * x + CONST222 * VAR05 * VAR25 + 
        CONST325 * VAR03 * z)) + g_6 * (CONST177 * VAR01 + VAR03 * (
        CONST030 * VAR26 + CONST321 * VAR17) + VAR05 * (-CONST193 * VAR15 +
        CONST229 * VAR17 * VAR26) + VAR07 * (CONST239 * VAR13 + CONST258 *
        VAR17 * VAR24 + CONST362 * VAR22) + x * (CONST148 * VAR15 * VAR24 -
        CONST338 * VAR13 * VAR26 + CONST357 * VAR17 * VAR22 + CONST372 * VAR20)
        ) + g_7 * (-CONST221 * VAR12 * x * z + VAR14 * (CONST136 * VAR07 *
        z + CONST260 * VAR25 * x) + VAR16 * (CONST119 * VAR05 * z - 
        CONST145 * VAR23 * x + CONST342 * VAR07 * VAR25) + y * (CONST237 *
        VAR07 * VAR23 + CONST297 * VAR05 * VAR25 + CONST298 * VAR21 * x)
        ) + g_8 * (-CONST397 * VAR01 + VAR03 * (CONST031 * VAR26 + CONST344 *
        VAR17) + VAR05 * (CONST055 * VAR24 + CONST160 * VAR17 * VAR26 + 
        CONST173 * VAR15) + VAR07 * (CONST051 * VAR22 + CONST143 * VAR15 *
        VAR26 + CONST231 * VAR13 + CONST322 * VAR17 * VAR24) + x * (
        CONST024 * VAR20 + CONST082 * VAR11 + CONST196 * VAR17 * VAR22 + 
        CONST295 * VAR13 * VAR26 + CONST330 * VAR15 * VAR24)) + g_9 * (
        CONST070 * VAR03 * y * z + VAR05 * (CONST121 * VAR25 * y + CONST168 *
        VAR16 * z) + VAR07 * (CONST121 * VAR23 * y + CONST261 * VAR16 *
        VAR25 - CONST361 * VAR14 * z) + x * (CONST070 * VAR21 * y + 
        CONST167 * VAR16 * VAR23 + CONST264 * VAR12 * z - CONST361 * VAR14 *
        VAR25))
    tl.store(coord_grad_ptr + coord_row_offset, g_x, mask=coord_row_offset <
        coord_numel)
    tl.store(coord_grad_ptr + coord_row_offset + 1, g_y, mask=
        coord_row_offset + 1 < coord_numel)
    tl.store(coord_grad_ptr + coord_row_offset + 2, g_z, mask=
        coord_row_offset + 2 < coord_numel)
