diff --git a/Language/Atom/Code.hs b/Language/Atom/Code.hs
--- a/Language/Atom/Code.hs
+++ b/Language/Atom/Code.hs
@@ -11,6 +11,8 @@
 import Data.Maybe
 import Text.Printf
 
+import Data.Generics.Uniplate.Data
+
 import Language.Atom.Analysis
 import Language.Atom.Elaboration
 import Language.Atom.Expressions
@@ -100,14 +102,55 @@
     UD2B _               -> ["*((", ct Word64, " *) &(", a, "))"]
     UB2F _               -> ["*((", ct Float , " *) &(", a, "))"]
     UB2D _               -> ["*((", ct Double, " *) &(", a, "))"]
+-- math.h:
+    UPi                  -> [ "M_PI" ]
+    UExp   _             -> [ "exp",   f, " ( ", a, " )"]
+    ULog   _             -> [ "log",   f, " ( ", a, " )"]
+    USqrt  _             -> [ "sqrt",  f, " ( ", a, " )"]
+    UPow   _ _           -> [ "pow",   f, " ( ", a, ", ", b, " )"]
+    USin   _             -> [ "sin",   f, " ( ", a, " )"]
+    UAsin  _             -> [ "asin",  f, " ( ", a, " )"]
+    UCos   _             -> [ "cos",   f, " ( ", a, " )"]
+    UAcos  _             -> [ "acos",  f, " ( ", a, " )"]
+    USinh  _             -> [ "sinh",  f, " ( ", a, " )"]
+    UCosh  _             -> [ "cosh",  f, " ( ", a, " )"]
+    UAsinh _             -> [ "asinh", f, " ( ", a, " )"]
+    UAcosh _             -> [ "acosh", f, " ( ", a, " )"]
+    UAtan  _             -> [ "atan",  f, " ( ", a, " )"]
+    UAtanh _             -> [ "atanh", f, " ( ", a, " )"]
     where
     ct = cType
     a = head operands
     b = operands !! 1
     c = operands !! 2
+    f = case ( typeOf ue ) of
+          Float     -> "f"
+          Double    -> ""
+          _         -> error "unhandled float type"
 
+
 type RuleCoverage = [(Name, Int, Int)]
 
+containMathHFunctions rules = any isMathHCall ues
+       where ues            = rules >>= allUEs >>= universe
+             isMathHCall fc = case fc of
+                                UPi        -> True
+                                UExp   _   -> True
+                                ULog   _   -> True
+                                USqrt  _   -> True
+                                UPow   _ _ -> True
+                                USin   _   -> True
+                                UAsin  _   -> True
+                                UCos   _   -> True
+                                UAcos  _   -> True
+                                USinh  _   -> True
+                                UCosh  _   -> True
+                                UAsinh _   -> True
+                                UAcosh _   -> True
+                                UAtan  _   -> True
+                                UAtanh _   -> True
+                                _          -> False
+
 writeC :: Name -> Config -> StateHierarchy -> [Rule] -> Schedule -> [Name] -> [Name] -> [(Name, Type)] -> IO RuleCoverage
 writeC name config state rules schedule assertionNames coverageNames probeNames = do
   writeFile (name ++ ".c") c
