Clean up code in log_r_y.m

Clean up code in log_r_y.m