-
Notifications
You must be signed in to change notification settings - Fork 248
Jacobi Theta functions #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
898c3ad
Jacobi Theta functions
evanmiller c78dcd7
[CI SKIP] Jacobi theta: Add special-value tests and more
evanmiller 10fc561
Jacobi theta: Test two more of Watson's identities [CI SKIP]
evanmiller 4b6701d
Improve precision of Jacobi theta functions [CI SKIP]
evanmiller 9c68c11
Jacobi theta: Make changes suggested in #394 [CI SKIP]
evanmiller aa382f5
Add quadrature tests to Jacobi theta functions [CI SKIP]
evanmiller 45e8ab9
Test Jacobi thetas against elliptic functions and elliptic integrals …
evanmiller 0d3bc43
Test Jacobi Thetas against their Laplace transforms [CI SKIP]
evanmiller c293d48
Add a note on using log1p with Jacobi theta functions [CI SKIP]
evanmiller 6b8dd5a
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller 08391cd
Add random data tests to Jacobi Theta functions [CI SKIP]
evanmiller d73472e
Add small-tau tests and simplify Jacobi Theta code [CI SKIP]
evanmiller 78fc9e2
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller 98bc16c
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller 2ecdf32
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller 32a4d73
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller a2499bb
Add user documentation for Jacobi Theta functions [CI SKIP]
evanmiller 041ca09
Add function graphs to Jacobi Theta docs [CI SKIP]
evanmiller 3a0e3f3
Define Jacobi Theta test tolerances [CI SKIP]
evanmiller 4630855
Merge branch 'develop' into jacobi-theta [CI SKIP]
evanmiller cf7ff40
Add implementation note on Jacobi theta functions [CI SKIP]
evanmiller b116c75
Consolidate Jacobi Theta ULPs plotting programs [CI SKIP]
evanmiller 9fab61b
Fix q domain checking of jacobi_theta4 [CI SKIP]
evanmiller fb8d3f3
Add ULPs plots to Jacobi Theta docs [CI SKIP]
evanmiller dd2fcd1
Add missing Jacobi Theta ULPs plots [CI SKIP]
evanmiller d629f80
Add LaTeX source for Jacobi Theta equations [CI SKIP]
evanmiller ef39393
Remove unused Jacobi Theta PNG equations [CI SKIP]
evanmiller 7ecda0f
Add Jacobi Theta performance script [CI SKIP]
evanmiller 8cea3e9
Remove vestigial eps*eps check from jacobi_theta3 [CI SKIP]
evanmiller 2902061
Update Jacobi Theta docs per code review comments [CI SKIP]
evanmiller 5bea1e5
Enable arg promotion for Jacobi Theta functions [CI SKIP]
evanmiller 46c59f8
Fix Jacobi Theta plotting script [CI SKIP]
evanmiller c9ac3a6
Change Jacobi Theta convergence criterion [CI SKIP]
evanmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add implementation note on Jacobi theta functions [CI SKIP]
- Loading branch information
commit cf7ff4099f46f2ff0520c4fe18ff87eda8a55b2f
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,8 @@ Most applications will want to use the /q/ parameterization of the functions: `_ | |
|
|
||
| Note that Boost assumes that [tau] is a purely imaginary number. This assumption is not required by the mathematics, but it does cover the most common application domains. | ||
|
|
||
| [heading Accuracy considerations] | ||
|
|
||
| The purpose of the [tau] parameterization is to provide increased accuracy either when /q/ is expressible as an exponential or is very close to unity. For example, instead of: | ||
|
||
|
|
||
| jacobi_theta1(x, exp(-a)); | ||
|
|
@@ -54,6 +56,10 @@ It is more accurate to use `__log1p` and pass in the result to the [tau] version | |
|
|
||
| Additional "minus 1" versions of the third and fourth theta functions are provided. Similar in spirit to `__expm1`, these functions return one less than the evaluated function, and yield increased accuracy when /q/ is small. | ||
|
|
||
| [heading Tests] | ||
|
|
||
| Results of the theta functions are tested against Wolfram Alpha data, as well as random values computed at high precision. In addition, the tests verify the majority of the identities described in [@https://dlmf.nist.gov/20.7 DLMF Chapter 20.7]. | ||
|
|
||
NAThompson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [endsect] [/section:jacobi_theta_overview Overview of the Jacobi Theta Functions] | ||
|
|
||
| [section:jacobi_theta1 Jacobi Theta Function [theta][sub 1]] | ||
|
|
@@ -94,6 +100,16 @@ The nome /q/ is restricted to the domain (0, 1). The following graph shows the t | |
|
|
||
| [optional_policy] | ||
|
|
||
| [heading Implementation] | ||
|
|
||
| The /q/ parameterization is implemented using the [tau] parameterization, where [tau]=-log(/q/)/[pi]. | ||
|
|
||
| If [tau] is greater than or equal to 1, the summation in the section above is used as-is. However if [tau] < 1, the following identity [@https://dlmf.nist.gov/20.7#viii DLMF 20.7.30] is used, defining [tau]'=-1/[tau]: | ||
|
|
||
| [equation jacobi_theta1_imaginary] | ||
|
|
||
| This transformation of variables ensures that the function will always converge in a small number of iterations. | ||
|
|
||
| [endsect] [/section:jacobi_theta1 Jacobi Theta Function [theta][sub 1]] | ||
|
|
||
| [section:jacobi_theta2 Jacobi Theta Function [theta][sub 2]] | ||
|
|
@@ -134,6 +150,16 @@ The nome /q/ is restricted to the domain (0, 1). The following graph shows the t | |
|
|
||
| [optional_policy] | ||
|
|
||
| [heading Implementation] | ||
|
|
||
| The /q/ parameterization is implemented using the [tau] parameterization, where [tau]=-log(/q/)/[pi]. | ||
|
|
||
| If [tau] is greater than or equal to 1, the summation in the section above is used as-is. However if [tau] < 1, the following identity [@https://dlmf.nist.gov/20.7#viii DLMF 20.7.31] is used, defining [tau]'=-1/[tau]: | ||
|
|
||
| [equation jacobi_theta2_imaginary] | ||
|
|
||
| This transformation of variables ensures that the function will always converge in a small number of iterations. | ||
|
|
||
| [endsect] [/section:jacobi_theta2 Jacobi Theta Function [theta][sub 2]] | ||
|
|
||
| [section:jacobi_theta3 Jacobi Theta Function [theta][sub 3]] | ||
|
|
@@ -188,6 +214,16 @@ The nome /q/ is restricted to the domain (0, 1). The following graph shows the t | |
|
|
||
| A second quartet of functions (functions containing `m1`) compute one less than the value of the third theta function. These versions of the functions provide increased accuracy when the result is close to unity. | ||
|
|
||
| [heading Implementation] | ||
|
|
||
| The /q/ parameterization is implemented using the [tau] parameterization, where [tau]=-log(/q/)/[pi]. | ||
|
|
||
| If [tau] is greater than or equal to 1, the summation in the section above is used as-is. However if [tau] < 1, the following identity [@https://dlmf.nist.gov/20.7#viii DLMF 20.7.32] is used, defining [tau]'=-1/[tau]: | ||
|
|
||
| [equation jacobi_theta3_imaginary] | ||
|
|
||
| This transformation of variables ensures that the function will always converge in a small number of iterations. | ||
|
|
||
| [endsect] [/section:jacobi_theta3 Jacobi Theta Function [theta][sub 3]] | ||
|
|
||
| [section:jacobi_theta4 Jacobi Theta Function [theta][sub 4]] | ||
|
|
@@ -242,6 +278,16 @@ The nome /q/ is restricted to the domain (0, 1). The following graph shows the t | |
|
|
||
| A second quartet of functions (functions containing `m1`) compute one less than the value of the fourth theta function. These versions of the functions provide increased accuracy when the result is close to unity. | ||
|
|
||
| [heading Implementation] | ||
|
|
||
| The /q/ parameterization is implemented using the [tau] parameterization, where [tau]=-log(/q/)/[pi]. | ||
|
|
||
| If [tau] is greater than or equal to 1, the summation in the section above is used as-is. However if [tau] < 1, the following identity [@https://dlmf.nist.gov/20.7#viii DLMF 20.7.33] is used, defining [tau]'=-1/[tau]: | ||
|
|
||
| [equation jacobi_theta4_imaginary] | ||
|
|
||
| This transformation of variables ensures that the function will always converge in a small number of iterations. | ||
|
|
||
| [endsect] [/section:jacobi_theta4 Jacobi Theta Function [theta][sub 4]] | ||
|
|
||
| [endsect] [/section:jacobi_theta Jacobi Theta Functions] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.