Skip to content

Commit

Permalink
BENCH: add benchmark for special.expn in the large n regime
Browse files Browse the repository at this point in the history
  • Loading branch information
person142 committed Sep 11, 2016
1 parent fd7af6d commit 7980b87
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion benchmarks/benchmarks/special.py
Expand Up @@ -3,7 +3,7 @@
import numpy as np

try:
from scipy.special import ai_zeros, bi_zeros, erf
from scipy.special import ai_zeros, bi_zeros, erf, expn
except ImportError:
pass

Expand Down Expand Up @@ -64,3 +64,14 @@ def setup(self):

def time_loggamma_asymptotic(self):
loggamma(self.large_z)


class Expn(Benchmark):

def setup(self):
n, x = np.arange(50, 500), np.logspace(0, 20, 100)
n, x = np.meshgrid(n, x)
self.n, self.x = n, x

def time_expn_large_n(self):
expn(self.n, self.x)

0 comments on commit 7980b87

Please sign in to comment.