verbose, the diff in cpp python seems due to cmath::cos and math::cos