Improving accuracy of computation
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
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
0 件のコメント
その他の回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!