Improving accuracy of computation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Titus Edelhofer
el 7 de Sept. de 2011
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 comentarios
Más respuestas (1)
Nirmal Gunaseelan
el 7 de Sept. de 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 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!