Skip to content

Commit f42a003

Browse files
committed
Improve formatting of comments in cal/lucas.cal
1 parent 8da0471 commit f42a003

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

cal/lucas.cal

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -863,20 +863,22 @@ rodseth_xhn(x, h, n)
863863
* 104 0.0001 %
864864
* 129 0.0001 %
865865
*
866-
* However, a case can be made for considering only odd values for v(1) candidates.
867-
* When h * 2^n-1 is prime and h is an odd multiple of 3, a smallest v(1) that
868-
* is even is extremely rate. Of the list of 146553 known primes of the form
869-
* h*2^n-1 when h is an odd a multiple of 3, none has an smallest v(1) that was even.
866+
* However, a case can be made for considering only odd values for v(1)
867+
* candidates. When h * 2^n-1 is prime and h is an odd multiple of 3,
868+
* a smallest v(1) that is even is extremely rate. Of the list of 146553
869+
* known primes of the form h*2^n-1 when h is an odd a multiple of 3,
870+
* none has an smallest v(1) that was even.
870871
*
871872
* See:
872873
*
873874
* https://github.com/arcetri/verified-prime
874875
*
875876
* for that list of 146553 known primes of the form h*2^n-1.
876877
*
877-
* That same example for in a sample size of 1000000 numbers of the form h*2^n-1
878-
* where h is an odd multiple of 3, 12996351 <= h <= 13002351,
879-
* 4331116 <= n <= 4332116, these are the smallest odd v(1) values that were found:
878+
* That same example for in a sample size of 1000000 numbers of the
879+
* form h*2^n-1 where h is an odd multiple of 3, 12996351 <= h <= 13002351,
880+
* 4331116 <= n <= 4332116, these are the smallest odd v(1) values that were
881+
* found:
880882
*
881883
* smallest percentage
882884
* odd v(1) used
@@ -916,26 +918,25 @@ rodseth_xhn(x, h, n)
916918
* 101 0.0002 %
917919
* 53 0.0001 %
918920
*
919-
* Moreover when evaluating odd candidates for v(1), one may cache Jacobi symbol
920-
* evaluations to reduce the number of Jacobi symbol evaluations to a minimum.
921-
* For example, if one tests 5 and finds that the 2nd case fails:
921+
* Moreover when evaluating odd candidates for v(1), one may cache Jacobi
922+
* symbol evaluations to reduce the number of Jacobi symbol evaluations to
923+
* a minimum. For example, if one tests 5 and finds that the 2nd case fails:
922924
*
923925
* jacobi(5+2, h*2^n-1) != -1
924926
*
925-
* Then if one is later testing 9, the Jacobi symbol value for the first 1st case:
927+
* Then if one is later testing 9, the Jacobi symbol value for the first
928+
* 1st case:
926929
*
927930
* jacobi(7-2, h*2^n-1)
928931
*
929932
* is already known.
930933
*
931-
* The hit rate in the cache improves (thus fewer Jacobi symbols need evaluating)
932-
* if we sort the above "smallest odd v(1) values" in numerical order.
933934
* Without Jacobi symbol value caching, it requires on average
934935
* 4.851377 Jacobi symbol evaluations. With Jacobi symbol value caching
935936
* cacheing, an averare of 4.348820 Jacobi symbol evaluations is needed.
936937
*
937938
* Given this information, when odd h is a multiple of 3 we try, in order,
938-
* these sorted odd values of X:
939+
* these odd values of X:
939940
*
940941
* 3, 5, 9, 11, 15, 17, 21, 29, 27, 35, 39, 41, 31, 45, 51, 55, 49, 59,
941942
* 69, 65, 71, 57, 85, 81, 95, 99, 77, 53, 67, 125, 111, 105, 87, 129,
@@ -946,7 +947,7 @@ rodseth_xhn(x, h, n)
946947
* jacobi(X-2, h*2^n-1) == 1
947948
* jacobi(X+2, h*2^n-1) == -1
948949
*
949-
* Less than 1 case out of 1000000 will not be satisifed by the above sorted list.
950+
* Less than 1 case out of 1000000 will not be satisifed by the above list.
950951
* If no value in that list works, we start simple search starting with X = 167
951952
* and incrementing by 2 until a value of X is found.
952953
*
@@ -1141,7 +1142,7 @@ gen_v1(h, n)
11411142
local i; /* x_tbl index */
11421143
local v1m2; /* X-2 1st case */
11431144
local v1p2; /* X+2 2nd case */
1144-
local testval; /* h*2^n-1 - value we are testing if prime */
1145+
local testval; /* h*2^n-1 - value we are testing if prime */
11451146
local mat cached_v1[next_x]; /* cached Jacobi symbol values or 0 */
11461147

11471148
/*

0 commit comments

Comments
 (0)