diff options
author | Katja <katjav@users.sourceforge.net> | 2011-11-13 15:18:49 +0000 |
---|---|---|
committer | Katja <katjav@users.sourceforge.net> | 2011-11-13 15:18:49 +0000 |
commit | cd623379e1527476011d48698ee5b73d3b48c845 (patch) | |
tree | 918c7ba74171ac0b883ac66de50431774a491106 /unittests/ead~subnormal-unittest.pd | |
parent | 6c7489ec9c879aa6fb93e69fc892b4a2847aa182 (diff) |
add unittest dir plus content to creb
svn path=/trunk/externals/creb/; revision=15736
Diffstat (limited to 'unittests/ead~subnormal-unittest.pd')
-rw-r--r-- | unittests/ead~subnormal-unittest.pd | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/unittests/ead~subnormal-unittest.pd b/unittests/ead~subnormal-unittest.pd new file mode 100644 index 0000000..ed33cea --- /dev/null +++ b/unittests/ead~subnormal-unittest.pd @@ -0,0 +1,196 @@ +#N canvas 444 35 680 522 10; +#X obj 55 118 bang~; +#X obj 40 150 snapshot~; +#X obj 40 24 bng 50 1000 50 0 empty empty empty 17 7 0 10 -262144 -260097 +-1; +#X obj 40 177 change; +#X obj 40 232 sel 0; +#X obj 40 258 f; +#X floatatom 62 303 17 0 0 0 - - -; +#X msg 134 27 \; pd dsp 1; +#X msg 204 27 \; pd dsp 1; +#X obj 134 -2 loadbang; +#X obj 114 354 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 47 354 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 40 330 moses 1e-46; +#N canvas 181 252 394 427 single 0; +#X obj 27 20 inlet; +#X msg 114 147 NORMAL \$1; +#X msg 25 293 UNIT-TEST-DONE; +#X obj 26 390 print unit-test; +#X obj 54 364 stdout; +#X obj 134 390 outlet; +#X obj 25 247 t b a; +#X obj 53 328 list trim; +#X obj 25 215 pack s f s; +#X obj 81 187 r \$0-classname; +#X msg 26 147 SUBNORMAL \$1; +#X obj 26 113 moses; +#X msg 76 47 2; +#X floatatom 76 115 15 0 0 0 - - -; +#X obj 75 19 loadbang; +#X obj 76 77 pow -126; +#X text 176 116 smallest normal value for float; +#X msg 135 356 set \$1 \$2 \$3; +#X connect 0 0 11 0; +#X connect 1 0 8 0; +#X connect 2 0 3 0; +#X connect 2 0 4 0; +#X connect 6 0 2 0; +#X connect 6 1 17 0; +#X connect 6 1 7 0; +#X connect 7 0 3 0; +#X connect 7 0 4 0; +#X connect 8 0 6 0; +#X connect 9 0 8 2; +#X connect 10 0 8 0; +#X connect 11 0 10 0; +#X connect 11 1 1 0; +#X connect 12 0 15 0; +#X connect 14 0 12 0; +#X connect 15 0 13 0; +#X connect 15 0 11 1; +#X connect 17 0 5 0; +#X restore 104 378 pd single; +#N canvas 101 191 396 411 double 0; +#X obj 26 13 inlet; +#X msg 24 279 UNIT-TEST-DONE; +#X obj 25 366 print unit-test; +#X obj 52 339 stdout; +#X obj 131 366 outlet; +#X obj 25 241 t b a; +#X msg 180 150 NORMAL \$1; +#X obj 53 308 list trim; +#X obj 25 217 pack s f s; +#X obj 82 187 r \$0-classname; +#X msg 26 149 SUBNORMAL \$1; +#X obj 26 116 moses; +#X msg 73 43 2; +#X obj 72 15 loadbang; +#X obj 73 76 pow -1022; +#X floatatom 72 117 15 0 0 0 - - -; +#X text 175 116 smallest bnormal value for double; +#X msg 131 331 set \$1 \$2 \$3; +#X connect 0 0 11 0; +#X connect 1 0 3 0; +#X connect 1 0 2 0; +#X connect 5 0 1 0; +#X connect 5 1 17 0; +#X connect 5 1 7 0; +#X connect 6 0 8 0; +#X connect 7 0 2 0; +#X connect 7 0 3 0; +#X connect 8 0 5 0; +#X connect 9 0 8 2; +#X connect 10 0 8 0; +#X connect 11 0 10 0; +#X connect 11 1 6 0; +#X connect 12 0 14 0; +#X connect 13 0 12 0; +#X connect 14 0 11 1; +#X connect 14 0 15 0; +#X connect 17 0 4 0; +#X restore 40 378 pd double; +#X msg 40 413 SUBNORMAL 2.2114198411132e-308; +#X text 134 92 exponential decay; +#X text 302 6 [creb/ead~] checks for subnormals once per signal block. +Therefore \, subnormals do happen when the curve approaches zero \, +but only for a short period of time (depending on blocksize).; +#X obj 40 92 creb/ead~ 0 15; +#X text 64 281 smallest non-zero number seen by [snapshot~]; +#X text 301 74 In this patch we test if the subnormals-flush routine +works as expected. Open [pd more] to see how small subnormals can go +for a given precision.; +#X msg 345 358 ead~; +#X obj 345 411 s \$0-classname; +#X obj 345 383 symbol; +#X obj 346 333 loadbang; +#X obj 457 211 s \$0-smallnumbers; +#X msg 456 179 arrayviewlistnew; +#X obj 455 250 table \$0-smallnumbers 10000; +#N canvas 626 222 402 246 write 0; +#X obj 27 38 inlet; +#X obj 25 198 tabwrite \$0-smallnumbers; +#X obj 26 91 t f b; +#X obj 54 132 f; +#X obj 85 132 + 1; +#X obj 132 35 inlet; +#X msg 132 89 const 0; +#X msg 70 94 0; +#X obj 133 133 s \$0-smallnumbers; +#X msg 188 89 arrayviewclose; +#X connect 0 0 2 0; +#X connect 2 0 1 0; +#X connect 2 1 3 0; +#X connect 3 0 4 0; +#X connect 3 0 1 1; +#X connect 4 0 3 1; +#X connect 5 0 6 0; +#X connect 5 0 7 0; +#X connect 5 0 9 0; +#X connect 6 0 8 0; +#X connect 7 0 3 1; +#X connect 9 0 8 0; +#X restore 82 258 pd write; +#X obj 40 203 abs; +#N canvas 683 194 435 442 more 0; +#X msg 39 359 2; +#X floatatom 39 413 15 0 0 0 - - -; +#X obj 39 330 t b f; +#X msg 38 46 2; +#X floatatom 55 99 15 0 0 0 - - -; +#X obj 38 385 pow; +#X obj 37 18 loadbang; +#X floatatom 38 306 5 0 0 0 - - -; +#X floatatom 40 155 15 0 0 0 - - -; +#X text 36 254 check how small a non-zero value can be represented +; +#X text 37 184 Some CPU architectures support denormal numbers by default. +Repeated calculation of subnormal numbers can happen in recursive filters +\, feedback delay lines \, reverb simulators etc. This slows down calculation +considerably.; +#X obj 54 71 pow -126; +#X obj 39 126 pow -1022; +#X text 143 154 smallest bnormal value for double; +#X msg 39 277 -127; +#X msg 82 276 -1023; +#X text 156 98 smallest normal value for float; +#X connect 0 0 5 0; +#X connect 2 0 0 0; +#X connect 2 1 5 1; +#X connect 3 0 11 0; +#X connect 3 0 12 0; +#X connect 5 0 1 0; +#X connect 6 0 3 0; +#X connect 7 0 2 0; +#X connect 11 0 4 0; +#X connect 12 0 8 0; +#X connect 14 0 7 0; +#X connect 15 0 7 0; +#X restore 307 142 pd more; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 2 0 18 0; +#X connect 2 0 28 1; +#X connect 3 0 29 0; +#X connect 4 0 5 0; +#X connect 4 1 5 1; +#X connect 4 1 28 0; +#X connect 5 0 6 0; +#X connect 5 0 12 0; +#X connect 9 0 7 0; +#X connect 9 0 2 0; +#X connect 12 0 11 0; +#X connect 12 0 14 0; +#X connect 12 1 10 0; +#X connect 12 1 13 0; +#X connect 13 0 15 0; +#X connect 14 0 15 0; +#X connect 18 0 1 0; +#X connect 21 0 23 0; +#X connect 23 0 22 0; +#X connect 24 0 21 0; +#X connect 26 0 25 0; +#X connect 29 0 4 0; |