shelley-spec-non-integral-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell98

Shelley.Spec.NonIntegral

Synopsis

Documentation

(***) :: (RealFrac a, Enum a, Show a) => a -> a -> a Source #

Exponentiation

exp' :: (RealFrac a, Show a) => a -> a Source #

ln' :: (RealFrac a, Enum a, Show a) => a -> a Source #

Compute natural logarithm via continued fraction, first splitting integral part and then using continued fractions approximation for `ln(1+x)`

findE :: RealFrac a => a -> a -> Integer Source #

find n with `e^n<=x<e^(n+1)`

splitLn :: (RealFrac a, Show a) => a -> (Integer, a) Source #

scaleExp :: RealFrac a => a -> (Integer, a) Source #

data CompareResult a Source #

Constructors

BELOW a Int 
ABOVE a Int 
MaxReached Int 

Instances

Instances details
Eq a => Eq (CompareResult a) Source # 
Instance details

Defined in Shelley.Spec.NonIntegral

Show a => Show (CompareResult a) Source # 
Instance details

Defined in Shelley.Spec.NonIntegral

taylorExpCmp :: RealFrac a => a -> a -> a -> CompareResult a Source #

Efficient way to compare the result of the Taylor expansion of the exponential function to a threshold value. Using error estimation one can stop early, once it's known the result will certainly be above or below the target value.