From: Michael Orlitzky Date: Tue, 15 Apr 2014 14:50:14 +0000 (-0400) Subject: Fix a bug in the relative error. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=be30f3a5a4c10d4a3c9eb42e38e2ce3306d42c85;p=numerical-analysis.git Fix a bug in the relative error. --- 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