Skip to content

Commit 478848b

Browse files
committed
not not use -DUSE_POW_LOOKUP, actually faster to just use pow()
1 parent 6f989d3 commit 478848b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/common.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ CFLAGS = $(OPTFLAGS) $(WARNFLAGS)
3939
# Use the Random123 library
4040
CPPFLAGS = -DUSE_RANDOM123 -IRandom123-1.09/include
4141

42+
## Use lookup table for pow()
43+
#CPPFLAGS += -DUSE_POW_LOOKUP
44+
4245
# Using the uthash hash table
4346
# See https://troydhanson.github.io/uthash/userguide.html
4447
# and https://github.com/troydhanson/uthash

src/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extern "C" {
9494
/* Integer power y of double x, may be faster than pow(x, y). x set in
9595
init_powtable(). Note CANNOT compile with -ffast-math on gcc as we
9696
depend on IEEE handling of NaN in changeStatisticsDirected.c */
97-
#define POWTABLE_SIZE 1000 /* number of entries in POW_TABLE */
97+
#define POWTABLE_SIZE 10000 /* number of entries in POW_TABLE */
9898
#define POW_LOOKUP(x, y) ((y) < POWTABLE_SIZE ? POWTABLE[(y)] : pow((x), (y)))
9999
#else
100100
#define POW_LOOKUP(x, y) (pow((x), (y)))

0 commit comments

Comments
 (0)