@@ -11,7 +11,7 @@ DBL_MIN <- 2.22507385850720138309e-308 # Machine Epsilon
11
11
FLT_MIN <- 1.17549435e-38
12
12
height <- 3
13
13
EPS <- 2 ^- 53
14
- ffmt = " %.3e "
14
+ ffmt = " %.17e "
15
15
base_dir <- ' experiments/assoc/'
16
16
# Color Mappings:
17
17
# A modified https://colorbrewer2.org/#type=qualitative&scheme=Dark2
@@ -130,7 +130,7 @@ mu_distr <- function(d) {
130
130
}
131
131
robertazzi_bound <- function (n , d ) {
132
132
mu <- mu_distr(d )
133
- return ((1 / 3 ) * (mu / 2 )^ 2 * n ^ 3 * EPS ^ 2 * (1 / 12 ))
133
+ return ((1 / 3 ) * (mu )^ 2 * n ^ 3 * EPS ^ 2 * (1 / 12 ))
134
134
}
135
135
136
136
# ####################################################################
@@ -205,21 +205,29 @@ rora <- allr[allr$order == "Shuffle rand assoc",]
205
205
cat(sprintf(" *** %s ***\n " , distr ))
206
206
cat(sprintf(paste0(" min:\t " ,ffmt ," \n max:\t " ,ffmt ," \n canon:\t " ,ffmt ," \n mpfr:\t " ,ffmt ," \n " ),
207
207
min(allr $ fp_a ), max(allr $ fp_a ), canonical , mpfr_1000 ))
208
- cat(sprintf(paste0(" abs error:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora:\t " ,ffmt ," \n " ),
208
+ cat(sprintf(paste0(" mean abs error:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora: \t " , ffmt , " \n canon :\t " ,ffmt ," \n " ),
209
209
mean(abs(fora $ error_mpfr )),
210
210
mean(abs(rola $ error_mpfr )),
211
- mean(abs(rora $ error_mpfr ))))
211
+ mean(abs(rora $ error_mpfr )),
212
+ mean(abs(canonical - mpfr_1000 ))))
213
+ cat(sprintf(paste0(" max abs error:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora:\t " ,ffmt ," \n canon:\t " ,ffmt ," \n " ),
214
+ max(abs(fora $ error_mpfr )),
215
+ max(abs(rola $ error_mpfr )),
216
+ max(abs(rora $ error_mpfr )),
217
+ max(abs(canonical - mpfr_1000 ))))
212
218
cat(sprintf(paste0(" analy:\t " ,ffmt ," \n " ), analytical_abs_bound(veclen , distr )))
213
- cat(sprintf(paste0(" mean rel error:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora:\t " ,ffmt ," \n " ),
219
+ cat(sprintf(paste0(" mean rel error:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora:\t " ,ffmt ," \n canon: \t " , ffmt , " \ n" ),
214
220
mean(rel_err(fora ,mpfr_1000 )),
215
221
mean(rel_err(rola ,mpfr_1000 )),
216
- mean(rel_err(rora ,mpfr_1000 ))))
222
+ mean(rel_err(rora ,mpfr_1000 )),
223
+ mean(abs((canonical - mpfr_1000 )/ mpfr_1000 ))))
217
224
cat(sprintf(paste0(" max rel:\n fora:\t " ,ffmt ," \n rola:\t " ,ffmt ," \n rora:\t " ,ffmt ," \n " ),
218
225
max(rel_err(fora ,mpfr_1000 )),
219
226
max(rel_err(rola ,mpfr_1000 )),
220
227
max(rel_err(rora ,mpfr_1000 ))))
221
228
cat(sprintf(paste0(" sla:\t " ,ffmt ," \n " ), abs((canonical - mpfr_1000 )/ mpfr_1000 )))
222
- cat(sprintf(paste0(" analy:\t " ,ffmt ," \n " ), abs(analytical_abs_bound(veclen , x )/ mpfr_1000 )))
229
+ cat(sprintf(paste0(" analy:\t " ,ffmt ," \n " ), abs(analytical_abs_bound(veclen , distr )/ mpfr_1000 )))
230
+ cat(sprintf(paste0(" rober:\t " ,ffmt ," \n " ), robertazzi_bound(veclen , distr )))
223
231
cat(sprintf(" Unique:\n fora:\t %d\n rola:\t %d\n rora:\t %d\n " ,
224
232
length(unique(fora $ error_mpfr )), length(unique(rola $ error_mpfr )), length(unique(rora $ error_mpfr ))))
225
233
cat(sprintf(" Nonidentical (fora - rora): %d\n " , length(intersect(fora $ error_mpfr , rora $ error_mpfr ))))
0 commit comments