Short answer : do not tear off tails of normal distribution.
. , 1 [0,1]. :

, , , , . .
, [0,1], :

, wolfram alpha.
, :
#include <iostream>
#include <random>
using namespace std;
static std::random_device __randomDevice;
static std::mt19937 __randomGen(__randomDevice());
static std::normal_distribution<float> __normalDistribution(0.5, 1);
inline float GetNormDistrFloat()
{
float val = -1;
do { val = __normalDistribution(__randomGen); }
while(val < 0.0f || val > 1.0f);
return val;
}
int main() {
int count1=0;
int count2=0;
int count3=0;
int count4=0;
for (int i =0; i< 1000000; i++) {
float val = GetNormDistrFloat();
if (val<0.25){ count1++; continue;}
if (val<0.5){ count2++; continue;}
if (val<0.75){ count3++; continue;}
if (val<1){ count4++; continue;}
}
std::cout<<count1<<", "<<count2<<", "<<count3<<", "<<count4<<std::endl;
return 0;
}
: 0,1 : 16072 : 0
241395, 258131, 258275, 242199
( Caleth): () 1/(1 + exp (-x)), (-∞, + ∞) [ 0,1]. , .
: , , , , . 0 1, [0,1]
, , +/- 4 . , 1, . .
1, ( 4 ..), , [0,1]
, :
val = NormalRand(0,1);
if abs(val) < 4 return val/8 + 0.5
else return UniformRand(0,1)
( interjay): .