Numerical solution of Bloch's equation for neutron spin precession