@@ -118,6 +161,7 @@
   c = unlines
     [ "#include <stdbool.h>"
     , "#include <stdint.h>"
+    , codeIf ( containMathHFunctions rules ) "#include <math.h>"
     , ""
     , preCode
     , ""
diff --git a/Language/Atom/Elaboration.hs b/Language/Atom/Elaboration.hs
--- a/Language/Atom/Elaboration.hs
+++ b/Language/Atom/Elaboration.hs
@@ -27,6 +27,7 @@
 import Control.Monad.Trans
 import Data.Function (on)
 import Data.List
+import Data.Char
 import Language.Atom.Expressions
 
 type UID = Int
@@ -273,11 +274,21 @@
 addName :: Name -> Atom Name
 addName name = do
   (g, atom) <- get
+  checkName name
   if elem name (atomNames atom)
     then error $ "ERROR: Name \"" ++ name ++ "\" not unique in " ++ show atom ++ "."
     else do
       put (g, atom { atomNames = name : atomNames atom })
       return $ atomName atom ++ "." ++ name
+
+-- still accepts some misformed names
+checkName :: Name -> Atom ()
+checkName name =
+  if (\ x -> isAlpha x || x == '_') (head name) && 
+      and (map (\ x -> isAlphaNum x || x `elem` "._-[]") (tail name)) && 
+      and (map isAscii name)
+    then return ()
+    else error $ "ERROR: Name \"" ++ name ++ "\" is not a valid identifier."
 
 {-
 ruleGraph :: Name -> [Rule] -> [UV] -> IO ()
diff --git a/Language/Atom/Expressions.hs b/Language/Atom/Expressions.hs
--- a/Language/Atom/Expressions.hs
+++ b/Language/Atom/Expressions.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE GADTs, DeriveDataTypeable #-}
+
 module Language.Atom.Expressions
   (
   -- * Types
@@ -77,6 +79,8 @@
 import Data.Ratio
 import Data.Word
 
+import Data.Generics hiding ( typeOf )
+
 --infixl 7 /., %.
 --infixl 6 +., -.
 --infixr 5 ++.
@@ -99,7 +103,7 @@
   | Word64
   | Float
   | Double
-  deriving (Show, Read, Eq, Ord, Enum)
+  deriving (Show, Read, Eq, Ord, Enum, Data, Typeable)
 
 data Const
   = CBool   Bool
@@ -113,7 +117,7 @@
   | CWord64 Word64
   | CFloat  Float
   | CDouble Double
-  deriving (Eq, Ord)
+  deriving (Eq, Ord, Data, Typeable)
 
 instance Show Const where
   show c = case c of
@@ -165,7 +169,7 @@
   = UV Int String Const
   | UVArray UA UE
   | UVExtern String Type
-  deriving (Show, Eq, Ord)
+  deriving (Show, Eq, Ord, Data, Typeable)
 
 -- | A typed array.
 data A a = A UA deriving Eq
@@ -174,7 +178,7 @@
 data UA
   = UA Int String [Const]
   | UAExtern String Type
-  deriving (Show, Eq, Ord)
+  deriving (Show, Eq, Ord, Data, Typeable)
 
 -- | A typed expression.
 data E a where
@@ -200,6 +204,22 @@
   B2F     :: E Word32 -> E Float
   B2D     :: E Word64 -> E Double
   Retype  :: UE -> E a
+-- math.h:
+  Pi      :: FloatingE a => E a
+  Exp     :: FloatingE a => E a -> E a
+  Log     :: FloatingE a => E a -> E a
+  Sqrt    :: FloatingE a => E a -> E a
+  Pow     :: FloatingE a => E a -> E a -> E a
+  Sin     :: FloatingE a => E a -> E a
+  Asin    :: FloatingE a => E a -> E a
+  Cos     :: FloatingE a => E a -> E a
+  Acos    :: FloatingE a => E a -> E a
+  Sinh    :: FloatingE a => E a -> E a
+  Cosh    :: FloatingE a => E a -> E a
+  Asinh   :: FloatingE a => E a -> E a
+  Acosh   :: FloatingE a => E a -> E a
+  Atan    :: FloatingE a => E a -> E a
+  Atanh   :: FloatingE a => E a -> E a
 
 instance Show (E a) where
   show _ = error "Show (E a) not implemented"
@@ -230,7 +250,23 @@
   | UD2B   UE
   | UB2F   UE
   | UB2D   UE
-  deriving (Show, Eq, Ord)
+-- math.h:
+  | UPi
+  | UExp   UE
+  | ULog   UE
+  | USqrt  UE
+  | UPow   UE UE
+  | USin   UE
+  | UAsin  UE
+  | UCos   UE
+  | UAcos  UE
+  | USinh  UE
+  | UCosh  UE
+  | UAsinh UE
+  | UAcosh UE
+  | UAtan  UE
+  | UAtanh UE
+  deriving (Show, Eq, Ord, Data, Typeable)
 
 class Width a where
   width :: a -> Int
@@ -314,6 +350,22 @@
     UD2B _     -> Word64
     UB2F _     -> Float
     UB2D _     -> Double
+-- math.h:
+    UPi        -> Double
+    UExp   a   -> typeOf a
+    ULog   a   -> typeOf a
+    USqrt  a   -> typeOf a
+    UPow   a _ -> typeOf a
+    USin   a   -> typeOf a
+    UAsin  a   -> typeOf a
+    UCos   a   -> typeOf a
+    UAcos  a   -> typeOf a
+    USinh  a   -> typeOf a
+    UCosh  a   -> typeOf a
+    UAsinh a   -> typeOf a
+    UAcosh a   -> typeOf a
+    UAtan  a   -> typeOf a
+    UAtanh a   -> typeOf a
 
 instance Expr a => TypeOf (E a) where
   typeOf = eType
@@ -473,7 +525,8 @@
   recip a = 1 / a
   fromRational r = Const $ fromInteger (numerator r) / fromInteger (denominator r)
 
-{-
+-- make typed Atom expressions an instance of Floating
+-- to generate calls to functions in math.h
 instance (Num a, Fractional a, Floating a, FloatingE a) => Floating (E a) where
   pi       = Const pi
   exp      (Const a) = Const $ exp a
@@ -496,7 +549,6 @@
   asinh    a         = log (a + sqrt (a ** 2 + 1))
   acosh    a         = log (a + sqrt (a ** 2 - 1))
   atanh    a         = 0.5 * log ((1 + a) / (1 - a))
--}
 
 instance (Expr a, OrdE a, EqE a, IntegralE a, Bits a) => Bits (E a) where
   (Const a) .&. (Const b) = Const $ a .&. b
@@ -684,6 +736,22 @@
   UD2B a      -> [a]
   UB2F a      -> [a]
   UB2D a      -> [a]
+-- math.h:
+  UPi         -> []
+  UExp   a    -> [a]
+  ULog   a    -> [a]
+  USqrt  a    -> [a]
+  UPow   a b  -> [a, b]
+  USin   a    -> [a]
+  UAsin  a    -> [a]
+  UCos   a    -> [a]
+  UAcos  a    -> [a]
+  USinh  a    -> [a]
+  UCosh  a    -> [a]
+  UAsinh a    -> [a]
+  UAcosh a    -> [a]
+  UAtan  a    -> [a]
+  UAtanh a    -> [a]
 
 -- | The list of all UVs that directly control the value of an expression.
 nearestUVs :: UE -> [UV]
@@ -727,6 +795,23 @@
   B2F    a     -> UB2F     (ue a)
   B2D    a     -> UB2D     (ue a)
   Retype a     -> a
+-- math.h:
+  Pi           -> UPi
+  Exp    a     -> UExp   (ue a)
+  Log    a     -> ULog   (ue a)
+  Sqrt   a     -> USqrt  (ue a)
+  Pow    a b   -> UPow   (ue a) (ue b)
+  Sin    a     -> USin   (ue a)
+  Asin   a     -> UAsin  (ue a)
+  Cos    a     -> UCos   (ue a)
+  Acos   a     -> UAcos  (ue a)
+  Sinh   a     -> USinh  (ue a)
+  Cosh   a     -> UCosh  (ue a)
+  Asinh  a     -> UAsinh (ue a)
+  Acosh  a     -> UAcosh (ue a)
+  Atan   a     -> UAtan  (ue a)
+  Atanh  a     -> UAtanh (ue a)
+
   where
   tt = eType t
 
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,3 +1,11 @@
+atom 1.0.6    09/20/2010
+
+- Support for math.h expressions
+
+atom 1.0.5    09/20/2010
+
+- Deriving Enum for Type
+
 atom 1.0.4    05/23/2010
 
 - Added 'exactPhase'.  (Lee Pike)
diff --git a/atom.cabal b/atom.cabal
--- a/atom.cabal
+++ b/atom.cabal
@@ -1,5 +1,5 @@
 name:    atom
-version: 1.0.5
+version: 1.0.6
 
 category: Language
 
@@ -18,7 +18,7 @@
     the need and overhead of RTOSs for many embedded applications.
 
 author:     Tom Hawkins <tomahawkins@gmail.com>
-maintainer: Tom Hawkins <tomahawkins@gmail.com>
+maintainer: Tom Hawkins <tomahawkins@gmail.com>, Lee Pike <leepike@gmail.com>
 
 license:      BSD3
 license-file: LICENSE
@@ -35,7 +35,9 @@
     build-depends:
         base       >= 4.0     && < 5,
         mtl        >= 1.1.0.1 && < 1.2,
-        process    >= 1.0.1.1 && < 1.2
+        process    >= 1.0.1.1 && < 1.2,
+        syb        >= 0.1.0.0 && < 0.2.0.0,
+        uniplate   >= 1.5.0   && < 2.0
 
     exposed-modules:
         Language.Atom
@@ -50,7 +52,7 @@
         Language.Atom.Scheduling
         Language.Atom.Unit
 
-    extensions: GADTs
+    extensions: GADTs, DeriveDataTypeable
 
     if impl(ghc > 6.8)
           ghc-options: -fwarn-tabs
