Created
October 12, 2022 03:05
-
-
Save galenseilis/6400a277fc23640541ff1dccd1d613b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import exp, log1p | |
l1 = -3006 | |
l2 = -3012 | |
def logsum(l1, l2): | |
return max(l1, l2) + log1p(exp(-abs(l1-l2))) | |
print(logsum(l1, l2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment