@triton.jit
def _triton_second_order_fwd(x_ptr: tl.tensor, y_ptr: tl.tensor, z_ptr: tl.
    tensor, sh_1_0_ptr: tl.tensor, sh_1_1_ptr: tl.tensor, sh_1_2_ptr: tl.
    tensor, sh_2_0_ptr: tl.tensor, sh_2_1_ptr: tl.tensor, sh_2_2_ptr: tl.
    tensor, sh_2_3_ptr: tl.tensor, sh_2_4_ptr: tl.tensor, BLOCK_SIZE: tl.
    constexpr, vector_length: tl.constexpr):
    sqrt_3 = 3 ** 0.5
    block_id = tl.program_id(0)
    offset = tl.arange(0, BLOCK_SIZE) + BLOCK_SIZE * block_id
    x_row_start = x_ptr + offset
    y_row_start = y_ptr + offset
    z_row_start = z_ptr + offset
    x = tl.load(x_row_start, mask=offset < vector_length)
    y = tl.load(y_row_start, mask=offset < vector_length)
    z = tl.load(z_row_start, mask=offset < vector_length)
    sh_1_0 = x * sqrt_3
    sh_1_1 = y * sqrt_3
    sh_1_2 = z * sqrt_3
    sqrt_15 = 15 ** 0.5
    sqrt_5 = 5 ** 0.5
    sq_x = x * x
    sq_y = y * y
    sq_z = z * z
    sh_2_0 = sqrt_15 * x * z
    sh_2_1 = sqrt_15 * x * y
    sh_2_2 = sqrt_5 * (sq_y - 0.5 * (sq_x + sq_z))
    sh_2_3 = sqrt_15 * y * z
    sh_2_4 = 0.5 * sqrt_15 * (sq_z - sq_x)
    sh_1_0_start = sh_1_0_ptr + offset
    sh_1_1_start = sh_1_1_ptr + offset
    sh_1_2_start = sh_1_2_ptr + offset
    sh_2_0_start = sh_2_0_ptr + offset
    sh_2_1_start = sh_2_1_ptr + offset
    sh_2_2_start = sh_2_2_ptr + offset
    sh_2_3_start = sh_2_3_ptr + offset
    sh_2_4_start = sh_2_4_ptr + offset
    tl.store(sh_1_0_start, sh_1_0, mask=offset < vector_length)
    tl.store(sh_1_1_start, sh_1_1, mask=offset < vector_length)
    tl.store(sh_1_2_start, sh_1_2, mask=offset < vector_length)
    tl.store(sh_2_0_start, sh_2_0, mask=offset < vector_length)
    tl.store(sh_2_1_start, sh_2_1, mask=offset < vector_length)
    tl.store(sh_2_2_start, sh_2_2, mask=offset < vector_length)
    tl.store(sh_2_3_start, sh_2_3, mask=offset < vector_length)
    tl.store(sh_2_4_start, sh_2_4, mask=offset < vector_length)
