2009-09-24 23:11:23 -04:00
|
|
|
! Copyright (C) 2009 Doug Coleman.
|
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
|
USING: kernel math math.combinatorics math.ranges sequences ;
|
|
|
|
|
IN: benchmark.e-ratios
|
|
|
|
|
|
|
|
|
|
: calculate-e-ratios ( n -- e )
|
2009-10-29 15:34:04 -04:00
|
|
|
iota [ factorial recip ] map-sum ;
|
2009-09-24 23:11:23 -04:00
|
|
|
|
|
|
|
|
: calculate-e-ratios-benchmark ( -- )
|
|
|
|
|
5 [ 300 calculate-e-ratios drop ] times ;
|
|
|
|
|
|
|
|
|
|
MAIN: calculate-e-ratios-benchmark
|