From be30f3a5a4c10d4a3c9eb42e38e2ce3306d42c85 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 15 Apr 2014 10:50:14 -0400 Subject: [PATCH] Fix a bug in the relative error. --- src/FEM/R1.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/FEM/R1.hs b/src/FEM/R1.hs index 28317a6..9ce8387 100644 --- a/src/FEM/R1.hs +++ b/src/FEM/R1.hs @@ -615,8 +615,7 @@ relative_error_pointwise :: forall m n l a. -> a -- ^ The point @x@ at which to compute the error. -> a relative_error_pointwise pde params u x = - cent * ( u_exact - u_fem ) / u_exact + cent * ( abs $ (u x) - u_fem ) / ( abs $ u x ) where - u_exact = abs $ u x u_fem = evaluate' (solution pde params) x cent = fromInteger 100 -- 2.44.2