Improving accuracy of computation
1 次查看(过去 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 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!