Skip to content

Commit 749cc4b

Browse files
committed
add tests
1 parent d2af3a0 commit 749cc4b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/lax_scipy_special_functions_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,16 @@ def testSiciEdgeCases(self):
400400
self.assertAllClose(si_jax, expected_si, atol=1e-6, rtol=1e-6)
401401
self.assertAllClose(ci_jax, expected_ci, atol=1e-6, rtol=1e-6)
402402

403+
def explicitlyTestSiciValueRanges(self):
404+
dtype = jnp.zeros(0).dtype
405+
x_samples = np.array([2, 6, 10, 1e15], dtype=dtype)
406+
scipy_op = lambda x: osp_special.sici(x)
407+
lax_op = lambda x: lsp_special.sici(x)
408+
si_scipy, ci_scipy = scipy_op(x_samples)
409+
si_jax, ci_jax = lax_op(x_samples)
410+
self.assertAllClose(si_jax, si_scipy, atol=1e-6, rtol=1e-6)
411+
self.assertAllClose(ci_jax, ci_scipy, atol=1e-6, rtol=1e-6)
412+
403413
def testSiciRaiseOnComplexInput(self):
404414
samples = jnp.arange(5, dtype=complex)
405415
with self.assertRaisesRegex(ValueError, "Argument `x` to sici must be real-valued."):

0 commit comments

Comments
 (0)