Skip to content

Commit b62615b

Browse files
committed
expm1 unit test
1 parent 13b8574 commit b62615b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/pyadjoint/test_floats.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
import math
3+
import numpy as np
34
from numpy.testing import assert_approx_equal
45
from numpy.random import rand
56
from pyadjoint import *
@@ -155,7 +156,8 @@ def test_float_neg():
155156
assert rf2.derivative() == - 2.0
156157

157158

158-
def test_float_logexp():
159+
@pytest.mark.parametrize("exp", (exp, lambda x: 1 + np.expm1(x)))
160+
def test_float_logexp(exp):
159161
a = AdjFloat(3.0)
160162
b = exp(a)
161163
c = log(b)

0 commit comments

Comments
 (0)