Normally-distributed random numbers.
More...
#include <stdint.h>
#include <stdbool.h>
#include <stdfix.h>
#include "stdfix-full-iso.h"
#include "assert.h"
Go to the source code of this file.
|
#define | norminv_fx(f) |
| This function takes a uniformly distributed PRNG value, f , and returns a normally distributed s1615 PRNG.
|
|
|
int | __norminv_rbits (int x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed s16.15 in int representation.
|
|
static int | __norminv_t_bits (int x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed 16-bit PRNG in int representation.
|
|
static int | __norminv_b_bits (int x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed 16-bit PRNG in int representation.
|
|
static s1615 | norminv_urb (unsigned int x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed s1615 PRNG.
|
|
static s1615 | norminv_urt (unsigned int x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed s1615 PRNG.
|
|
static s1615 | norminv_ur (u016 x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed s1615 PRNG.
|
|
s1615 | norminv_ulr (u032 x) |
| This function takes a uniformly distributed 16-bit PRNG value, x , and returns a normally distributed s1615 PRNG.
|
|
Normally-distributed random numbers.
◆ norminv_fx
Value: _Generic((f), \
default: __builtin_trap() \
)
s1615 norminv_ulr(u032 x)
This function takes a uniformly distributed 16-bit PRNG value, x, and returns a normally distributed ...
static s1615 norminv_ur(u016 x)
This function takes a uniformly distributed 16-bit PRNG value, x, and returns a normally distributed ...
Definition normal.h:91
unsigned fract u016
An alternative name for the unsigned fract type.
Definition stdfix-full-iso.h:193
unsigned long fract u032
An alternative name for the unsigned long fract type.
Definition stdfix-full-iso.h:196
This function takes a uniformly distributed PRNG value, f
, and returns a normally distributed s1615 PRNG.
- Parameters
-
[in] | f | A uniformly distributed unsigned u016 or u032. |
- Returns
- A normally distributed s1615 PRNG.
◆ __norminv_rbits()
int __norminv_rbits |
( |
int |
x | ) |
|
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed s16.15 in int
representation.
Given an 16-bit signed integer value, representing p - 0.5, return the cumulative normal value associated with that probability.
- Parameters
-
[in] | x | A uniformly distributed 16-bit PRNG, in the bottom 16 bits of x . |
- Returns
- A normally distributed int representation of an s16.15 PRNG.
◆ __norminv_t_bits()
static int __norminv_t_bits |
( |
int |
x | ) |
|
|
inlinestatic |
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed 16-bit PRNG in int
representation.
- Parameters
-
[in] | x | A uniformly distributed 16-bit PRNG, in the top 16 bits of x . |
- Returns
- A normally distributed int representation of an s16.15 PRNG.
◆ __norminv_b_bits()
static int __norminv_b_bits |
( |
int |
x | ) |
|
|
inlinestatic |
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed 16-bit PRNG in int
representation.
- Parameters
-
[in] | x | A uniformly distributed 16-bit PRNG, in the bottom 16 bits of x . |
- Returns
- A normally distributed int representation of an s16.15 PRNG.
◆ norminv_urb()
static s1615 norminv_urb |
( |
unsigned int |
x | ) |
|
|
inlinestatic |
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed s1615 PRNG.
- Parameters
-
[in] | x | A uniformly distributed 16-bit PRNG, in the bottom 16 bits of x . |
- Returns
- A normally distributed s1615 PRNG.
◆ norminv_urt()
static s1615 norminv_urt |
( |
unsigned int |
x | ) |
|
|
inlinestatic |
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed s1615 PRNG.
- Parameters
-
[in] | x | A uniformly distributed 16-bit PRNG, in the top 16 bits of x . |
- Returns
- A normally distributed s1615 PRNG.
◆ norminv_ur()
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed s1615 PRNG.
- Parameters
-
[in] | x | A uniformly distributed unsigned u016. |
- Returns
- A normally distributed s1615 PRNG.
◆ norminv_ulr()
This function takes a uniformly distributed 16-bit PRNG value, x
, and returns a normally distributed s1615 PRNG.
- Parameters
-
[in] | x | A uniformly distributed unsigned u032. |
- Returns
- A normally distributed s1615 PRNG.