m1 = a + (b-a)/2

m2 = (a+b)/2

why is it that m2's result is more accurate than m1's result ?

Printable View

- Jul 11th 2010, 10:41 AMTGASJOOLaccuracy
m1 = a + (b-a)/2

m2 = (a+b)/2

why is it that m2's result is more accurate than m1's result ? - Jul 11th 2010, 10:51 AMCaptainBlack
- Jul 11th 2010, 10:58 AMTGASJOOL
normal floating point arithmetic of a pc applies in this case. I have seen many bisection algorithms do it like m2. Why does m1 produce a lower accurate result?

- Jul 12th 2010, 01:53 AMCaptainBlack