aboutsummaryrefslogtreecommitdiff
path: root/aberth/aberth_kernel.fut
diff options
context:
space:
mode:
Diffstat (limited to 'aberth/aberth_kernel.fut')
-rw-r--r--aberth/aberth_kernel.fut4
1 files changed, 2 insertions, 2 deletions
diff --git a/aberth/aberth_kernel.fut b/aberth/aberth_kernel.fut
index e1e7aa3..79d7cfa 100644
--- a/aberth/aberth_kernel.fut
+++ b/aberth/aberth_kernel.fut
@@ -29,11 +29,11 @@ let evaln_d (p: poly) (nterms: i32) (pt: f32): f32 =
let eval_d (p: poly) (pt: f32): f32 = evaln_d p (length p) pt
let derivative (p: poly): *poly =
- map (\(i, v) -> f32.i32 i * v) (zip (1..<PolyN) (drop 1 p)) ++ [0]
+ map (\(i, v) -> f32.i32 i * v) (zip (1..<PolyN) (tail p)) ++ [0]
-- Cauchy's bound: https://en.wikipedia.org/wiki/Geometrical_properties_of_polynomial_roots#Lagrange's_and_Cauchy's_bounds
let max_root_norm (p: poly): f32 =
- 1 + f32.maximum (map (\coef -> f32.abs (coef / p[PolyN-1])) p)
+ 1 + f32.maximum (map (\coef -> f32.abs (coef / p[PolyN-1])) (init p))
module aberth = {
type approx = [N]complex