Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
898c3ad
Jacobi Theta functions
evanmiller Jul 7, 2020
c78dcd7
[CI SKIP] Jacobi theta: Add special-value tests and more
evanmiller Jul 7, 2020
10fc561
Jacobi theta: Test two more of Watson's identities [CI SKIP]
evanmiller Jul 7, 2020
4b6701d
Improve precision of Jacobi theta functions [CI SKIP]
evanmiller Jul 8, 2020
9c68c11
Jacobi theta: Make changes suggested in #394 [CI SKIP]
evanmiller Jul 8, 2020
aa382f5
Add quadrature tests to Jacobi theta functions [CI SKIP]
evanmiller Jul 8, 2020
45e8ab9
Test Jacobi thetas against elliptic functions and elliptic integrals …
evanmiller Jul 9, 2020
0d3bc43
Test Jacobi Thetas against their Laplace transforms [CI SKIP]
evanmiller Jul 9, 2020
c293d48
Add a note on using log1p with Jacobi theta functions [CI SKIP]
evanmiller Jul 9, 2020
6b8dd5a
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 9, 2020
08391cd
Add random data tests to Jacobi Theta functions [CI SKIP]
evanmiller Jul 9, 2020
d73472e
Add small-tau tests and simplify Jacobi Theta code [CI SKIP]
evanmiller Jul 10, 2020
78fc9e2
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 13, 2020
98bc16c
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 17, 2020
2ecdf32
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 23, 2020
32a4d73
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 27, 2020
a2499bb
Add user documentation for Jacobi Theta functions [CI SKIP]
evanmiller Jul 29, 2020
041ca09
Add function graphs to Jacobi Theta docs [CI SKIP]
evanmiller Jul 30, 2020
3a0e3f3
Define Jacobi Theta test tolerances [CI SKIP]
evanmiller Jul 31, 2020
4630855
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller Jul 31, 2020
cf7ff40
Add implementation note on Jacobi theta functions [CI SKIP]
evanmiller Jul 31, 2020
b116c75
Consolidate Jacobi Theta ULPs plotting programs [CI SKIP]
evanmiller Aug 1, 2020
9fab61b
Fix q domain checking of jacobi_theta4 [CI SKIP]
evanmiller Aug 1, 2020
fb8d3f3
Add ULPs plots to Jacobi Theta docs [CI SKIP]
evanmiller Aug 1, 2020
dd2fcd1
Add missing Jacobi Theta ULPs plots [CI SKIP]
evanmiller Aug 1, 2020
d629f80
Add LaTeX source for Jacobi Theta equations [CI SKIP]
evanmiller Aug 1, 2020
ef39393
Remove unused Jacobi Theta PNG equations [CI SKIP]
evanmiller Aug 1, 2020
7ecda0f
Add Jacobi Theta performance script [CI SKIP]
evanmiller Aug 2, 2020
8cea3e9
Remove vestigial eps*eps check from jacobi_theta3 [CI SKIP]
evanmiller Aug 2, 2020
2902061
Update Jacobi Theta docs per code review comments [CI SKIP]
evanmiller Aug 2, 2020
5bea1e5
Enable arg promotion for Jacobi Theta functions [CI SKIP]
evanmiller Aug 3, 2020
46c59f8
Fix Jacobi Theta plotting script [CI SKIP]
evanmiller Aug 3, 2020
c9ac3a6
Change Jacobi Theta convergence criterion [CI SKIP]
evanmiller Aug 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test Jacobi thetas against elliptic functions and elliptic integrals …
  • Loading branch information
evanmiller committed Jul 9, 2020
commit 45e8ab9a587a5fadb1193b28c6267b13e65c1e6a
2 changes: 2 additions & 0 deletions test/test_jacobi_theta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ BOOST_AUTO_TEST_CASE( test_main )
test_transformations_of_nome(z, q, 100 * eps);
test_watsons_identities(z, 0.5, q, 101 * eps);
test_landen_transformations(z, -log(q)/constants::pi<double>(), sqrt(eps));
test_elliptic_functions(z, q, 5 * sqrt(eps));
}
test_elliptic_integrals(q, 10 * eps);
}

test_special_values(eps);
Expand Down
83 changes: 83 additions & 0 deletions test/test_jacobi_theta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/special_functions/ellint_rf.hpp>
#include <boost/math/special_functions/jacobi_elliptic.hpp>
#include <boost/math/special_functions/jacobi_theta.hpp>
#include <boost/math/special_functions/zeta.hpp>
#include <boost/math/constants/constants.hpp>
Expand Down Expand Up @@ -570,3 +572,84 @@ inline void test_mellin_transforms(RealType s, RealType integration_eps, RealTyp
(1 - pow(RealType(2), 1 - s)) * pow(constants::pi<RealType>(), -0.5*s) * tgamma(0.5*s) * zeta(s),
result_eps);
}

template <typename RealType>
inline void test_elliptic_functions(RealType z, RealType q, RealType eps) {
using namespace boost::math;
BOOST_MATH_STD_USING

RealType t2 = jacobi_theta2(RealType(0), q);
RealType t3 = jacobi_theta3(RealType(0), q);
RealType t4 = jacobi_theta4(RealType(0), q);
RealType k = t2 * t2 / (t3 * t3);
RealType xi = z / (t3 * t3);

_check_close( // DLMF 22.2.4
jacobi_sn(k, z) *
t2 * jacobi_theta4(xi, q),
t3 * jacobi_theta1(xi, q),
eps);

_check_close( // DLMF 22.2.5
jacobi_cn(k, z) *
t2 * jacobi_theta4(xi, q),
t4 * jacobi_theta2(xi, q),
eps);

_check_close( // DLMF 22.2.6
jacobi_dn(k, z) *
t3 * jacobi_theta4(xi, q),
t4 * jacobi_theta3(xi, q),
eps);

_check_close( // DLMF 22.2.7
jacobi_sd(k, z) *
t2 * t4 * jacobi_theta3(xi, q),
t3 * t3 * jacobi_theta1(xi, q),
eps);

_check_close( // DLMF 22.2.8
jacobi_cd(k, z) *
t2 * jacobi_theta3(xi, q),
t3 * jacobi_theta2(xi, q),
eps);

_check_close( // DLMF 22.2.9
jacobi_cd(k, z) *
t2 * jacobi_theta3(xi, q),
t3 * jacobi_theta2(xi, q),
eps);

_check_close( // DLMF 22.2.9
jacobi_sc(k, z) *
t4 * jacobi_theta2(xi, q),
t3 * jacobi_theta1(xi, q),
eps);
}

template <typename RealType>
inline void test_elliptic_integrals(RealType q, RealType eps) {
using namespace boost::math;
BOOST_MATH_STD_USING

RealType t2 = jacobi_theta2(RealType(0), q);
RealType t3 = jacobi_theta3(RealType(0), q);
RealType t4 = jacobi_theta4(RealType(0), q);
RealType k = t2*t2 / (t3*t3);
RealType k1= t4*t4 / (t3*t3);

if (t3*t3*t3*t3 != 0.f && t4*t4*t4*t4 != 0.f) {
_check_close( // DLMF 20.9.4
ellint_rf(RealType(0), t3*t3*t3*t3, t4*t4*t4*t4),
constants::half_pi<RealType>(),
eps);
}

if (k*k != 0.f && k1*k1 != 0.f) {
_check_close( // DLMF 20.9.5
ellint_rf(RealType(0), k1*k1, RealType(1))
* log(q) / constants::pi<RealType>(),
-ellint_rf(RealType(0), k*k, RealType(1)),
eps);
}
}