# Documentation : Scilab is Not Naive Commit Details

Date: 2010-12-13 22:40:15 (8 years 1 month ago) Michael Baudin 26 25 Added difficult cases for Smith's algorithm.

## File differences

en_US/scripts/cdiv.dataset.csv
 170 170 171 171 172 172 173 173 174 174 175 175 176 ... ... 212 213 213 214 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 215 261
 0.100000000000000000000e301,0.999999999999999999996e-300,0.100000000000000000000e201,0.100000000000000000000e-199,0.999999999999999999991e100,-0.100000000000000000001e-299␊ #␊ # Cases where Smith produces an infinite real part.␊ # This is because the expression (+/-)a+b*r or b+(+/-)a*r overflows.␊ #␊ 1e308,1e308,1.e0 ,1.e0 ,1e308,0␊ 1e308,1e308,1.e1 ,1.e1 ,1e307,0␊ 1e308,1e308,1.e290,1.e290,1e18 ,0␊ 1e308,1e308,1.e300,1.e300,1e8 ,0␊ 1e308,1e308,1.e308,1.e308,1e0 ,0␊ #␊ # Case where Smith fails and produce zero.␊ # This is because the expressions c+d*r or d+c*r overflows.␊ #␊ 1e0 ,1e0 ,1.e308,1.e308,1e-308,0␊ 1e1 ,1e1 ,1.e308,1.e308,1e-307,0␊ 1e2 ,1e2 ,1.e308,1.e308,1e-306,0␊ 1e3 ,1e3 ,1.e308,1.e308,1e-305,0␊ 1e4 ,1e4 ,1.e308,1.e308,1e-304,0␊ 1e5 ,1e5 ,1.e308,1.e308,1e-303,0␊ 1e6 ,1e6 ,1.e308,1.e308,1e-302,0␊ 1e7 ,1e7 ,1.e308,1.e308,1e-301,0␊ 1e8 ,1e8 ,1.e308,1.e308,1e-300,0␊ 1e9 ,1e9 ,1.e308,1.e308,1e-299,0␊ 1e10 ,1e10 ,1.e308,1.e308,1e-298,0␊ 1e20 ,1e20 ,1.e308,1.e308,1e-288,0␊ 1e30 ,1e30 ,1.e308,1.e308,1e-278,0␊ 1e40 ,1e40 ,1.e308,1.e308,1e-268,0␊ 1e50 ,1e50 ,1.e308,1.e308,1e-258,0␊ 1e60 ,1e60 ,1.e308,1.e308,1e-248,0␊ 1e70 ,1e70 ,1.e308,1.e308,1e-238,0␊ 1e80 ,1e80 ,1.e308,1.e308,1e-228,0␊ 1e90 ,1e90 ,1.e308,1.e308,1e-218,0␊ 1e100,1e100,1.e308,1.e308,1e-208,0␊ 1e110,1e110,1.e308,1.e308,1e-198,0␊ 1e120,1e120,1.e308,1.e308,1e-188,0␊ 1e130,1e130,1.e308,1.e308,1e-178,0␊ 1e140,1e140,1.e308,1.e308,1e-168,0␊ 1e150,1e150,1.e308,1.e308,1e-158,0␊ 1e160,1e160,1.e308,1.e308,1e-148,0␊ 1e170,1e170,1.e308,1.e308,1e-138,0␊ 1e180,1e180,1.e308,1.e308,1e-128,0␊ 1e190,1e190,1.e308,1.e308,1e-118,0␊ 1e200,1e200,1.e308,1.e308,1e-108,0␊ 1e210,1e210,1.e308,1.e308,1e-98,0␊ 1e220,1e220,1.e308,1.e308,1e-88,0␊ 1e230,1e230,1.e308,1.e308,1e-78,0␊ 1e240,1e240,1.e308,1.e308,1e-68,0␊ 1e250,1e250,1.e308,1.e308,1e-58,0␊ 1e260,1e260,1.e308,1.e308,1e-48,0␊ 1e270,1e270,1.e308,1.e308,1e-38,0␊ 1e280,1e280,1.e308,1.e308,1e-28,0␊ 1e290,1e290,1.e308,1.e308,1e-18,0␊ 1e300,1e300,1.e308,1.e308,1e-8 ,0␊ 1e308,1e308,1.e308,1.e308,1e0 ,0␊ ␊
en_US/scripts/cdiv.tst
 35 35 36 36 37 37 38 39 40 38 41 39 42 40 43 ... ... 87 90 88 91 89 92 90 93 91 94 92 95 93 96 94 97 95 98 99 100 96 101 97 102 98 103
 // A Scilab port of the Li et al. improved Smith␊ exec("cdiv_smithLi.sci");␊ ␊ // An improved Smith, with ideas from Li et al.␊ exec("cdiv_smith5.sci");␊ ␊ exec("assert_computedigits.sci");␊ exec("assert_datasetread.sci");␊ ␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_naive , "Na" , ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith , "Sm" , ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith2 , "S2" , ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith3 , "S3" , ", " );␊ //msg = msg + fmtdig ( x , y , expectedR , cdiv_smith3 , "S3" , ", " );␊ if ( haveimproved ) then␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith4 , "S4" , ", " );␊ end␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_ansiisoC , "AC", ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smithLi , "Li" , "" );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smithLi , "Li" , ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith5 , "S5" , ", " );␊ msg = msg + fmtdig ( x , y , expectedR , cdiv_smith5 , "S6" , "" );␊ mprintf("%s\n",msg);␊ end␊ ␊

Revision: 26