changeset 30940:84944164799e

besselj.cc: Add BISTs for the function airy, remove FIXME (bug #62321)
author Arun Giridhar <arungiridhar@gmail.com>
date Sun, 17 Apr 2022 16:57:39 -0400
parents 5d410755481e
children 272614f05636
files libinterp/corefcn/besselj.cc
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/besselj.cc	Sat Apr 16 12:46:22 2022 -0700
+++ b/libinterp/corefcn/besselj.cc	Sun Apr 17 16:57:39 2022 -0400
@@ -718,9 +718,25 @@
 }
 
 /*
-FIXME: Function airy does not yet have BIST tests
+%!test <*62321>
+%! assert (airy (0,  1, false), 0.1352924163128814, 1e-14)
+%! assert (airy (0, -1, false), 0.5355608832923521, 1e-14)
+%! assert (airy (0,  i, false), 0.3314933054321411 - 0.3174498589684437i, 1e-14)
+%! assert (airy (0, -i, false), 0.3314933054321411 + 0.3174498589684437i, 1e-14)
+%! assert (airy (0,  1, true), 0.2635136447491401, 1e-14)
+%! assert (airy (0, -1, true), 0.4208904755499093 - 0.3311746779333462i, 1e-14)
+%! assert (airy (0,  i, true), 0.2743053542644657 - 0.08256069414005915i, 1e-14)
+%! assert (airy (0, -i, true), 0.2743053542644657 + 0.08256069414005915i, 1e-14)
+
+%!error (airy ())
+%!error (airy (0, 1, 2, 3))
+%!error <K must be an integer value> (airy ("foo", 2, false))
+%!error <K must be 0, 1, 2, or 3> (airy (3743, 2, false))
+%!error <scale option must be a logical value> (airy (0, 2, "foo"))
+%!error <Z must be a complex matrix> (airy (0, "foo", false))
 */
 
+
 /*
 ## Test values computed with GP/PARI version 2.3.3
 %!shared alpha, x, jx, yx, ix, kx, nix