module Factory.Math.Implementations.Pi.Borwein.Algorithm(
Algorithm(..)
) where
import qualified Factory.Math.Factorial as Math.Factorial
import qualified Factory.Math.Implementations.Pi.Borwein.Borwein1993 as Math.Implementations.Pi.Borwein.Borwein1993
import qualified Factory.Math.Implementations.Pi.Borwein.Implementation as Math.Implementations.Pi.Borwein.Implementation
import qualified Factory.Math.Pi as Math.Pi
import qualified Factory.Math.SquareRoot as Math.SquareRoot
import qualified ToolShed.Defaultable as Defaultable
data Algorithm squareRootAlgorithm factorialAlgorithm =
Borwein1993 squareRootAlgorithm factorialAlgorithm
deriving (Eq, Read, Show)
instance (
Defaultable.Defaultable squareRootAlgorithm,
Defaultable.Defaultable factorialAlgorithm
) => Defaultable.Defaultable (Algorithm squareRootAlgorithm factorialAlgorithm) where
defaultValue = Borwein1993 Defaultable.defaultValue Defaultable.defaultValue
instance (
Math.SquareRoot.Algorithm squareRootAlgorithm,
Math.Factorial.Algorithm factorialAlgorithm
) => Math.Pi.Algorithm (Algorithm squareRootAlgorithm factorialAlgorithm) where
openR (Borwein1993 squareRootAlgorithm factorialAlgorithm) = Math.Implementations.Pi.Borwein.Implementation.openR Math.Implementations.Pi.Borwein.Borwein1993.series squareRootAlgorithm factorialAlgorithm