make a `lib/math` dir
add r-precision to performance eval
break `avg` out into its own function