def METHOD_NAME(q_im1, om_im1, dt):
    no = np.linalg.norm(om_im1)
    if no == 0.:
        codt2 = 1.
        sodt2o = 1.
    else:
        codt2 = math.cos(dt / 2. * no)
        sodt2o = math.sin(dt / 2. * no) / no
    p = -om_im1[0]
    q = -om_im1[1]
    r = -om_im1[2]
    # WTF wrong formula. inverted signs instead
    Phi = np.array([[codt2, p * sodt2o, q * sodt2o, r * sodt2o],
                    [-p * sodt2o, codt2, -r * sodt2o, q * sodt2o],
                    [-q * sodt2o, r * sodt2o, codt2, -p * sodt2o],
                    [-r * sodt2o, -q * sodt2o, p * sodt2o, codt2]])
    q_i = np.dot(Phi, q_im1)
    return q_i