Midpoint Method Formula