From d54358b5338495bc7b90dc1fcac5f2c9734e9e89 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 20 Apr 2019 16:56:35 +0200 Subject: Use 'init' in max_root_norm in futhark --- aberth/aberth_kernel.fut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'aberth') 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.. f32.i32 i * v) (zip (1.. 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 -- cgit v1.2.3-70-g09d2