]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/FEM/R1.hs
src: import only instances from Prelude, where appropriate.
[numerical-analysis.git] / src / FEM / R1.hs
index 28317a6faecabaf0a079215a192f961a7d5e5be3..dd5c11b023b9f267ddf2ac70479e2b4c6a004f85 100644 (file)
@@ -35,7 +35,7 @@ import qualified Algebra.RealField as RealField ( C )
 import qualified Algebra.ToRational as ToRational ( C )
 import Data.Vector.Fixed ( Arity, S )
 import NumericPrelude hiding ( abs )
-import qualified Prelude as P
+import Prelude ()
 
 import Integration.Gaussian ( gaussian )
 import Linear.Matrix (
@@ -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