实三次多项式的最快数值解? [英] Fastest numerical solution of a real cubic polynomial?

查看:72
本文介绍了实三次多项式的最快数值解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R 问题:寻找最快的方法来数值求解一堆已知具有实系数和三个实根的任意三次方.据报道,R 中的 polyroot 函数对复多项式使用 Jenkins-Traub 的算法 419,但对于实多项式,作者参考了他们早期的工作.实三次或更一般的实多项式的更快选项是什么?

R question: Looking for the fastest way to NUMERICALLY solve a bunch of arbitrary cubics known to have real coeffs and three real roots. The polyroot function in R is reported to use Jenkins-Traub's algorithm 419 for complex polynomials, but for real polynomials the authors refer to their earlier work. What are the faster options for a real cubic, or more generally for a real polynomial?

推荐答案

充实上面 Arietta 的回答:

Fleshing out Arietta's answer above:

> a <- c(1,3,-4)
> m <- matrix(c(0,0,-a[1],1,0,-a[2],0,1,-a[3]), byrow=T, nrow=3)
> roots <- eigen(m, symm=F, only.values=T)$values

这是否比在 GSL 包中使用三次求解器更快或更慢(如上面 knguyen 所建议的)是在您的系统上对其进行基准测试的问题.

Whether this is faster or slower than using the cubic solver in the GSL package (as suggested by knguyen above) is a matter of benchmarking it on your system.

这篇关于实三次多项式的最快数值解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