Copyright | (c) 2015-2018 Frederick Schneider |
---|---|
License | MIT |
Maintainer | Frederick Schneider <frederick.schneider2011@gmail.com> |
Stability | Provisional |
Safe Haskell | None |
Language | Haskell2010 |
A Canon is an exponentation-based representation for arbitrarily massive numbers, including prime towers.
- makeCanon :: Integer -> Canon
- makeC :: Integer -> Canon
- canonToGCR :: Canon -> GCR_
- cToGCR :: Canon -> GCR_
- cMult :: Canon -> Canon -> CycloMap -> (Canon, CycloMap)
- cDiv :: Canon -> Canon -> CycloMap -> (Canon, CycloMap)
- cAdd :: Canon -> Canon -> CycloMap -> (Canon, CycloMap)
- cSubtract :: Canon -> Canon -> CycloMap -> (Canon, CycloMap)
- cExp :: Canon -> Canon -> Bool -> CycloMap -> (Canon, CycloMap)
- cReciprocal :: Canon -> Canon
- cGCD :: Canon -> Canon -> Canon
- cLCM :: Canon -> Canon -> Canon
- cMod :: Canon -> Canon -> Canon
- cOdd :: Canon -> Bool
- cTotient :: Canon -> CycloMap -> (Canon, CycloMap)
- cPhi :: Canon -> CycloMap -> (Canon, CycloMap)
- cLog :: Canon -> Rational
- cLogDouble :: Canon -> Double
- cNegative :: Canon -> Bool
- cPositive :: Canon -> Bool
- cIntegral :: Canon -> Bool
- cRational :: Canon -> Bool
- cIrrational :: Canon -> Bool
- cSimplify :: Canon -> Canon
- cSimplified :: Canon -> Bool
- cDepth :: Canon -> Integer
- cSplit :: Canon -> (Canon, Canon)
- cNumerator :: Canon -> Canon
- cDenominator :: Canon -> Canon
- cCanonical :: Canon -> Bool
- cBare :: Canon -> Bool
- cBareStatus :: Canon -> BareStatus
- cValueType :: Canon -> CanonValueType
- cIsPrimeTower :: Canon -> Bool
- cPrimeTowerLevel :: Canon -> Integer
- cTetration :: Canon -> Integer -> CycloMap -> (Canon, CycloMap)
- cPentation :: Canon -> Integer -> CycloMap -> (Canon, CycloMap)
- cHexation :: Canon -> Integer -> CycloMap -> (Canon, CycloMap)
- cHyperOp :: Integer -> Canon -> Integer -> CycloMap -> (Canon, CycloMap)
- (>^) :: CanonRoot a b c => a -> b -> c
- (<^) :: CanonExpnt a b c => a -> b -> c
- (%) :: Integral a => a -> a -> a
- (<^>) :: Canon -> Integer -> Canon
- (<<^>>) :: Canon -> Integer -> Canon
- (<<<^>>>) :: Canon -> Integer -> Canon
Documentation
makeCanon :: Integer -> Canon Source #
Create a Canon from an integer. This may involve expensive factorization.
canonToGCR :: Canon -> GCR_ Source #
Functions to Convert Canon to Generalized Canon Rep
cMult :: Canon -> Canon -> CycloMap -> (Canon, CycloMap) Source #
Multiply Function: Generally speaking this will be much cheaper.
cDiv :: Canon -> Canon -> CycloMap -> (Canon, CycloMap) Source #
Div function : Multiply by the reciprocal.
cAdd :: Canon -> Canon -> CycloMap -> (Canon, CycloMap) Source #
Addition and subtraction is generally much more expensive because it requires refactorization. There is logic to look for algebraic forms which can greatly reduce simplify factorization.
cSubtract :: Canon -> Canon -> CycloMap -> (Canon, CycloMap) Source #
Addition and subtraction is generally much more expensive because it requires refactorization. There is logic to look for algebraic forms which can greatly reduce simplify factorization.
cExp :: Canon -> Canon -> Bool -> CycloMap -> (Canon, CycloMap) Source #
Exponentiation: This does allow for negative exponentiation if the Bool flag is True.
cReciprocal :: Canon -> Canon Source #
Compute reciprocal (by negating exponents).
cOdd :: Canon -> Bool Source #
Check if a Canon is an odd integer. Note: If the Canon is not integral, return False
cLogDouble :: Canon -> Double Source #
Compute log as a Double.
cIntegral :: Canon -> Bool Source #
Functions to check if a Canon is integral, (ir)rational, "simplified" or a prime tower
cRational :: Canon -> Bool Source #
Functions to check if a Canon is integral, (ir)rational, "simplified" or a prime tower
cIrrational :: Canon -> Bool Source #
Functions to check if a Canon is integral, (ir)rational, "simplified" or a prime tower
cSimplify :: Canon -> Canon Source #
Force the expression to be simplified. This could potentially be very expensive.
cSimplified :: Canon -> Bool Source #
Functions to check if a Canon is integral, (ir)rational, "simplified" or a prime tower
cNumerator :: Canon -> Canon Source #
cNumerator and cDenominator are for processing "rational" canon reps.
cDenominator :: Canon -> Canon Source #
cNumerator and cDenominator are for processing "rational" canon reps.
cCanonical :: Canon -> Bool Source #
Is the Canon a more complex expression?
cBareStatus :: Canon -> BareStatus Source #
Returns the status for Bare numbers.
cValueType :: Canon -> CanonValueType Source #
Return the CanonValueType (Integral, etc).
cIsPrimeTower :: Canon -> Bool Source #
Functions to check if a Canon is integral, (ir)rational, "simplified" or a prime tower
cPrimeTowerLevel :: Canon -> Integer Source #
This is used for tetration, etc. It defaults to zero for non-integral reps.
cHyperOp :: Integer -> Canon -> Integer -> CycloMap -> (Canon, CycloMap) Source #
Generalized Hyperoperation Function
(<^>) :: Canon -> Integer -> Canon infixr 9 Source #
Hyperoperations (including tetration and beyond): https://en.wikipedia.org/wiki/Hyperoperation | The thinking around the operators is that they should look progressively scarier :)
(<<^>>) :: Canon -> Integer -> Canon infixr 9 Source #
Hyperoperations (including tetration and beyond): https://en.wikipedia.org/wiki/Hyperoperation | The thinking around the operators is that they should look progressively scarier :)
(<<<^>>>) :: Canon -> Integer -> Canon infixr 9 Source #
Hyperoperations (including tetration and beyond): https://en.wikipedia.org/wiki/Hyperoperation | The thinking around the operators is that they should look progressively scarier :)