module Factory.Math.Implementations.Pi.Ramanujan.Algorithm(
Algorithm(..)
) where
import qualified Data.Default
import qualified Factory.Math.Factorial as Math.Factorial
import qualified Factory.Math.Implementations.Pi.Ramanujan.Chudnovsky as Math.Implementations.Pi.Ramanujan.Chudnovsky
import qualified Factory.Math.Implementations.Pi.Ramanujan.Classic as Math.Implementations.Pi.Ramanujan.Classic
import qualified Factory.Math.Implementations.Pi.Ramanujan.Implementation as Math.Implementations.Pi.Ramanujan.Implementation
import qualified Factory.Math.Pi as Math.Pi
import qualified Factory.Math.SquareRoot as Math.SquareRoot
data Algorithm squareRootAlgorithm factorialAlgorithm
= Classic squareRootAlgorithm factorialAlgorithm
| Chudnovsky squareRootAlgorithm factorialAlgorithm
deriving (Eq, Read, Show)
instance (
Data.Default.Default squareRootAlgorithm,
Data.Default.Default factorialAlgorithm
) => Data.Default.Default (Algorithm squareRootAlgorithm factorialAlgorithm) where
def = Chudnovsky Data.Default.def Data.Default.def
instance (
Math.SquareRoot.Algorithmic squareRootAlgorithm,
Math.Factorial.Algorithmic factorialAlgorithm
) => Math.Pi.Algorithmic (Algorithm squareRootAlgorithm factorialAlgorithm) where
openR (Classic squareRootAlgorithm factorialAlgorithm) = Math.Implementations.Pi.Ramanujan.Implementation.openR Math.Implementations.Pi.Ramanujan.Classic.series squareRootAlgorithm factorialAlgorithm
openR (Chudnovsky squareRootAlgorithm factorialAlgorithm) = Math.Implementations.Pi.Ramanujan.Implementation.openR Math.Implementations.Pi.Ramanujan.Chudnovsky.series squareRootAlgorithm factorialAlgorithm