The first formula
m = (a + b) / 2
is simple, but has a great risk of overflow. Besides, Numerical Analysis, 9th Edition by Burden and Faires points out that
when b - a is near the maximum precision of the machine, it is possible for (a + b) / 2 to return a midpoint the is not even in the interval [a, b].
though no further explanation is provided.
The second one
m = a + (b - a) / 2
is also correct, with a smaller chance of overflow. But for floating numbers, nearly equal values of a and b may lead to a loss of significance.
So, which formula is better in practice? Also, an explanation for the quote statement will be appreciated.