Changeset 139e15
 Timestamp:
 04/12/12 16:30:28 (3 years ago)
 Branches:
 master
 Children:
 0823ac
 Parents:
 9fd2eb
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

rttests.lisp
rbba9f8 r139e15 1548 1548 nil) 1549 1549 1550 1551 1552 ;; Bessel J tests for negative order 1553 (rt:deftest besselj.negorder.d.1 1554 (let ((b (besselj 1d0 2d0)) 1555 (true 0.5767248077568734d0)) 1556 (checkaccuracy 50.2 b true)) 1557 nil) 1558 1559 (rt:deftest besselj.negorder.d.2 1560 (let ((b (besselj 1d0 1.5d0)) 1561 (true 0.5579365079100996d0)) 1562 (checkaccuracy 50.5 b true)) 1563 nil) 1564 1565 (rt:deftest besselj.negorder.d.3 1566 (let ((b (besselj 1.5d0 2d0)) 1567 (true 0.3956232813587035d0)) 1568 (checkaccuracy 50.59 b true)) 1569 nil) 1570 1571 (rt:deftest besselj.negorder.d.4 1572 (let ((b (besselj 1.8d0 1.5d0)) 1573 (true 0.251327217627129314d0)) 1574 (checkaccuracy 49.98 b true)) 1575 nil) 1576 1577 (rt:deftest besselj.negorder.d.5 1578 (let ((b (besselj 2d0 1.5d0)) 1579 (true 0.2320876721442147d0)) 1580 (checkaccuracy 51.89 b true)) 1581 nil) 1582 1583 (rt:deftest besselj.negorder.d.6 1584 (let ((b (besselj 2.5d0 1.5d0)) 1585 (true 1.315037204805194d0)) 1586 (checkaccuracy 52.37 b true)) 1587 nil) 1588 1589 (rt:deftest besselj.negorder.d.7 1590 (let ((b (besselj 2.3d0 1.5d0)) 1591 (true 1.012178926325313d0)) 1592 (checkaccuracy 50.01 b true)) 1593 nil) 1594 1595 ;; BesselJ tests for positive order 1596 (rt:deftest besselj.posorder.d.1 1597 (let ((b (besselj 1.5d0 1d0)) 1598 (true 0.2402978391234270d0)) 1599 (checkaccuracy 51.83 b true)) 1600 nil) 1601 1602 (rt:deftest besselj.posorder.d.2 1603 (let ((b (besselj 1.8d0 1d0)) 1604 (true 0.1564953153109239d0)) 1605 (checkaccuracy 51.97 b true)) 1606 nil) 1607 1608 (rt:deftest besselj.posorder.d.3 1609 (let ((b (besselj 2d0 1d0)) 1610 (true 0.1149034849319005d0)) 1611 (checkaccuracy 51.87 b true)) 1612 nil) 1613 1614 (rt:deftest besselj.posorder.d.4 1615 (let ((b (besselj 2.5d0 1d0)) 1616 (true 0.04949681022847794d0)) 1617 (checkaccuracy 47.17 b true)) 1618 nil) 1619 1620 (rt:deftest besselj.posorder.d.5 1621 (let ((b (besselj 2d0 1.5d0)) 1622 (true 0.2320876721442147d0)) 1623 (checkaccuracy 51.89 b true)) 1624 nil) 1625 1626 ;; Bessel J for half integer order and real args 1627 (rt:deftest besselj1/2.d.1 1628 (loop for k from 0 below 100 1629 ;; x in [1,1+pi/2] because we don't want to test the Bessel 1630 ;; series and we don't want to test near pi because sin(pi) 1631 ;; = 0, where we will lose accuracy. 1632 for x = (+ 1 (random (/ pi 2))) 1633 for b = (besselj 0.5d0 x) 1634 for true = (* (/ (sin x) (sqrt x)) (sqrt (/ 2 pi))) 1635 for result = (checkaccuracy 48.42 b true) 1636 when result 1637 append (list (list (list k x) result))) 1638 nil) 1639 1640 (rt:deftest besselj1/2.d.1.a 1641 (let* ((x 2.3831631289164497d0) 1642 (b (besselj 0.5d0 x)) 1643 (true (* (/ (sin x) (sqrt x)) (sqrt (/ 2 pi))))) 1644 (checkaccuracy 48.42 b true)) 1645 nil) 1646 1647 (rt:deftest besselj1/2.q.1 1648 (loop for k from 0 below 10 1649 ;; x in [1,1+pi/2] because we don't want to test the Bessel 1650 ;; series and we don't want to test near pi because sin(pi) 1651 ;; = 0, where we will lose accuracy. 1652 for x = (+ 1 (random (/ (floatpi #q1) 2))) 1653 for b = (besselj #q0.5 x) 1654 for true = (* (/ (sin x) (sqrt x)) (sqrt (/ 2 (floatpi #q1)))) 1655 for result = (checkaccuracy 173.28 b true) 1656 when result 1657 append (list (list (list k x) result))) 1658 nil) 1659 1660 (rt:deftest besselj1/2.q.1.a 1661 (let* ((x #q1.1288834862545916200627583005758663687705443417892789067029865493882q0) 1662 (b (besselj #q0.5 x)) 1663 (true (* (/ (sin x) (sqrt x)) (sqrt (/ 2 (floatpi #q1)))))) 1664 (checkaccuracy 182.92 b true)) 1665 nil) 1666 1667 (rt:deftest besselj1/2.q.1.b 1668 (let* ((x #q1.1288834862545916200627583005758663687705443417892789067029865493882q0) 1669 (b (besselj #q0.5 x)) 1670 (true (* (/ (sin x) (sqrt x)) (sqrt (/ 2 (floatpi #q1)))))) 1671 (checkaccuracy 173.28 b true)) 1672 nil) 1673 1674 ;; Bessel J for complex args 1675 #+nil 1676 (rt:deftest besseljcomplex.posorder.d.1 1677 (let ((b (besselj 0d0 #c(1d0 1))) 1678 (true #c(0.9376084768060293d0 0.4965299476091221d0))) 1679 (checkaccuracy 53 b true)) 1680 nil) 1681
Note: See TracChangeset
for help on using the changeset viewer.