Paste: square root appoximation

Author: Crest
Mode: haskell
Date: Sun, 9 Nov 2008 14:31:02
Plain Text |
wurzel :: Double -> Double -> Double
wurzel a eps = loop a where
        loop :: Double -> Double
        loop h | abs( (h * h) - a ) <= eps = h
               | otherwise                 = loop (0.5 * (h + (a / h)))

New Annotation

Summary:
Author:
Mode:
Body: