Increase arithmetic precision in using Cardano formula
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am using general analytic formula to find the roots of a quartic equation as shown here. The equation is of general form with variable complex coefficients, so very small chance to reduce it to a simpler form. Within the arithmetic I lose lots of precision specially when coefficients take on small values. I used symbolic toolbox and vpa and got fantastic result but it is very time-consuming and almost impossible to use in my case as solving this quartic equation is done in each time step integration of solving an ODE problem.
Any idea or a numerical trick to circumvent this issue?
Thanks,
0 Commenti
Risposte (1)
John D'Errico
il 23 Set 2021
Modificato: John D'Errico
il 23 Set 2021
Either use roots to solve for the roots of the quartic, or be forced to use symbolic form for the solutions. Note that roots will be blazingly fast, and it will give you virtually full double precision accuracy. The only case where roots will not be full double precision accuracy is when there are roots with higher multiplicity than 1, but that is not the fault of roots.
Note, there is absolutely no need to use the Cardano formula, as roots will be just as accurate and probably as fast.
If you find the numerical roots from roots are insufficiently accurate, then you have no choice but to use higher precision, and accept that if you insist on super high accuracy, then you must sacrifice speed.
There is no solution that will be both immensely accurate AND blazingly fast. So take your pick. There are no "tricks".
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!