Copyright | (c) 2015-2019 Frederick Schneider |
---|---|
License | MIT |
Maintainer | Frederick Schneider <fws.nyc@gmail.com> |
Stability | Provisional |
Safe Haskell | None |
Language | Haskell2010 |
A Canon is exponentation-based representation for arbitrarily massive numbers, including prime towers and hyper-expressions.
Synopsis
- data Canon
- makeCanon :: Integer -> Canon
- makeCanon' :: Integer -> (Canon, Bool)
- data BareStatus
- data CanonValueType
- cShowFull :: Canon -> String
- cShowFullAsCode :: Canon -> String
- cShowAsCode :: Canon -> String
- cShowAsCodeUnf :: Canon -> String
- cShowUnf :: Canon -> String
- 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
- (>^) :: Canon -> Canon -> Canon
- (<^) :: Canon -> Canon -> Canon
- cGCD :: Canon -> Canon -> Canon
- cLCM :: Canon -> Canon -> Canon
- cMod :: Canon -> Canon -> Canon
- cOdd :: Canon -> Bool
- cEven :: Canon -> Bool
- cTotient :: Canon -> CycloMap -> (Canon, CycloMap)
- cPhi :: Canon -> CycloMap -> (Canon, CycloMap)
- cNegative :: Canon -> Bool
- cPositive :: Canon -> Bool
- cIntegral :: Canon -> Bool
- cRational :: Canon -> Bool
- cIrrational :: Canon -> Bool
- cPrime :: Canon -> Bool
- cSimplified :: Canon -> Bool
- cSplit :: Canon -> (Canon, Canon)
- cNumerator :: Canon -> Canon
- cDenominator :: Canon -> Canon
- cCanonical :: Canon -> Bool
- cBare :: Canon -> Bool
- cBareStatus :: Canon -> BareStatus
- cValueType :: Canon -> CanonValueType
- cDelve :: Canon -> [Int] -> Canon
- cIsPrimeTower :: Canon -> Bool
- cPrimeTowerLevel :: Canon -> Canon
- cSuperLog :: Canon -> (SuperPairC, Int)
- cSuperLogCmp :: SuperPairC -> SuperPairC -> Ordering
- cTetration :: Canon -> Canon -> Canon
- cPentation :: Canon -> Canon -> Canon
- cHexation :: Canon -> Canon -> Canon
- cHeptation :: Canon -> Canon -> Canon
- cOctation :: Canon -> Canon -> Canon
- cNonation :: Canon -> Canon -> Canon
- cTetrationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cPentationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cHexationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cHeptationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cOctationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cNonationL :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- (<^>) :: Canon -> Canon -> Canon
- (<<^>>) :: Canon -> Canon -> Canon
- (<<<^>>>) :: Canon -> Canon -> Canon
- (<<<<^>>>>) :: Canon -> Canon -> Canon
- (<<<<<^>>>>>) :: Canon -> Canon -> Canon
- (|<^>|) :: Canon -> Canon -> Canon
- (<^^>) :: Canon -> [Canon] -> Canon
- (<<^^>>) :: Canon -> [Canon] -> Canon
- (<<<^^>>>) :: Canon -> [Canon] -> Canon
- (<<<<^^>>>>) :: Canon -> [Canon] -> Canon
- (<<<<<^^>>>>>) :: Canon -> [Canon] -> Canon
- (|<^^>|) :: Canon -> [Canon] -> Canon
- (~^~) :: Canon -> Canon -> Canon
- (~<^>~) :: Canon -> Canon -> Canon
- (~<<^>>~) :: Canon -> Canon -> Canon
- (~<<<^>>>~) :: Canon -> Canon -> Canon
- (~<<<<^>>>>~) :: Canon -> Canon -> Canon
- (~|^|~) :: Canon -> Canon -> Canon
- (~|<^>|~) :: Canon -> Canon -> Canon
- (~|<<^>>|~) :: Canon -> Canon -> Canon
- (~|<<<^>>>|~) :: Canon -> Canon -> Canon
- (~|<<<<^>>>>|~) :: Canon -> Canon -> Canon
- (~~^~~) :: Canon -> Canon -> Canon
- (~~<^>~~) :: Canon -> Canon -> Canon
- (~~<<^>>~~) :: Canon -> Canon -> Canon
- (~~<<<^>>>~~) :: Canon -> Canon -> Canon
- (~~<<<<^>>>>~~) :: Canon -> Canon -> Canon
- (~~|^|~~) :: Canon -> Canon -> Canon
- (~~|<^>|~~) :: Canon -> Canon -> Canon
- (~~|<<^>>|~~) :: Canon -> Canon -> Canon
- (~~|<<<^>>>|~~) :: Canon -> Canon -> Canon
- (~~|<<<<^>>>>|~~) :: Canon -> Canon -> Canon
- (~~~^~~~) :: Canon -> Canon -> Canon
- (~~~<^>~~~) :: Canon -> Canon -> Canon
- (~~~<<^>>~~~) :: Canon -> Canon -> Canon
- (~~~<<<^>>>~~~) :: Canon -> Canon -> Canon
- (~~~<<<<^>>>>~~~) :: Canon -> Canon -> Canon
- (~~~|^|~~~) :: Canon -> Canon -> Canon
- (~~~|<^>|~~~) :: Canon -> Canon -> Canon
- (~~~|<<^>>|~~~) :: Canon -> Canon -> Canon
- (~~~|<<<^>>>|~~~) :: Canon -> Canon -> Canon
- (~~~|<<<<^>>>>|~~~) :: Canon -> Canon -> Canon
- (~~~~^~~~~) :: Canon -> Canon -> Canon
- (~~~~<^>~~~~) :: Canon -> Canon -> Canon
- (~~~~<<^>>~~~~) :: Canon -> Canon -> Canon
- (~~~~<<<^>>>~~~~) :: Canon -> Canon -> Canon
- (~~~~<<<<^>>>>~~~~) :: Canon -> Canon -> Canon
- (~~~~|^|~~~~) :: Canon -> Canon -> Canon
- (~~~~|<^>|~~~~) :: Canon -> Canon -> Canon
- (~~~~|<<^>>|~~~~) :: Canon -> Canon -> Canon
- (~~~~|<<<^>>>|~~~~) :: Canon -> Canon -> Canon
- (~~~~|<<<<^>>>>|~~~~) :: Canon -> Canon -> Canon
- (~~~~~^~~~~~) :: Canon -> Canon -> Canon
- cAddOpLevel :: Canon
- cMultOpLevel :: Canon
- cExpOpLevel :: Canon
- cTetrOpLevel :: Canon
- cPentOpLevel :: Canon
- cHexOpLevel :: Canon
- cHeptOpLevel :: Canon
- cOctOpLevel :: Canon
- cNonOpLevel :: Canon
- cGetHyperList :: Canon -> [Canon]
- cGetHyperOp :: Canon -> Canon
- maxHyperOpDispLevel :: Integer
- maxHyperOpDelveLevel :: Canon
- cFactorSum :: Canon -> Bool -> Canon
- cConvertToSum :: Canon -> (Canon, Bool)
- cMaxExpoToExpand :: Canon
- cFactorHorizon :: Canon -> Canon
- cApplyHy :: Canon -> [Canon] -> Bool -> Canon
- cHyperOp :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap)
- cHyperExpr :: Canon -> Bool
- cHyperExprAny :: Canon -> Bool
- cMaxHyperOp :: Canon -> Canon
- cMinHyperOp :: Canon -> Canon
- cMaxHyperOpForQC :: Canon -> Canon
- cHyperSum :: Canon -> Bool
- cHyperProd :: Canon -> Bool
- cHyperExpo :: Canon -> Bool
- cHyperSumAny :: Canon -> Bool
- cHyperize :: Canon -> Canon
- cQuasiCanonize :: Canon -> Canon
- cQuasiCanonized :: Canon -> Bool
- cCleanup :: Canon -> Canon
- cGetAddends :: Canon -> [Canon]
- cGetFactors :: Canon -> [Canon]
- cCleanupAsNumDenPair :: Canon -> (Canon, Canon)
- type CanonElement = (Canon, Canon)
- cGetBase :: CanonElement -> Canon
- cGetExponent :: CanonElement -> Canon
- type SuperPairC = (Canon, Double)
- cGetBases :: Canon -> [Canon]
- cGetBasesDeep :: Canon -> [Canon]
- cGetExponents :: Canon -> [Canon]
- cGetElements :: Canon -> [CanonElement]
- cNumDivisors :: Canon -> Canon
- cTau :: Canon -> Canon
- cDivisors :: Canon -> Either String [Canon]
- cNthDivisor :: Canon -> Canon -> Either String Canon
- cWhichDivisor :: Canon -> Canon -> Either String Canon
- cRelativelyPrime :: Canon -> Canon -> Maybe Bool
- cGetFirstNDivisors :: Int -> Canon -> Either String [Canon]
- cN1 :: Canon
- c0 :: Canon
- c1 :: Canon
- c2 :: Canon
- c3 :: Canon
- c4 :: Canon
- c5 :: Canon
- c6 :: Canon
- c7 :: Canon
- c8 :: Canon
- c9 :: Canon
- data CycloMap
- getIntegerBasedCycloMap :: CycloMap -> Map Integer CycloPair
- crCycloInitMap :: CycloMap
Documentation
This is a GADT representing either a Bare (Integer), some variation of a Can(onical) form or a HX (Hyper eXpression) consisting of a level and list of Canons (see CanonValueType)
Instances
Enum Canon Source # | |
Defined in Math.NumberTheory.Canon | |
Eq Canon Source # | Instances for Canon |
Fractional Canon Source # | |
Integral Canon Source # | |
Num Canon Source # | |
Ord Canon Source # | |
Real Canon Source # | |
Defined in Math.NumberTheory.Canon toRational :: Canon -> Rational # | |
Show Canon Source # | |
CanonConv Canon Source # | Instance of CanonConv class |
Defined in Math.NumberTheory.Canon toSC :: Canon -> SimpleCanon Source # toRC :: Canon -> RationalSimpleCanon Source # |
makeCanon :: Integer -> Canon Source #
Create a Canon from an Integer. This may involve expensive factorization.
makeCanon' :: Integer -> (Canon, Bool) Source #
Create a Canon from an Integer. Returns the Canon and flag indicating full factorization or not.
data BareStatus Source #
BareStatus: A "Bare Simp" number means a prime number, +/-1 or 0. The code must set the flag properly. A "Bare NSim" number is an Integer that has not been checked (to see if it can be factored).
Instances
Eq BareStatus Source # | |
Defined in Math.NumberTheory.Canon (==) :: BareStatus -> BareStatus -> Bool # (/=) :: BareStatus -> BareStatus -> Bool # | |
Ord BareStatus Source # | |
Defined in Math.NumberTheory.Canon compare :: BareStatus -> BareStatus -> Ordering # (<) :: BareStatus -> BareStatus -> Bool # (<=) :: BareStatus -> BareStatus -> Bool # (>) :: BareStatus -> BareStatus -> Bool # (>=) :: BareStatus -> BareStatus -> Bool # max :: BareStatus -> BareStatus -> BareStatus # min :: BareStatus -> BareStatus -> BareStatus # | |
Show BareStatus Source # | |
Defined in Math.NumberTheory.Canon showsPrec :: Int -> BareStatus -> ShowS # show :: BareStatus -> String # showList :: [BareStatus] -> ShowS # |
data CanonValueType Source #
CanonValueType: 3 possibilities for this GADT (integral, non-integral rational, irrational). Imaginary/complex numbers are not supported
Instances
Eq CanonValueType Source # | |
Defined in Math.NumberTheory.Canon (==) :: CanonValueType -> CanonValueType -> Bool # (/=) :: CanonValueType -> CanonValueType -> Bool # | |
Ord CanonValueType Source # | |
Defined in Math.NumberTheory.Canon compare :: CanonValueType -> CanonValueType -> Ordering # (<) :: CanonValueType -> CanonValueType -> Bool # (<=) :: CanonValueType -> CanonValueType -> Bool # (>) :: CanonValueType -> CanonValueType -> Bool # (>=) :: CanonValueType -> CanonValueType -> Bool # max :: CanonValueType -> CanonValueType -> CanonValueType # min :: CanonValueType -> CanonValueType -> CanonValueType # | |
Show CanonValueType Source # | |
Defined in Math.NumberTheory.Canon showsPrec :: Int -> CanonValueType -> ShowS # show :: CanonValueType -> String # showList :: [CanonValueType] -> ShowS # |
cShowFull :: Canon -> String Source #
Various show functions: cShowFull - fully expand large primes and composites in Canon expression. Unf in name means don't factor unless it's too big too display AsCode in name means you can copy and paste the results and execute them.
cShowFullAsCode :: Canon -> String Source #
Various show functions: cShowFull - fully expand large primes and composites in Canon expression. Unf in name means don't factor unless it's too big too display AsCode in name means you can copy and paste the results and execute them.
cShowAsCode :: Canon -> String Source #
Various show functions: cShowFull - fully expand large primes and composites in Canon expression. Unf in name means don't factor unless it's too big too display AsCode in name means you can copy and paste the results and execute them.
cShowAsCodeUnf :: Canon -> String Source #
Various show functions: cShowFull - fully expand large primes and composites in Canon expression. Unf in name means don't factor unless it's too big too display AsCode in name means you can copy and paste the results and execute them.
cShowUnf :: Canon -> String Source #
Various show functions: cShowFull - fully expand large primes and composites in Canon expression. Unf in name means don't factor unless it's too big too display AsCode in name means you can copy and paste the results and execute them.
cMult :: Canon -> Canon -> CycloMap -> (Canon, CycloMap) Source #
Multiply Function: Generally speaking, this will be much cheaper than addition/subtraction which requires factoring. You are usually just merging lists of prime, exponent pairs and adding exponents where common primes are found. This notion is the crux of the library.
Note: This can be used instead of the *
operator if you want to maintain a CycloMap for performance
reasons.
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. Note: This can be used instead of the +/- operators if you want to maintain a CycloMap for performance reasons.
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. Note: This can be used instead of the +/- operators if you want to maintain a CycloMap for performance reasons.
cExp :: Canon -> Canon -> Bool -> CycloMap -> (Canon, CycloMap) Source #
Exponentiation: This does allow for negative exponentiation if the Bool flag is True. Note: This can be used instead of the exponentiation operator if you want to maintain a CycloMap for performance reasons.
cReciprocal :: Canon -> Canon Source #
Compute reciprocal (by negating exponents or equivalent).
(<^) :: Canon -> Canon -> Canon infixr 9 Source #
Special exponentiation operator for Canon (One MUST use this instead of the standard exp. operator: ^)
cOdd :: Canon -> Bool Source #
Check if a Canon is integral and odd/even, respectively. Note: Return False for both if the Canon is not integral. See CanonValueType for possible cases.
cEven :: Canon -> Bool Source #
Check if a Canon is integral and odd/even, respectively. Note: Return False for both if the Canon is not integral. See CanonValueType for possible cases.
cNegative :: Canon -> Bool Source #
Function to check if a Canon is negative cNegative c | trace ("cNegative: (l=" ++ show c ++ "))") False = undefined
cIrrational :: Canon -> Bool Source #
Check if Canon is Irrational
cSimplified :: Canon -> Bool Source #
Check if Canon is simplified, meaning completely factored
cNumerator :: Canon -> Canon Source #
Return the numerator
cDenominator :: Canon -> Canon Source #
Return the denominator
cCanonical :: Canon -> Bool Source #
Checks if the Canon is Canonical, a more complex expression.
cBareStatus :: Canon -> BareStatus Source #
Returns the status for Bare numbers.
cValueType :: Canon -> CanonValueType Source #
Return the CanonValueType (Integral, etc).
cDelve :: Canon -> [Int] -> Canon Source #
Take a Canon and a list of indexes and delve into the Canon. This operates on the internal hyper lists.
cIsPrimeTower :: Canon -> Bool Source #
Check if Canon is a prime tower
cPrimeTowerLevel :: Canon -> Canon Source #
This is used for tetration, etc. It defaults to zero for non-integral reps.
cSuperLog :: Canon -> (SuperPairC, Int) Source #
This is the super log function. Similar to the iterated log function. A level and mantissa is returned along with the number's sign.
cSuperLogCmp :: SuperPairC -> SuperPairC -> Ordering Source #
Compare the level and the "mantissa"
(<^>) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(<<^>>) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(<<<^>>>) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(<<<<^>>>>) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(<<<<<^>>>>>) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(|<^>|) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~^~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~<^>~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~<<^>>~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~<<<^>>>~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~<<<<^>>>>~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~|^|~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~|<^>|~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~|<<^>>|~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~|<<<^>>>|~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~|<<<<^>>>>|~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~^~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~<^>~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~<<^>>~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~<<<^>>>~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~<<<<^>>>>~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~|^|~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~|<^>|~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~|<<^>>|~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~|<<<^>>>|~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~|<<<<^>>>>|~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~^~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~<^>~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~<<^>>~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~<<<^>>>~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~<<<<^>>>>~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~|^|~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~|<^>|~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~|<<^>>|~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~|<<<^>>>|~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~|<<<<^>>>>|~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~^~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~<^>~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~<<^>>~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~<<<^>>>~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~<<<<^>>>>~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~|^|~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~|<^>|~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~|<<^>>|~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~|<<<^>>>|~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~|<<<<^>>>>|~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
(~~~~~^~~~~~) :: Canon -> Canon -> Canon infixr 9 Source #
Defined specialty hyper operators range from level 4 / tetration (<^>) to level 50 (~~~~~^~~~~~). See source or .odp file for the operator naming convention.
cAddOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cMultOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cExpOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cTetrOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cPentOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cHexOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cHeptOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cOctOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cNonOpLevel :: Canon Source #
Variable reps ranging from 1 to 9 in the hyperoperation hierarchy
cGetHyperList :: Canon -> [Canon] Source #
Return the list of canons from a hyper expression
cGetHyperOp :: Canon -> Canon Source #
Return the level of hyperoperation from a hyper expression.
maxHyperOpDispLevel :: Integer Source #
Internal value that corresponds with ~~~~~^~~~~~ (level 50 hyperoperation)
maxHyperOpDelveLevel :: Canon Source #
Max hyper operaton level when converting to canonical form (for the sake of combining and reducing terms)
cFactorSum :: Canon -> Bool -> Canon Source #
cFactor : Factor simple terms from a sum. If the flag is true, only factor by the gcd if the gcd is a hyper expression
cConvertToSum :: Canon -> (Canon, Bool) Source #
Convert a hyperexpression to a sum if possible. Useful in comparison. Will expand polynomials to a limited degree.
cMaxExpoToExpand :: Canon Source #
Maximum exponent (of a polynomial) to distribute into a sum of terms.
cFactorHorizon :: Canon -> Canon Source #
This is good for polynomial-like expressions like: (1 + 3<^>4 + 3<^>5) <^ 3 - 1, where there's a mixture of "canonical" and hE exponents.
cApplyHy :: Canon -> [Canon] -> Bool -> Canon Source #
wrapper to create apply a hyperoperation to a list
cHyperOp :: Canon -> [Canon] -> CycloMap -> (Canon, CycloMap) Source #
Generalized Hyperoperation Function
cHyperExpr :: Canon -> Bool Source #
Check if Canon is a hyperexpression
cHyperExprAny :: Canon -> Bool Source #
Check if Canon has a hyperexpression anywhere in its definition
cMaxHyperOp :: Canon -> Canon Source #
Find the maximum hyperoperation embedded in a Canon.
cMinHyperOp :: Canon -> Canon Source #
Find the minimum hyperoperation embedded in a Canon. (If it's not a hyper expression, return zero.)
cMaxHyperOpForQC :: Canon -> Canon Source #
Used when checking if one can quasi-canonize a hyper expression (should be compared against the cutoff)
cHyperSum :: Canon -> Bool Source #
Check if Canon is a positive sum (or negative one times a positive sum). Internally, all level 1 expressions are positive.
cHyperProd :: Canon -> Bool Source #
Check if Canon is a product (and specificlly not a negative sum)
cHyperExpo :: Canon -> Bool Source #
Check if Canon is an exponential expression
cHyperSumAny :: Canon -> Bool Source #
Check if Canon has a hypersum embedded in the expression
cHyperize :: Canon -> Canon Source #
cHyperize will take a Canon in quasi-canonized form and try to clean it up in a tidier expression
>>>
cShowUnf $ cHyperize $ 7 <^ ( 1 + 2 * (49 <^> 7))
7 * 49 <^> 8
cQuasiCanonize :: Canon -> Canon Source #
This is akin to canonical form except you may have sums in the bases. It converts expression up to a hyperoperational cutoff.
cQuasiCanonized :: Canon -> Bool Source #
This checks if the (hyper)expression is in quasi-canonical form.
cCleanup :: Canon -> Canon Source #
Try to make expression more elegant by creating exponential tails and then hyperizing them
cGetAddends :: Canon -> [Canon] Source #
If the Canon is a product, return the factors. Otherwise, return the Canon itself.
cGetFactors :: Canon -> [Canon] Source #
If the Canon is a sum, return the addends. Otherwise, return the Canon itself.
type CanonElement = (Canon, Canon) Source #
This element is a base, exponent pair. The base is an integer and is generally prime or 0, -1. The exponent is also a Canon (allowing for arbitrary nesting) A Canon conceptually consists of a list of these elements. The first member of the pair will be a Canon raised to the first power. By doing this, we allow for further generality in the definition of a Canon.
cGetBase :: CanonElement -> Canon Source #
Return the base b from a CanonElement (equivalent to b^e).
cGetExponent :: CanonElement -> Canon Source #
Return the exponent e from a CanonElement (equivalent to b^e).
type SuperPairC = (Canon, Double) Source #
Used when computing "Super Log"
cGetBases :: Canon -> [Canon] Source #
Return the list of bases from a Canon (conceptually of the form [b^e]).
cGetBasesDeep :: Canon -> [Canon] Source #
This is similar to cGetBases except that it will do trial factoring of any hyper sums. i So, for obvious reasons, this is not a complete factorization.
cGetExponents :: Canon -> [Canon] Source #
Return the list of exponents from a Canon (conceptually of the form [b^e]).
cGetElements :: Canon -> [CanonElement] Source #
Return the list of CanonElements from a Canon (conceptually of the form [b^e]).
cNumDivisors :: Canon -> Canon Source #
Note: Divisor count function(s) should be called with integral Canons. Restricted to positive divisors. Returns Either String Canon
cTau :: Canon -> Canon Source #
Note: Divisor count function(s) should be called with integral Canons. Restricted to positive divisors. Returns Either String Canon
cDivisors :: Canon -> Either String [Canon] Source #
Efficiently compute all of the divisors based on the canonical representation. Returns either an error message or a list of Canons.
cNthDivisor :: Canon -> Canon -> Either String Canon Source #
Compute the nth divisor of a Canon. It operates on the absolute value of the Canon and is zero based. Note: This is deterministic but it's not ordered by the value of the divisor.
cWhichDivisor :: Canon -> Canon -> Either String Canon Source #
Consider this to be the inverse of the cNthDivisor function. This function ignores signs but both parameters must be integral.
cRelativelyPrime :: Canon -> Canon -> Maybe Bool Source #
This will determine if two arbitary expressions are relatively prime or not (if possible). Goes deep.
cGetFirstNDivisors :: Int -> Canon -> Either String [Canon] Source #
Return the first N divisors of a hyper expression (if possible)
CycloMap is a newtype hiding the details of a map of CR_ to pairs of integers and corresponding cyclotomic polynomials.
getIntegerBasedCycloMap :: CycloMap -> Map Integer CycloPair Source #
Unwrap the CycloMap and convert the internal canon rep keys to Integers, returning a "raw" map
crCycloInitMap :: CycloMap Source #
This is an initial map with the cyclotomic polynomials for 1.