debugged ratio simplifications, inlining and reduce-constant