Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5,037 changes: 2,527 additions & 2,510 deletions doc/graphs/jacobi_theta1_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,003 changes: 2,513 additions & 2,490 deletions doc/graphs/jacobi_theta1q_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,012 changes: 2,514 additions & 2,498 deletions doc/graphs/jacobi_theta2_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,025 changes: 2,513 additions & 2,512 deletions doc/graphs/jacobi_theta2q_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,969 changes: 2,505 additions & 2,464 deletions doc/graphs/jacobi_theta3_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,025 changes: 2,513 additions & 2,512 deletions doc/graphs/jacobi_theta3q_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,978 changes: 2,506 additions & 2,472 deletions doc/graphs/jacobi_theta4_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,003 changes: 2,513 additions & 2,490 deletions doc/graphs/jacobi_theta4q_float.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions doc/sf/jacobi_theta.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ A more accurate computation will take advantage of [tau]:

Internally, when /q/ is larger than exp(-[pi]) (that is, when [tau] is less than 1), Boost implements the /q/ parameterization by taking the logarithm of /q/ and passing it to the [tau] parameterization; as such, using the [tau] parameterization directly will generally yield greater precision in that regime.
When /q/ is smaller than exp(-[pi]), the Fourier series is summed directly in terms of /q/, and the two parameterizations are equally accurate.

Every term of the series is an exponential whose argument is a product or quotient of [tau], [pi] and a small integer, or, in the transformed series used when [tau] < 1, the square of /z/ plus a multiple of [pi]/2.
Rounding such an argument to working precision would cost as many ulps in the term as the argument is large, so the rounding errors of [pi], of the products, of the division and of the reduction of /z/ are tracked exactly (using error-free transformations that work for any binary floating-point type) and applied as a correction factor to each term.
The [tau] parameterization is therefore accurate to a few ulps throughout, apart from the conditioning of the function itself. In the /q/ parameterization the rounding of log(/q/) remains, and its effect grows as /q/ approaches 1.
As another example, if the complement of /q/ is known with great accuracy, then instead of:

jacobi_theta1(x, 1-q_complement);
Expand Down Expand Up @@ -125,7 +129,7 @@ Fixing /x/=5 and varying /q/, the ULPs plot looks like:

[graph jacobi_theta1q_float]

Accuracy tends to degenerate near /q/=1 (small [tau]).
Accuracy degrades gently as /q/ approaches 1 (small [tau]), where the rounding of log(/q/) is amplified by the size of the exponents in the transformed series; the [tau] parameterization does not have this problem.

[heading Implementation]

Expand Down Expand Up @@ -194,7 +198,7 @@ Fixing /x/=0.4 and varying /q/, the ULPs plot looks like:

[graph jacobi_theta2q_float]

Accuracy tends to degenerate near /q/=1 (small [tau]).
Accuracy degrades gently as /q/ approaches 1 (small [tau]), where the rounding of log(/q/) is amplified by the size of the exponents in the transformed series; the [tau] parameterization does not have this problem.

[heading Implementation]

Expand Down Expand Up @@ -276,7 +280,7 @@ Fixing /x/=0.4 and varying /q/, the ULPs plot looks like:

[graph jacobi_theta3q_float]

Accuracy tends to degenerate near /q/=1 (small [tau]).
Accuracy degrades gently as /q/ approaches 1 (small [tau]), where the rounding of log(/q/) is amplified by the size of the exponents in the transformed series; the [tau] parameterization does not have this problem.

[heading Implementation]

Expand Down Expand Up @@ -358,7 +362,7 @@ Fixing /x/=5 and varying /q/, the ULPs plot looks like:

[graph jacobi_theta4q_float]

Accuracy tends to degenerate near /q/=1 (small [tau]).
Accuracy degrades gently as /q/ approaches 1 (small [tau]), where the rounding of log(/q/) is amplified by the size of the exponents in the transformed series; the [tau] parameterization does not have this problem.

[heading Implementation]

Expand Down
Loading
Loading