exponent -package:numeric-prelude

exponent corresponds to the second component of decodeFloat. exponent 0 = 0 and for finite nonzero x, exponent x = snd (decodeFloat x) + floatDigits x. If x is a finite floating-point number, it is equal in value to significand x * b ^^ exponent x, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values.
Scientific notation (e.g. 2.3e123).
An exponent is an exponent letter (E, D) and a signed integer.
Display in scientific notation, e.g. 1.234e-5
An exponent.
exponentiating n = iso (**n) (**recip n)
Note: This errors for n = 0
>>> au (_Wrapping Sum . from (exponentiating 2)) (foldMapOf each) (3,4) == 5
True
Construct a range which scales the second bound exponentially relative to the size parameter.
>>> bounds 0 $ exponential 1 512
(1,1)
>>> bounds 11 $ exponential 1 512
(1,2)
>>> bounds 22 $ exponential 1 512
(1,4)
>>> bounds 77 $ exponential 1 512
(1,128)
>>> bounds 88 $ exponential 1 512
(1,256)
>>> bounds 99 $ exponential 1 512
(1,512)
Construct a range which is scaled exponentially relative to the size parameter and uses the full range of a data type.
>>> bounds 0 (exponentialBounded :: Range Int8)
(0,0)
>>> bounds 50 (exponentialBounded :: Range Int8)
(-11,11)
>>> bounds 99 (exponentialBounded :: Range Int8)
(-128,127)
Construct a range which scales the second bound exponentially relative to the size parameter. This works the same as exponential, but for floating-point values.
>>> bounds 0 $ exponentialFloat 0 10
(0.0,0.0)
>>> bounds 50 $ exponentialFloat 0 10
(0.0,2.357035250656098)
>>> bounds 99 $ exponentialFloat 0 10
(0.0,10.0)
Construct a range which scales the bounds exponentially relative to the size parameter. This works the same as exponentialFrom, but for floating-point values.
>>> bounds 0 $ exponentialFloatFrom 0 (-10) 20
(0.0,0.0)
>>> bounds 50 $ exponentialFloatFrom 0 (-10) 20
(-2.357035250656098,3.6535836249197002)
>>> bounds 99 $ exponentialFloatFrom x (-10) 20
(-10.0,20.0)
Construct a range which scales the bounds exponentially relative to the size parameter.
>>> bounds 0 $ exponentialFrom 0 (-128) 512
(0,0)
>>> bounds 25 $ exponentialFrom 0 (-128) 512
(-2,4)
>>> bounds 50 $ exponentialFrom 0 (-128) 512
(-11,22)
>>> bounds 75 $ exponentialFrom 0 (-128) 512
(-39,112)
>>> bounds 99 $ exponentialFrom x (-128) 512
(-128,512)
Generate an exponentially distributed random variate.
Create an exponential distribution.
Create an exponential distribution.
Grow delay exponentially each iteration. Each delay will increase by a factor of two.
exponentiating n = iso (**n) (**recip n)
Note: This errors for n = 0
>>> au (coerced1 @Sum % re (exponentiating 2)) (foldMapOf each) (3,4) == 5
True
Tests the following properties: Note that this does not test associativity. Make sure to use semigroupLaws in addition to this set of laws.
A random variable which samples from the exponential distribution. exponential mu is an exponential random variable with mean mu. This can alternatively be viewed as an exponential random variable with parameter lambda = 1 / mu.