"Source: Text/Geometry/CrvHyp.text";
"Line: 2941";
"Date: Fri Sep 26 09:12:34 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Geometry/CrvHyp.text, line: 2941
// Example: H137E22 ()
print "Example: H137E22";
ei := GetEchoInput();
SetEchoInput(true);
// Using Schoof and Halving true is generally best in genus 2
P<x> := PolynomialRing(GF(100000007));
f := x^5 + 456*x^4 + 98*x^3 + 76*x^2 + 54*x + 32;
J := Jacobian(HyperellipticCurve(f));
time Order(J);
assert $1 eq 10001648178050390;
delete J`Order;
time Order(J: UseSchoof := false, UseHalving := false);
assert $1 eq 10001648178050390;
// ... but not always for highly non-cyclic Jacobians
P<x> := PolynomialRing(GF(500083));
f := x^5 + 250039*x^4 + 222262*x^3 + 416734*x^2 + 166695*x + 222259;
J := Jacobian(HyperellipticCurve(f));
time Order(J);
assert $1 eq 250084007056;
delete J`Order;       
time Order(J : UseSchoof:=false, UseHalving := false);
assert $1 eq 250084007056;
SetEchoInput(ei);
