uniform#

Module for sampling uniformly from an interval.

Functions#

uniform_inverse_cdf()

Returns the value of inverse CDF of the uniform distribution from l to u.

uniform()

Returns a random floating point number between lower and upper.

uniform_inverse_cdf(l, u, p, prec)#

Returns the value of inverse CDF of the uniform distribution from l to u.

Parameters
  • l (float) – Lower bound for the uniform distribution.

  • u (float) – Upper bound for the uniform distribution.

  • p (tmlt.core.utils.arb.Arb) – Probability to compute the inverse CDF at.

  • prec (int) – Precision to compute the CDF with.

Return type

tmlt.core.utils.arb.Arb

uniform(lower, upper, step_size=63)#

Returns a random floating point number between lower and upper.

Parameters
  • lower (float) – Lower bound of interval to sample from.

  • upper (float) – Upper bound of interval to sample from.

  • step_size (int) – Number of bits to sampler per iteration.

Return type

float