Skip to content

Commit

Permalink
Merge pull request #13 from MersenneTwister-Lab/avoid-double-transition
Browse files Browse the repository at this point in the history
Avoid double transition in tinymt32_generate_floatOC
  • Loading branch information
MSaito authored Sep 25, 2024
2 parents 0f05695 + c0996aa commit fabd141
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
60 changes: 30 additions & 30 deletions tinymt/check32.out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@ float numbers r, where 1.0 <= r < 2.0
1.2322005 1.3248408 1.6282554 1.6237093 1.9553823
1.2515985 1.2902025 1.8261194 1.7116343 1.0828516
float numbers r, where 0.0 < r <= 1.0
0.4334422 0.1254190 0.9491148 0.7561387 0.5671672
0.8243424 0.0393196 0.3985791 0.4224766 0.6121919
0.5195524 0.0341858 0.3006201 0.9415598 0.1908746
0.6455914 0.9965364 0.3110815 0.4033393 0.9034473
0.0202459 0.6251086 0.2076811 0.1991719 0.0160369
0.5703404 0.8151199 0.9348064 0.9298607 0.6834633
0.2357914 0.6382589 0.0393693 0.4783188 0.4688579
0.2675911 0.4227387 0.2752262 0.7581965 0.3906184
0.6015150 0.4173800 0.2261215 0.5006371 0.2059622
0.1784128 0.4403929 0.5902822 0.2307619 0.4184512
0.5059415 0.4334422 0.2916688 0.1254190 0.9642754
0.9491148 0.3184565 0.7561387 0.5250012 0.5671672
0.8671196 0.8243424 0.2261078 0.0393196 0.6735550
0.3985791 0.6557347 0.4224766 0.9904247 0.6121919
0.3421907 0.5195524 0.1240922 0.0341858 0.8125353
0.3006201 0.7078809 0.9415598 0.4075085 0.1908746
0.0857260 0.6455914 0.9701015 0.9965364 0.7802777
0.3110815 0.9830619 0.4033393 0.2131064 0.9034473
0.8109300 0.0202459 0.7181786 0.6251086 0.9327632
0.2076811 0.8886514 0.1991719 0.3343620 0.0160369
float numbers r, where 0.0 < r < 1.0
0.7539235 0.5481223 0.0172182 0.3837644 0.5756599
0.1929101 0.6351088 0.1388987 0.2030107 0.5359520
0.7981051 0.8822426 0.5865937 0.9584194 0.9073082
0.6073984 0.8127722 0.7480494 0.9829172 0.6296896
0.2040328 0.0169488 0.5349101 0.7498616 0.4206887
0.4468912 0.6781071 0.5027536 0.4000009 0.2352458
0.3784646 0.8087858 0.3579344 0.6030601 0.2197810
0.9718446 0.5287687 0.7941138 0.9504710 0.3413824
0.1003662 0.8295220 0.6224557 0.9157780 0.4195939
0.2126821 0.8094529 0.1176151 0.1643153 0.2755433
0.2879077 0.4296597 0.5092508 0.1848801 0.2880858
0.0651935 0.3751863 0.0701393 0.5690755 0.3165368
0.4965249 0.7642087 0.9641796 0.3617412 0.3523663
0.9606308 0.0167102 0.5216812 0.0030257 0.5311421
0.4574190 0.7324089 0.6944851 0.5772613 0.8115000
0.7247738 0.4804112 0.2418035 0.7592722 0.6093816
0.8261853 0.3984851 0.6038121 0.5826200 0.8501660
0.7738785 0.5165633 0.4993628 0.5390285 0.7940377
0.7773107 0.8215872 0.1287390 0.5596071 0.4022938
0.4097179 0.9490551 0.7692381 0.5208994 0.5815488
32-bit precision double numbers r, where 0.0 <= r < 1.0
0.4094066 0.4827545 0.5979867 0.2170185 0.8970369
0.6829838 0.3973019 0.2750306 0.1092794 0.8370101
0.6354089 0.5781288 0.7005250 0.2332346 0.8395586
0.3070853 0.3678428 0.6112665 0.9327284 0.7354169
0.5996112 0.7402635 0.1835579 0.5796655 0.9021798
0.7528325 0.0600313 0.4967926 0.1992569 0.6572806
0.9061203 0.4460495 0.3509606 0.9238296 0.5796654
0.6424482 0.9554131 0.5053623 0.9762550 0.5047233
0.6132142 0.2425692 0.9836005 0.5532928 0.4105124
0.5009801 0.8399252 0.7654016 0.6735107 0.8542220
0.7539236 0.5481222 0.0172183 0.3837643 0.5756599
0.1929102 0.6351089 0.1388986 0.2030107 0.5359519
0.7981051 0.8822425 0.5865937 0.9584195 0.9073083
0.6073984 0.8127721 0.7480494 0.9829171 0.6296897
0.2040328 0.0169487 0.5349101 0.7498615 0.4206887
0.4468912 0.6781071 0.5027536 0.4000009 0.2352459
0.3784646 0.8087857 0.3579345 0.6030602 0.2197811
0.9718446 0.5287687 0.7941138 0.9504710 0.3413823
0.1003661 0.8295220 0.6224558 0.9157780 0.4195939
0.2126820 0.8094530 0.1176150 0.1643152 0.2755433
1 change: 0 additions & 1 deletion tinymt/tinymt32.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ inline static float tinymt32_generate_float01(tinymt32_t * random) {
* @return floating point number r (0.0 < r <= 1.0)
*/
inline static float tinymt32_generate_floatOC(tinymt32_t * random) {
tinymt32_next_state(random);
return 1.0f - tinymt32_generate_float(random);
}

Expand Down

0 comments on commit fabd141

Please sign in to comment.