math: move more stuff to get_rl_sval()