MATLAB Answers

Mear
0

Improving accuracy of computation

Asked by Mear
on 7 Sep 2011
I'm doing an assignment for a class in numerical computation which involves calculating pi with a given formula. No problem there, however I'm also asked to improve accuracy by rewriting said formula.
I have to admit I have no idea what affects accuracy in matlab, especially when it's something as seemingly simple sa rewriting a relatively uncomplicated formula.
I'm wondering if anyone has any tips or examples for me, to help me understand how I can approach this. I haven't bothered posting the formula, since I'm really not after anyone giving me the solution, but rather understanding the question. :)

  0 Comments

Sign in to comment.

2 Answers

Answer by Titus Edelhofer on 7 Sep 2011
 Accepted Answer

Most often numerical accuracy is (badly) affected when subtracting values of similar size. Example (using 4 digits only):
x1 = 1.234
x2 = 1.223
x = x1-x2 = 0.011
So: two numbers with 4 digits accuracy lead to a x with only two digits. Increasing accuracy is possible in those cases, where rearranging the formula leads to expressions avoiding the problem above....
Titus

  0 Comments

Sign in to comment.


Answer by Nirmal Gunaseelan on 7 Sep 2011

I recommend reading Loren's post on this topic and might help you get a basic understanding of issues that you might want to be aware of. Also, kudos on taking particular effort in not posting an assignment question and asking the underlying question.

  0 Comments

Sign in to comment.