필터 지우기
필터 지우기

Improving accuracy of computation

조회 수: 1 (최근 30일)
Mear
Mear 2011년 9월 7일
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. :)

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 9월 7일
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

추가 답변 (1개)

Nirmal Gunaseelan
Nirmal Gunaseelan 2011년 9월 7일
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.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by