module fakerandom;

import std.stdio;
import std.math;
import std.regex;
import std.getopt;
import std.bitmanip;
import std.typecons;
import std.conv;
import std.string;
import std.range;
import std.algorithm;

import std.random;

alias sample = real;


/// ratio of uniforms method to draw a N(0,1) sample; at least about that
sample standardNormal() {
    static ulong idx;
    static immutable sample[] random_pool
        = [
-0.8613371042, -1.2152140792, 0.6574786671, -0.4640356770, -0.8713018325,
-0.4879535488, -0.1917847576, -3.8797443145, 0.8505821033, 0.7321797453,
-0.7440139341, 0.8329394503, -0.0850140388, 0.1760250646, 0.4847923854,
-0.9546748500, 0.5689554053, 1.5959785066, 0.6786110236, -2.1881780776,
1.2036251439, -0.7321746050, -1.7958431025, -1.8409033017, -0.4233453132,
0.6668315543, 0.1663959038, 0.9057354977, 1.3509549498, -1.0361913592,
-1.4691373388, -1.0680766577, 1.8595930047, 0.9465910270, 0.2926228451,
-1.1066912032, 0.4244801452, -0.0125941027, -1.4935966176, -0.6173697125,
1.0628772437, -0.8560034356, 0.4760744022, -1.4889066535, -1.1168347224,
0.9391822305, 0.9067794649, 0.6645300219, -0.1641734672, 0.3782597911,
-1.6585178033, 1.5840172148, -1.1022906333, -0.0202972795, -0.1582524272,
-1.5501689824, 0.7192092391, 1.6504760972, -1.2164186120, -1.9514178207,
0.9475537932, -0.9342872581, 3.1202387299, -1.2216875145, -0.5701209541,
0.4029754528, -0.5713697955, 1.0792875857, -0.5244413726, -0.1706340373,
-0.3504228498, -0.0056784094, -0.0395737227, -0.3326044021, 0.7193177015,
-0.4600304872, 0.0720958606, 1.4135008488, -0.4272870663, 3.0596041391,
-1.9786393861, -1.0618624805, -0.0579460649, 0.0839460818, 2.1165990185,
1.5649364437, 0.5724059440, 0.4170976496, 0.9765770120, -0.1354011806,
1.3930494079, 0.3875763423, -0.2682592499, -0.2195051220, -0.0387072430,
2.3385127793, 0.1707235655, -0.8896230776, 0.1783853792, -0.6941273077,
-1.5809412685, -2.2596021382, 0.3439714490, -0.9607237147, -0.5967286249,
2.3593502248, 0.6969426624, -0.8068447753, -0.0431685757, -0.7252063167,
-0.1006822584, -0.0525261777, 1.1192142529, 0.1595723742, -0.8231999105,
1.4646441903, 0.9032072074, -0.5019111973, 0.8297307591, -1.7738001608,
1.0953391842, 1.8841059875, 1.1640260558, 2.0973337339, -0.4520834520,
0.5120642054, 0.6818994713, 0.3514147818, -0.7752840251, -0.2996926440,
0.0496184159, -0.6294223916, 1.0278333895, 0.0819700175, -2.9457739743,
1.6580149691, 1.2146150725, 0.9358040060, -0.5837418994, 0.4513744773,
-1.6387176946, -2.0399054923, -0.4779163940, -0.3576259347, -1.3805611562,
-0.7519405628, -0.3389060562, -0.0441211978, -1.0209779407, -0.3721454089,
0.8291890540, -0.4160183541, -1.2267648519, -0.7025506370, 0.0642664252,
-0.5518792637, 0.9954626588, -0.4863756383, -0.6118111435, 2.2766360513,
-0.2621228977, -0.7075424695, -0.0685477848, -0.7859983543, -0.0572984670,
1.9193121367, -0.2867486697, -1.2194526147, -0.8678232309, 1.7284085182,
0.3137824481, 0.1695877243, -0.5685718387, 0.8688377337, 1.8275477702,
-0.1201281660, 0.7445570136, 0.7640219281, 1.4314755404, -0.1931913666,
-0.9678817132, 0.8873463709, -1.3378646095, 0.7410242460, -1.0946851411,
1.2336118132, 0.4423713590, -1.1066693363, 1.3459523133, -0.8267831946,
-0.6779525345, 2.1408344773, -0.1810508416, 0.8595999683, -0.7540712374,
1.3414411426, -0.7894603818, -0.7057358324, 1.2505187969, 0.5049982764,
-0.8699126066, -0.1478186654, 1.8485060759, 2.3846033836, -0.3692212742,
-0.1580786265, 1.6651467483, -0.5820096440, -0.2751389518, 0.2729400931,
0.9594570191, 0.6632685725, 2.7678938750, 1.0775705137, 0.2339616267,
0.2511816208, -0.8458071222, 0.0409922417, 0.8454993850, 0.7103585003,
0.3034912322, 0.7114178399, -1.1769447261, -1.8478100896, -1.4211874247,
-0.6803420820, 0.5403921270, 1.1126666246, -0.6934593255, -1.6452313690,
-1.0640047092, -0.2760004889, -2.0797590081, -0.4363021566, 0.9862974587,
1.1703321392, 0.3645852294, 0.3530141697, -0.5479157399, -0.0034950861,
-0.2887987741, 0.7606804056, 0.9565411947, -0.1839800695, -0.0619371499,
-0.2953458299, -1.9416251089, 0.0612525612, 0.3273777487, 0.0371154634,
0.3232877802, 0.0442875469, 0.0219067455, -0.2082919470, 2.1545986196,
1.5564877163, -2.3872636145, -0.0023026622, -1.2414923932, -0.4220145927,
0.7999670711, 0.8393569175, -0.3219019986, 0.0089439785, 2.0540214002,
-0.6087833508, -2.2624605213, -2.6812011617, -0.4729448321, 1.3476347493,
1.0564459828, 0.0638712742, 1.0724361217, 0.8902611307, -0.5171707057,
0.6511733494, 0.8473575628, -1.5751912660, 0.6959370715, 1.1445135791,
-0.7907239815, -0.3589764743, -0.4653918063, 0.1917427774, 2.2843512928,
-1.6488283643, -1.3911115518, -1.4938605990, -1.5327317920, 1.5868562878,
0.9475263982, -1.4565620846, -0.8600873176, 1.7950368785, 2.6458393211,
0.0157666787, -0.4005576717, -0.6332823412, 1.5476892163, 1.4097419084,
1.0402966016, -0.4489001032, -0.8677056175, 1.4086232348, -0.5415095679,
-0.3663909052, -1.1399595119, 1.9373732884, 1.9406004601, -0.9908896530,
1.1304472585, -0.6520633869, -1.4928249047, 1.4613452836, 1.7614332151,
0.2654057710, 0.8964293352, -0.9681597988, -0.5940785899, -0.6395134394,
-1.5835959246, -0.0681932256, -0.2447476364, 1.2234229031, 1.1903413116,
0.0365278372, -1.6008288053, -0.4232969528, -0.0248517930, -1.0957798074,
-0.1721439807, 1.6735668454, 0.1502177339, -0.0926900423, -1.1712691366,
-0.0025267634, -1.0410409915, 0.0172455572, -0.0335987145, -1.4656083344,
0.1035557124, -0.9720886284, -0.0538378250, -0.4917312488, -0.9263320642,
-0.0629214295, -0.4089910470, 0.0150246120, -2.2541244300, -0.5774900844,
-1.1304368613, -0.9835704100, 0.4373180756, 0.3631169385, -1.3920019650,
1.3093682362, -0.2948311863, 0.7961156883, -0.9990166236, -3.1952219685,
-0.8942290708, -0.3842282855, 1.8663829838, -0.7071910298, 1.3845791729,
-0.0642600335, 1.2315669790, -0.1700891991, 0.8816432837, 0.5386214545,
0.7726917526, 0.5651374303, 0.7261534101, -0.5322735869, 0.3182013549,
-1.2755394338, 0.2712065893, -0.3930607212, 0.4585850866, -0.6086421767,
0.0028477300, -0.8270784712, -1.4601810313, 0.3048821079, 1.5072683824,
0.6622163549, 1.9620508788, -1.1495266724, 0.0097485207, 1.7423756380,
1.4162849326, -0.6463566297, -0.3818413350, 0.7452558276, 0.2875114885,
-2.9978770401, -0.4491738516, -0.0007601420, 0.2388051777, 0.0163520096,
-1.6123947286, -1.2740310489, 0.6318833310, 0.0845635419, 0.4422189584,
-2.1417427992, 1.1518853840, 0.3517596569, -0.1181052207, 1.8289607593,
-0.2145775819, -0.3283459878, 1.2105254987, -0.7936972673, 1.3083094309,
-1.2533190868, 0.4484364679, -0.6056477283, 0.0416321774, 2.8306741915,
0.1920999998, 0.2869103493, 0.4882330936, -0.8149431351, -0.7169853436,
-0.6867745189, 0.7597585068, 1.2393584212, 0.6013269442, -1.1118254908,
-0.7128085707, 0.4830371312, -0.1068525856, 1.1472272779, 0.7354826150,
-0.2050101020, -1.1662384711, -0.6936536888, 0.3348740452, 0.6589063114,
-1.4449743330, 0.3375043536, -0.0627413764, -0.9494205633, 1.2813673812,
-2.2429891402, -0.4870036675, -0.8244251264, -1.2104786451, -1.2416838197,
-0.2552491937, 0.8365270928, 1.6418805810, -0.0406154714, -0.3507805088,
-0.1888566646, 0.8764630720, -1.0967983925, -0.0301344158, 0.4263230958,
-0.5166922689, -1.9760871761, -0.0025165206, -0.4514646320, 1.1732666382,
-1.0562219109, -1.7285317522, 0.5901208117, -1.0480917988, 1.4238622024,
-1.7879149485, 2.3898054758, -0.4815974741, -1.3039435706, -0.6311230141,
1.2348390333, -0.5491819566, 1.0906396812, -0.4890406985, 1.1337239807,
-1.1029403940, 2.3359606916, -0.1296269948, 1.1419733644, 0.0488346728,
0.6665287266, 0.1575284930, -1.3559413686, -0.7660810483, -2.2109837131,
-0.5596183466, -0.6667053681, 1.7967932260, -0.1221387720, -0.9431185921,
0.4907344280, 0.9244999884, 0.3083365336, 0.1575857767, -0.7418101678,
2.0588913479, 0.3670183017, 0.1173789245, -0.6881645420, 3.0448377023,
0.4240890402, 1.4388836837, -0.4279996896, 0.4492825893, -0.6298693141,
0.5120989141, 2.6465768263, 1.1627733336, -0.3784221885, 0.7354641823,
-0.5586617778, 0.5451869725, 0.1636652163, 0.2078983879, -0.7459482623,
0.2776132601, -0.8721434043, 1.1397637031, 0.0037052292, -0.3277256587,
0.1772547126, 0.6786027784, 0.8138921517, -0.0831632344, -0.2221911435,
-1.7112329920, 0.1592215311, -1.0824830483, -1.9386513468, -0.4478886837,
0.3579996792, -0.8916327356, -0.2465800352, -0.5171107385, -0.4872453300,
0.0894131600, 0.0531513557, 0.3625425255, -1.0068531907, 0.6813048423,
0.0130530143, -0.4720583877, 2.5305732101, 1.5219295599, -2.0830739051,
0.9680990683, 0.7867369531, 0.7538654776, 1.5257826898, -0.9086146699,
-0.5928151491, -1.1033674079, 0.8858491620, -1.4734858983, -0.0324060339,
0.2472896775, 0.1707641784, -0.3266714806, 0.0042921720, -2.0256117276,
-1.7608899071, 1.1678828449, 0.4620619566, -0.6357760927, 0.4363323433,
0.3893088250, -0.8588835193, 0.7481822600, 2.2970227602, -1.1242285278,
0.1713313947, -0.9998784518, 0.6114562255, -0.8058873273, -1.3164074642,
-0.7703094758, -0.2736149382, 1.9975094932, -0.8525960270, 0.0466373516,
-1.5285214884, 0.5293205816, -2.3203792516, 1.2943605718, 0.3437572146,
1.0599881360, -0.6003803025, -0.6345372265, 1.0907299980, 0.1522048790,
-0.1832005275, -0.6652914129, -1.7913051665, -0.4234120884, 0.1058977252,
2.5292746071, -1.8618662572, -1.5060052497, 0.4900025776, 1.6313605035,
-0.6910096573, 0.1616411264, -0.7451162514, 0.9774369998, 0.0111470069,
1.4699244738, -0.0567343209, 0.2141388467, 1.0118597264, 0.1934271030,
-0.9562786208, -0.0747385572, -1.7957140980, 0.9652549443, 0.6775337348,
1.2303597680, 0.5572896626, 1.1230291360, -0.3923057949, -2.4720943031,
1.2126105270, -1.7735309857, 1.5767719793, 0.5068691576, -0.1193792884,
0.7018538961, 0.6962195573, 1.0842966772, 0.9584064555, -0.2278073250,
-0.4404608466, -0.8570339459, -0.1672899377, 0.3254942236, 0.2905931023,
-2.2064551837, -0.4268438363, 0.8398108536, 2.3270720023, -0.9152454765,
-2.0600600648, 0.7417623808, -0.8766173626, 0.6064663599, -0.3562753839,
-0.2159618297, 1.0521705700, 0.1246999858, -0.0572599349, 0.2658762993,
-1.3787175176, -0.4820216194, 0.7770029773, -0.6383771417, -0.9378077940,
-0.0006275213, 0.2917420072, -0.0760709222, -1.3729427101, 0.8324270988,
1.2176844920, -0.7283619921, -0.8051275629, -0.3610495447, 0.3189532047,
-0.0436148596, -1.9728262424, -0.3936539728, -0.4784738550, -0.3920239038,
1.1883154395, 0.3655150031, 1.0507539531, -0.4824601906, 0.0391696326,
0.5526467140, 1.0505220875, 0.4032127183, -1.3052686713, 0.6487473328,
-1.0861559453, -0.6397442314, 0.9211427302, -0.7323305095, -0.8762090737,
0.1972313007, 0.1619777379, -0.1356853433, 0.2560756217, -0.2630826229,
0.8952153889, 0.1052860968, 0.4733013102, 0.4297839361, -0.3408906647,
-1.8286995582, 2.5002304165, 0.4757359289, -0.1859535962, 0.5033669063,
-0.5572656180, 1.4644720579, 0.0127645245, -1.5510982298, -1.2670607584,
-0.2379508177, -1.2087026441, -0.6341219484, 0.3480244387, -0.0744611124,
0.4475611705, 1.0973217935, -2.0099477825, -0.5820987610, 1.6127286743,
0.9970485271, 0.6270594755, -0.9654642762, 0.2431589969, -0.8368054476,
0.0317592942, 0.2297771826, 0.3143754198, -0.2716179532, 0.2570802601,
2.2311462519, 1.3707995828, 0.3686127952, -0.1923181881, 0.8562887469,
-0.3453878602, 0.7828816312, -0.3169310478, -0.9632976215, -1.4415430751,
-0.4601571405, 1.4059454915, -1.0892568573, 1.6718165214, 1.0998173581,
0.9549748506, -1.3303737587, 3.1951564136, -0.1831398083, -1.2048580337,
1.2825416817, 0.1995226070, 0.6803797397, 1.3698014993, 1.5663935752,
1.1797689716, 0.6682427653, 1.4157926753, 0.0052331001, 1.6195300638,
-1.0477829893, 0.2703877419, 1.1457365793, -0.3158895890, 0.4578787487,
1.7508903342, 0.8109852953, 0.7655026518, -0.7885185082, 0.0354005225,
1.1684059894, 0.0826047976, -1.8161430172, -0.0198962718, 1.7264890332,
1.8041860032, -0.1828066220, -1.0281948277, -1.1436469069, 0.0577630470,
-0.4394336525, 1.7556586395, 0.4474302690, -0.7609365558, -0.7202360332,
0.6662147031, -0.1452338399, -0.9661590009, 1.7351244975, -0.0705135226,
0.4416168492, -1.5722977833, 0.0830799101, 0.6032351748, 0.1015807283,
-0.7080343518, -0.1495937872, -0.9504822006, 0.3710830218, 0.3048516243,
-1.8749847849, -0.1317588790, -1.5116970839, 0.6686255820, 0.7497837189,
-0.1652384883, 0.7828473721, 0.0848465657, 1.8701563883, -1.5522243967,
-0.5940884491, -0.0438858822, -0.2562245649, 0.2511842361, 0.5200070605,
-0.1135485397, 0.4971311973, -0.2028511909, -1.3992673938, -1.3421969641,
0.9270836222, -0.3516877203, 0.2048475983, 0.1565980159, 0.2097476813,
-0.1032694361, 0.7537512699, -1.0269697180, 0.5433153906, 0.6370121910,
-0.6339061840, 0.7668912038, 2.2996877154, 0.5818825970, -1.8384387258,
0.5920857067, -0.4677977879, -0.2554810698, 1.0813470716, -0.5339298452,
1.4547888431, 0.9707445734, -0.7546107776, 0.5463570052, 1.1486914988,
0.4145835328, 1.2615485839, 0.3866065608, 0.6466881261, -0.2759426312,
0.7057826094, 0.0048998517, -0.3575533442, -0.2044104923, -1.4047840443,
-0.0380714545, 0.8140258177, 1.3148456005, 1.1515522668, -0.0322427818,
1.5816443302, -1.9646395095, -0.6671953444, -0.9472015394, 0.0091526279,
-0.3396527246, 1.3165181671, 0.8788202529, -0.3628237045, 1.8710094208,
-0.1735922645, -0.5215976534, 0.4665644063, 0.2568102286, -0.0734365577,
-0.9572553382, 0.0921616535, -0.5303328578, -1.5018723459, -0.7858173881,
1.4303250517, 0.6738439550, -0.3092017170, 1.1783820228, 0.8977812156,
-0.4026939717, 0.5780848194, 0.2491861398, 0.8156083334, -0.2469147303,
-2.7627808000, 0.8411168088, 1.0097683016, -0.1053224079, -0.3348714994,
-2.8381209438, -1.4541939551, 1.9397276498, 1.2679715890, 0.0634957229,
-0.1160702923, -1.6145753915, -2.5205189378, 1.0102906880, 0.8512672941,
0.6653724619, -0.0660595373, -0.2610989547, -0.7758334396, -0.8763125745,
0.1867828781, 0.1455326739, 1.0073710735, 0.5457600771, -0.2674396747,
0.1334214414, -2.4966363601, 1.0417650550, -2.2508613780, -1.2896061734,
0.6136235064, -0.9690415780, -1.2473407167, 0.3825565607, 0.1433475221,
-0.7050745820, -2.5950371300, -1.4527272031, -0.3740869350, 0.8919002437,
-0.1228801978, -0.1863576386, 0.9843299739, 0.8706062852, 0.2361147686,
1.0024046548, 1.0707712462, -0.7583324923, 1.7719611234, -1.1715762447,
1.8067178193, 0.6584322184, 0.4490145940, 1.2894183893, 0.0901758245,
0.1385504980, 0.3525548904, -0.0091400049, -0.1726274833, 0.1066960392,
-0.0553622436, 2.0888705221, 0.1909080235, -0.4398480372, 1.6084732239,
0.3391685919, 0.4766498186, 0.6858063834, -1.7586351063, 0.1957091836,
-0.9496282516, 1.5152345487, 0.5009561975, 1.2076599092, -1.0933076756,
0.2114378570, -1.5840405500, 0.0517480986, -0.4977420694, -0.0326917087,
-0.1246314857, -0.8976847952, -1.2017885637, -0.4513658570, -1.8090565945,
1.1974862591, 2.2530479729, 1.5152007123, -0.8791972286, -0.6749626867,
-0.2944270964, 1.7987780247, -0.5858628277, -1.1520740763, 1.6855596209,
0.0570372425, -0.6368845228, -0.0491464326, -0.2009911857, 0.5407072032,
-0.1704422907, -0.2651852658, -1.7886508712, 0.7789323614, -0.5741410887,
0.9035730231, -0.4674522559, 1.3698878350, -0.5300309983, 0.5527975073,
-0.0625710944, 0.5829315156, 0.5448920913, -2.0061175172, -0.4425114562,
-2.0997049687, -0.7373859483, 0.7054106872, 1.1801653799, -0.5458333639,
-1.2787096179, 0.7535727225, 0.0960987248, -1.2049189733, -0.5068834226,
-0.3698878555, -0.5132878391, -0.4534499332, 0.3563404665, 0.4514086211,
1.2609346707, 1.1243130706, 1.6559367475, -0.3961237969, 1.1187242861,
-0.6474971445, 0.2007807254, -0.2241920161, -0.1634917891, -0.2988242918,
-0.1470121928, 1.0535724074, -0.6432491591, -3.4709134547, -1.0308440130,
-1.2823379540, -0.8070051593, 1.4720654742, -1.1965869409, 3.2881366115,
1.1226126332, -0.9946108053, -1.2133407160, 0.7503192341, -0.6910663705,
-0.8264709209, 1.4275377948, -0.5195074312, 0.3192659134, 1.8822445146,
-1.2810759740, -0.5431387398, -0.1324428850, 0.4793147992, 0.5695218496,
-0.0169606175, 0.6235330312, 0.4093630077, 0.8518216386, -0.7712180778,
0.1304525407, 0.3861030726, 1.5488948828, -0.0626817330, 1.3158741622,
-1.1664615688, 0.3470779609, -0.3338992853, -1.2728953283, 0.5488461596,
-1.4226931542, -0.4305162122, 1.5280178201, 2.2641071252, 1.7799716745,
-1.5273668900, -1.6837112074, -1.1170313067, -0.6396808230, -1.3649630501,
0.9455210095, -0.8812012852, 0.9598449925, 0.5358376854, -1.0334775048,
-0.6348824647, -0.4256936550, 1.2435505624, 0.6691913488, 0.8957069122,
-0.9175939427, -1.2507917780, 1.0647728144, 0.4447355742, 0.6316889320,
-0.4445948904, 1.2697200973, 0.0040796553, 0.0348492823, 0.0347681979,
-0.9395955003, -0.2511711253, 1.5063022050, -0.4815442336, -0.5113797110,
0.7433699673, 1.2408374316, 0.8548854656, 0.6177190206, 0.7812777040,
-2.3365510869, -0.9901122197, -1.6758786685, 0.4216818625, -1.6626989427,
1.9368122083, -1.4703585389, 0.8166036148, 0.7246761931, -0.5689235429,
-0.7328634446, 0.9934775160, 0.8109505377, 0.2375702341, 1.2597366752,
-0.5550426753, 1.0472219658, -0.2415684655, -0.1056817151, 0.3294818363,
0.8712701633, 0.7050708099, -1.1250908923, 1.4733275680, 0.7228420692,
-0.1861079788, -0.3432429247, 1.7961400694, 0.9734375192, 1.5357755095,
0.5532355355, 1.8667028179, -0.0708925572, 0.2450725945, 0.0367590710,
0.3327144511, -0.3957429343, 0.8199712845, -0.5292033082, -1.3610654674,
0.5482658982, 0.7054054058, -1.4032961158, -0.0300529422, -0.1116885384,
-0.0127762728, -1.1643275964, 0.7483702445, -0.7302196606, -0.1488531745,
1.1088610332, 1.6826011480, 0.0320777215, -1.4939929098, 1.6989822214,
-1.3902252110, 0.1625853614, -0.3419145580, 0.0460717039, -1.6811343237,
-0.5981924545, 1.6843401197, 0.5226189671, 1.3682976857, -0.6408152449,
0.9981941247, -0.0759715733, 1.4709012071, -1.1350112199, -0.3637825470,
-1.1156700521, -0.1582645507, -0.1591063757, 1.1486154831, 0.8201247436,
-1.2405253075, 1.1028834932, -1.8291242952, -0.2958674181, 1.2079097227,
0.5880454347, -1.0070408400, -0.3101769335, 0.2955504850, -0.8854026344,
1.2547419539, -0.2560884552, 0.4952725388, -0.0648948558, -1.1114013403,
-0.6461185920, -0.2631523638, 1.9608345389, -0.8354257839, -1.6298656631,
-1.6785734043, 1.6609631332, -0.8628867031, 0.2362579386, 1.8346035197,
0.7798257890, 0.6574997932, 0.4502700935, 0.5907652680, 1.3719058107,
0.8177720969, -0.7669234326, -0.5260913565, 0.4785773321, -0.7193370722,
-0.3974248588, -0.5260428907, 1.4928564777, 0.4109608400, -0.5472279384,
0.0018443998, -0.8584813173, 0.1350900733, -0.5795556770, 0.1531480348,
-1.5384133324, 1.3209486423, 0.8520005842, -1.3146949378, -0.2725246422,
0.9534261373, 1.4347243043, -0.3748449035, -0.3491703455, 0.1456271631,
1.0724791592, 0.6543531202, 0.2359997685, -1.3077070955, 1.6196293183,
-1.8685617291, 0.0617063043, 0.0281511951, 0.2526997559, -1.3058341117,
-0.0884640509, -1.9192216546, 1.3095841064, 0.5053371536, 0.1178970416,
0.1474484374, -0.9981395523, 1.5741467295, -0.0260434353, -1.2387100543,
1.5068338449, 0.2506459210, -0.5695032285, -0.8573898613, -1.0111981636,
0.8070981864, -1.2451454830, -0.5519301767, 0.7266059560, 0.0861595113,
0.3339966899, 1.2413474248, -0.4299512081, 0.4880488542, 0.3295555102,
0.1396837709, 0.4510296581, -0.1697298963, 0.4398252357, -0.6226270045,
-0.5729081688, -1.5728700563, -0.1590167975, -1.8360130359, -0.5444762511,
-0.6227634953, 0.4278682981, -0.6069428616, -0.0677583737, 1.3351459286,
-0.3455263562, 0.0101688723, 0.1675198607, 0.3252325608, 0.4308445502,
-1.5597611020, 0.9014475022, 0.4094009023, 1.1311889410, -0.0690059238,
1.5332914824, 1.7464346919, -2.4941243914, -3.2769860374, -2.1400262834,
1.1351116466, 0.0737451073, 0.8345226220, -0.2971143478, -0.0847194377,
0.2413998073, 0.1896294422, -2.2851256302, -1.3039470298, 0.0927262111,
1.6513264215, 0.4068589835, 0.9964531170, -0.8709629896, -1.1392782688,
-1.1487084153, -0.6116796648, 0.2534846051, 1.1364051994, -1.0982146216,
0.4862535352, 0.4833966927, 1.3338390827, 0.0168065296, 1.3982792094,
0.5724406058, 1.9276384437, -0.0708179884, 0.1364200507, 2.4572661791,
0.2319116078, -2.1202976556, -0.7300591131, -0.5487409107, 1.0287636821,
0.9553926317, -1.7757160442, 0.3769341345, 0.8533071206, -0.1082819718,
0.3089250440, 0.0984752694, -0.5160945418, 0.3753273572, -0.6570437129,
0.8655929329, -0.9990953843, -0.4675172179, -0.0895035819, 0.6697906951,
0.6079166443, 0.8699727475, 1.7011000771, -0.8090921991, 1.1005421251,
1.0894221541, 1.1847564695, 0.5931051539, 0.2568801902, -0.8144336417,
-0.5725443429, -1.3767860677, -0.3569246329, 0.3591560470, 0.5473823904,
-0.6964402505, -0.5009793995, 0.2881422790, 1.1858554450, -0.5578654505,
1.1039038993, 1.3151991805, -0.7798870406, 0.5828045882, -0.1734214504,
-0.2481227149, -1.7654194149, 0.9937123657, 1.4334047809, 0.5675577007,
0.1105432440, -0.1531836525, 0.0039301010, -1.2827250415, 0.5408141987,
-0.6713304548, -0.2872544767, -1.1455746369, 2.6221535020, -0.3567214378,
-1.6033337942, 0.8781296467, 0.2469091279, -1.6623760739, 1.1415530662,
-0.0783879552, -0.3673302458, 1.5220626916, 1.1083578492, -0.3383368880,
1.2379627403, -0.2434966511, -1.1333087145, 0.1713906899, 1.6318724462,
-1.5766229747, -0.2376870464, -1.7012001299, -0.6096972493, 0.7361526396,
-0.0899159592, -0.5655358861, 0.8593014869, -0.0999353146, 0.0772766978,
0.1986840473, 1.3529528435, -1.1512833814, 0.3265622025, -0.7810703581,
-0.4016313674, -0.1160384903, 0.1867113362, 0.0339749164, -1.3874549394,
-0.0456722436, -0.3651390766, 0.7581983931, 0.0823763840, -0.2648277501,
0.3635411092, 1.2446319047, 1.4064637230, -0.2358778483, 0.2703762628,
-0.3800551153, -0.4555124842, -0.1585649720, 0.1237674765, 0.3112417968,
0.0135750184, -0.5362014875, 1.9859631509, 0.5815074123, 1.0417025689,
0.1405946323, -0.1247502672, -0.7265072816, 0.3725047875, 0.6323516517,
-1.0212958803, -0.8313233525, -1.7506934039, 0.7108044247, -0.1082904989,
0.6634875470, -0.6110512834, -2.2940364748, -0.1858979712, -1.1350786747,
-0.6857909653, -1.2557057881, 0.8689537075, -1.2193654095, -0.2528862436,
-1.2371499670, -1.1740800925, 0.5583963955, -1.0987324191, -1.2911569449,
-0.6128420698, -0.8438140973, -0.4400667053, -2.3784742916, -1.3224821448,
-0.7121124590, -0.4013083624, 0.4325738519, -0.1630678761, -0.3211609066,
-0.4662844899, 1.5458124316, -0.3290180207, 0.7138422258, 0.6029488326,
0.3456623830, 0.9489987297, 1.5136693564, 0.4376775876, -0.1026690076,
0.6248315405, 1.0375616608, 0.3104542702, 0.5658284726, -0.1899942280,
0.4078520205, 3.7433608699, -1.6953078883, 1.4515665504, -1.3401011512,
0.3603638640, -0.1944518712, 0.5136053745, -0.0749581449, -0.4170786660,
0.7539824369, 1.9806980436, 0.2093463383, 0.8426862558, -0.0486701242,
-0.6196456143, 0.2906169268, -1.0782700537, -0.5607146485, 0.0962963132,
-0.6848867367, 0.0480500216, -1.8117270429, 0.2967814986, -1.2773338104,
-0.1996666522, -0.0247137415, -0.6318718251, -1.7708284145, -0.9534447514,
0.8786510474, -0.5300989621, -0.5062052966, 1.2964042464, 1.7006111769,
-2.3805197547, -0.2099768456, -0.1785280978, 0.0615695303, -2.0667291358,
-2.3534057374, 1.0878446872, 1.0098872764, -1.4509049621, -1.6740789647,
0.7788982156, -0.1921283948, 1.2809317714, 0.1598513667, -0.4693936687,
2.0283020974, 0.6845500885, -0.5023273130, 2.2001874101, -0.8618153778,
-0.8922084380, 1.7604949580, 0.3475623994, 0.4229725698, 0.1596083179,
-0.2325014394, -0.3809833713, 0.6235732060, -0.5029151214, 0.6294120467,
1.3680245600, 0.0866027405, -0.1469205431, 0.0690143702, -0.0819801419,
0.1407152161, 2.2307242629, -0.2754601336, 0.1024520383, 0.7296308649,
-0.2190787859, 0.7025736502, 1.0041958051, -1.1171666356, -1.0648255358,
-0.0377167120, -2.4565356699, 0.6052417360, 0.0211123799, 1.5062832023,
-0.5762794523, 0.6319192374, -2.6118517977, -0.4513875907, 1.0260683219,
0.5138120122, 1.0081450379, 0.6625612809, 1.2043064041, -0.6921861976,
-0.3267242278, 0.0705441114, -2.2020882110, 0.1875999344, 0.2863971891,
-0.5453566779, -0.3430416176, 1.0251425228, 0.7053888789, -0.2237993392,
0.0747493080, -0.9236307120, -0.7117784761, -1.3310908387, 0.4318827968,
0.9753773113, -0.6591012538, 0.7440618162, 0.9367692490, 2.6661967314,
0.8958188440, 2.2922503355, -1.1476140143, 1.2492986137, 0.9528884124,
-0.5452118142, 0.8333531496, -0.8965431762, -0.6254962634, -0.8122776061,
-1.7968856669, -0.0324762211, 0.0231058342, 0.2375998277, -0.9239746703,
-0.2770789527, -1.3034665858, 0.0112800794, 1.0450816021, -0.3801532178,
-0.3935892542, 0.1319550481, -0.0807616487, -0.7594759595, -1.2581632750,
0.5900230497, -1.2665219092, -1.2002712629, 0.8027741043, -0.1465378158,
1.9312291082, -0.8042836181, -0.6214089854, -1.2332302068, -0.4110507294,
-0.3570907487, 0.3624162131, 0.7294306073, 0.1439465593, -1.0432315043,
0.2018338050, -0.0917478676, 1.2751298768, -0.1465777878, 0.8682691110,
-2.2165802322, 0.7454941151, -1.5897263377, -0.3876142564, 2.0281041654,
-0.7612455880, -1.2691392357, -1.6795893850, 0.3626805592, -0.0084742176,
-1.0045589374, -0.0468524725, -1.8274782866, -1.0454204523, -1.4402311075,
-0.7340269012, 0.1603161092, -1.0928437569, -0.2052954985, -0.7478220986,
0.1253445101, 1.7497236681, -0.6913012335, -1.0780656934, 0.0766614511,
-0.0117248435, -0.4815901304, -0.3417489541, 0.0430803990, -0.4770341275,
-0.0225608111, -1.6018104931, 2.2663773934, -0.0217506726, 0.8813436372,
-0.2531391506, -0.4072358662, 0.2442252753, 1.0980356258, 1.1363796697,
1.1207359177, 0.0488213144, 0.3340034692, -1.7122986036, 0.9019169481,
0.4006180426, 1.0732681877, 2.4024290010, -0.2938126226, -2.6096121213,
-0.6710089040, 0.7074737210, -1.1632693792, 0.3304097806, -1.3440245920,
-0.8565574578, 1.0634859770, 0.8647153033, -0.4287748069, 0.3675889479,
0.5029577035, 0.6869159856, -0.5371727046, 0.3170519701, -1.2855448554,
0.4325599660, 0.3988069434, -0.8329306276, 0.6201299860, -0.8761127046,
-0.1196701566, -0.0527520956, 0.2288313601, -0.7631106866, -0.7423243199,
-1.5759497796, 0.6590301567, -1.9360394514, 1.1426565206, 1.3603537480,
-0.5811312877, 0.1217149922, 1.2175668263, 0.4613471705, 0.2881782011,
-2.2603104073, -0.7251671810, -0.1498478814, -0.3725542783, 0.3868176962,
1.0997841952, 0.1600233702, 1.5442370390, 0.0458345778, 1.1262610190];
    return random_pool[(idx++) % random_pool.length];
}

/// ratio of uniforms method to draw a N(0,1) sample; at least about that
sample standardNormal2() {
    try {
        sample x1 = uniform01();

        if (x1 == 0.)
            return 0.;
        if (x1 > 1.)
            return 0.;

        sample x2 = uniform01();

        return sqrt(-2. * log(x1)) * cos(6.283185307179 * x2);
    }
    catch (Throwable all) {
        writeln("standardNormal: Error ", all);
        return 0.;
    }
}
