Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions estimator/lwe_primal.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def svp_dimension(cls, r, D):
:param r: squared Gram-Schmidt norms

"""
from math import lgamma, log, exp, pi
from math import lgamma, exp, pi, log as math_log

def ball_log_vol(n):
return (n / 2.0) * log(pi) - lgamma(n / 2.0 + 1)
Expand All @@ -299,7 +299,13 @@ def gaussian_heuristic_log_input(r):
return exp(log_gh)

d = len(r)
r = [log(x) for x in r]

try:
r = [math_log(x) for x in r]

except ValueError:
# use slower one when the above crashes due to small values
r = [log(x) for x in r]

if d > 4096:
for i, _ in enumerate(r):
Expand Down
Loading