canon-0.1.0.0: Massive Number Arithmetic

Copyright(c) 2015-2018 Frederick Schneider
LicenseMIT
MaintainerFrederick Schneider <frederick.schneider2011@gmail.com>
StabilityProvisional
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Canon

Description

A Canon is an exponentation-based representation for arbitrarily massive numbers, including prime towers.

Synopsis

Documentation

makeCanon :: Integer -> Canon Source #

Create a Canon from an integer. This may involve expensive factorization.

makeC :: Integer -> Canon Source #

Shorthand for makeCanon

canonToGCR :: Canon -> GCR_ Source #

Functions to Convert Canon to Generalized Canon Rep

cToGCR :: 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).

cGCD :: Canon -> Canon -> Canon Source #

GCD and LCM functions for Canon

cLCM :: Canon -> Canon -> Canon Source #

GCD and LCM functions for Canon

cMod :: Canon -> Canon -> Canon Source #

Mod function

cOdd :: Canon -> Bool Source #

Check if a Canon is an odd integer. Note: If the Canon is not integral, return False

cTotient :: Canon -> CycloMap -> (Canon, CycloMap) Source #

Totient functions

cPhi :: Canon -> CycloMap -> (Canon, CycloMap) Source #

Totient functions

cLog :: Canon -> Rational Source #

Compute log as a Rational number.

cLogDouble :: Canon -> Double Source #

Compute log as a Double.

cNegative :: Canon -> Bool Source #

Functions to check if a canon is negative/positive

cPositive :: Canon -> Bool Source #

Functions to check if a canon is negative/positive

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

cDepth :: Canon -> Integer Source #

Determines the depth/height of maximum prime tower in the Canon.

cSplit :: Canon -> (Canon, Canon) Source #

Split a Canon into the numerator and denominator.

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?

cBare :: Canon -> Bool Source #

Checks if the Canon just a Bare Integer.

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.

cTetration :: Canon -> Integer -> CycloMap -> (Canon, CycloMap) Source #

Tetration function

cPentation :: Canon -> Integer -> CycloMap -> (Canon, CycloMap) Source #

Pentation Function

cHexation :: Canon -> Integer -> CycloMap -> (Canon, CycloMap) Source #

Hexation Function

cHyperOp :: Integer -> Canon -> Integer -> CycloMap -> (Canon, CycloMap) Source #

Generalized Hyperoperation Function

(>^) :: CanonRoot a b c => a -> b -> c infixr 9 Source #

Root operator

(<^) :: CanonExpnt a b c => a -> b -> c infixr 9 Source #

Exponentiation operator

(%) :: Integral a => a -> a -> a infixl 7 Source #

Mod operator

(<^>) :: 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 :)