[Nickle] log is still (again?) deathly slow

Keith Packard nickle@nickle.org
Sat, 23 Nov 2002 16:46:41 -0800

Around 2 o'clock on Nov 23, Bart Massey wrote:

>   time nickle -e 'for (int i = 0; i < 10000; i++) log(0.05);'

The default mantissa (256) bits makes this rather slow.  Try a smaller 

$ time nickle -e 'for (int i = 0; i < 10000; i++) log(imprecise(0.05,50));'

real    0m1.511s
user    0m1.470s
sys     0m0.040s

$ time nickle -e 'for (int i = 0; i < 10000; i++) log(imprecise(0.05,100));'

real    0m8.803s
user    0m8.760s
sys     0m0.040s

Log is (currently) implemented as a polynomial kernel which yields 50 bits 
and newtons method which doubles precision each time around the loop, but 
that loop calls exp which is no speed daemon.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab