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
data Algorithm squareRootAlgorithm factorialAlgorithm =
Borwein1993 squareRootAlgorithm factorialAlgorithm
deriving (Eq, Read, Show)
instance (
ToolShed.Defaultable.Defaultable squareRootAlgorithm,
ToolShed.Defaultable.Defaultable factorialAlgorithm
) => ToolShed.Defaultable.Defaultable (Algorithm squareRootAlgorithm factorialAlgorithm) where
defaultValue = Borwein1993 ToolShed.Defaultable.defaultValue ToolShed.Defaultable.defaultValue
instance (
Math.SquareRoot.Algorithmic squareRootAlgorithm,
Math.Factorial.Algorithmic factorialAlgorithm
) => Math.Pi.Algorithmic (Algorithm squareRootAlgorithm factorialAlgorithm) where
openR (Borwein1993 squareRootAlgorithm factorialAlgorithm) = Math.Implementations.Pi.Borwein.Implementation.openR Math.Implementations.Pi.Borwein.Borwein1993.series squareRootAlgorithm factorialAlgorithm