31 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
31 · 77.5%
Assisted
0 · 0%
Worked by hand
9 · 22.5%
Using the packages
Exact complex arithmetic, branch-labelled functions and contour tools suit concrete calculations. A contour passing through a pole or a multivalued logarithm requires a domain decision first.
Calculator interface
Draw singularities, branch cuts and oriented contours in the same plane. Show winding numbers and both boundary values on a cut. Offer a theorem checklist before evaluating an integral.
Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.
Classroom inputs and practical limits
31 of 40 days include a checked executable example. On 6 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.
Ranges across the five units
Days 1–8 · Complex arithmetic and topology. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
Unit benchmark · complex.complex, absolute component. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 9–16 · Elementary functions. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Unit benchmark · complex.complex, absolute component. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 17–24 · Contour integration. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
Unit benchmark · complex.residue, pole location. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family.
Days 25–32 · Series and singularities. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Unit benchmark · complex.residue, pole location. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family.
Days 33–40 · Maps and special functions. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Unit benchmark · complex.winding, positive circuits. Largest passing sample 1,024 (49.38 ms, 89 MiB peak process RSS). The runs did not locate a ceiling for this family.
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log([complex.complex("(1 + 2i)*(3 - i)"), complex.complex("(1 + 2i)/(3 - i)")]);
Checked output
[5 + 5i, 1/10 + 7/10i]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.300 ms on Node.
Same API, measured input family.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.complex · 20 passing test cases, 32 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 1.09 ms on Node.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.polar · 1 passing test case, 2 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 78.83 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.roots · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.complex(1, 1).pow(8)));
Checked output
16
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.153 ms on Node.
Same API, measured input family.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.complex · 20 passing test cases, 32 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.complex(3, 2).mul(complex.complex(4, -5))));
Checked output
22 - 7i
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.429 ms on Node.
Same API, measured input family.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.complex · 20 passing test cases, 32 distinct argument descriptions
Give an example with strict inequality in |z+w| ≤ |z|+|w|.
Worked solution
With z=1 and w=i the sides are √2 and 2. The summands point in different directions.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 07 / 40 · Complex arithmetic and topology
Open disks
Worked by hand
Problem
Is {z: |z|≤1} an open set in C?
Worked solution
At any boundary point every disk contains points outside the set. One such point disproves openness.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 08 / 40 · Complex arithmetic and topology
Winding numbers
Direct calculation@ratmath/complex
Problem
Find the winding number about 0 of the closed polygon , of the same path traversed twice, and of the triangle .
Worked solution
Once round counter-clockwise: 1. Twice: 2. The triangle does not surround 0: 0.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
const W = complex.winding;
console.log(
[W(["1", "i", "-1", "-i", "1"]), W(["1", "i", "-1", "-i", "1", "i", "-1", "-i", "1"]), W(["3", "3+i", "2+i", "3"])]
);
Checked output
[1, 2, 0]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One or two complex numbers or a short polygonal loop; coordinates commonly small integers or rationals.
Focal example. The code above passed its displayed check in 0.409 ms on Node.
Same API, measured input family.complex.winding · positive circuits. Baseline test points across courses 1, 2, 4, 8. A counterclockwise diamond traversed n times has winding n about the origin.
Practical limit. Largest passing sample 1,024 (49.38 ms, 89 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost grows with path segments. A contour meeting the target point has undefined winding. Verify clearance and orientation before interpreting a count.
Measured times, memory and outcomes
positive circuits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.19
75.2
2
Baseline
Passed
1.60
74.7
4
Baseline
Passed
1.16
75.6
8
Baseline
Passed
1.49
75.1
32
Stretch
Passed
2.59
76
128
Stretch
Passed
7.50
78.1
1,024
Stretch
Passed
49.38
89
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.winding · 1 passing test case, 5 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.exp("1 + i")));
Checked output
1.4686939399 + 2.2873552872i ± 1.7e-21
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.437 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.exp · 9 passing test cases, 14 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.log("-1 - i")));
Checked output
0.3465735903 - 2.3561944902i ± 1.7e-21
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.566 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.log · 5 passing test cases, 13 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.pow("i", "i")));
Checked output
0.20787957635 + 0i ± 1.1e-22
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.503 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.pow · 1 passing test case, 6 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.sin("i")));
Checked output
0 + 1.17520119364i ± 8.5e-22
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Focal example. The code above passed its displayed check in 0.357 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.sin · 3 passing test cases, 7 distinct argument descriptions
Check that satisfies the Cauchy–Riemann equations.
Worked solution
and . (It is .)
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
const r = complex.cauchyRiemann("x^2 - y^2", "2*x*y");
console.log([r.holds, r.ux, r.vy, r.uy, r.vx]);
Checked output
[true, "2*x", "2*x", "-2*y", "2*y"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Focal example. The code above passed its displayed check in 0.539 ms on Node.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.cauchyRiemann · 5 passing test cases, 10 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log([symbolic.simplify("asin(-sqrt(3)/2)"), symbolic.simplify("cos(atan(3/4))")]);
Checked output
[-pi/3, 4/5]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Focal example. The code above passed its displayed check in 3.99 ms on Node.
Related workload in this unit.symbolic.expand · degree. Baseline test points across courses 1, 2, 4, 8. Sum the expanded coefficients at x=1 by direct substitution; result 2^n. Also check at x=0 and 2.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (47.68 ms, 96.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A univariate binomial has n+1 terms. With several variables the number of monomials can grow combinatorially even at modest degree.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
26.10
75.9
2
Baseline
Passed
3.05
75.5
4
Baseline
Passed
2.75
77.3
8
Baseline
Passed
4.23
79.5
16
Stretch
Passed
5.88
82.6
32
Stretch
Passed
6.12
87.9
64
Stretch
Passed
15.73
89.5
128
Stretch
Passed
47.68
96.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.simplify · 2 passing test cases, 11 distinct argument descriptions
Its real part is zero. Its imaginary part must be an integer multiple of 2π, giving z=2πik.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 16 / 40 · Elementary functions
Differentiability at one point
Worked by hand
Problem
Is the conjugation map complex differentiable at zero?
Worked solution
The difference quotient is 1 along the real axis and −1 along the imaginary axis. There is no complex derivative.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Short expressions and a specified logarithm or argument branch; distances to branch cuts and zeros are significant.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 17 / 40 · Contour integration
Contour integral
Direct calculation@ratmath/complex
Problem
Compute , counter-clockwise.
Worked solution
: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.contourIntegral("1/z", complex.Contour.circle(0, 1))));
Checked output
0 + 6.2831853072i ± 7.9e-17
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 78.50 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.contourIntegral · 6 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.contourIntegral("exp(z)/(z - 1)", complex.Contour.circle(0, 2))));
Checked output
0 + 17.0794684453i ± 4.8e-14
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 139 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.contourIntegral · 6 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.residue("1/(z^2 + 1)", "i")));
Checked output
0 - 0.5i ± 5.7e-14
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 68.25 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.residue · 7 passing test cases, 11 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.residue("exp(z)/z^3", 0)));
Checked output
0.5 + 0i ± 3.1e-14
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 388 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.residue · 7 passing test cases, 11 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 597 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.realLineIntegral · 4 passing test cases, 9 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
Focal example. The code above passed its displayed check in 21.19 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.trigIntegral · 1 passing test case, 5 distinct argument descriptions
Can the ordinary residue theorem be applied directly when a simple pole lies on the integration path?
Worked solution
The integrand is undefined on the contour. Specify an indentation or a principal-value prescription before assigning a value.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 24 / 40 · Contour integration
Cauchy estimates
Direct calculation@ratmath/core
Problem
If |f|≤6 on |z|=2 and f is holomorphic on and inside the circle, bound |f″(0)|.
Worked solution
Cauchy's estimate gives 2!M/R².
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`2*6/2^2`));
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One contour and a few poles usually of order 1–3; place singularities relative to the entire oriented contour.
Focal example. The code above passed its displayed check in 0.125 ms on Node.
Same arithmetic expression. Replaced its first numeral 2 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.multiply · operand bits. Baseline test points across courses 8, 32, 64, 256. Cross-multiply the unreduced integer products; operands have unlike denominators.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 131,072 (1.53 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Intermediate products can have twice the bit length of their factors. Repeated squaring can exhaust the engine’s BigInt allocation limit in a small number of steps.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
0.317
74.6
32
Baseline
Passed
0.035
75.5
64
Baseline
Passed
0.045
75.1
256
Baseline
Passed
0.106
74
1,024
Stretch
Passed
0.035
75.3
8,192
Stretch
Passed
0.075
75.8
32,768
Stretch
Passed
0.245
75
131,072
Stretch
Passed
1.53
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Focal example. The code above passed its displayed check in 203 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.laurent · 3 passing test cases, 4 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 3,431 ms on Node.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.singularities · 6 passing test cases, 12 distinct argument descriptions
On , , so by Rouché it has as many zeros as : one.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(complex.countZeros("z^5 + 3z + 1", complex.Contour.circle(0, 1)));
Checked output
1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 58.63 ms on Node.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.countZeros · 3 passing test cases, 4 distinct argument descriptions
. At : harmonic, diverges; at : alternating harmonic, converges. .
Using RatMath
Enter the coefficient as a function of the index. Keep the centre and starting index with the series when reading the convergence result.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.powerSeries("1/(n*2^n)", { index: "n", from: 1, centre: 3 }).interval().text);
Checked output
[1, 5)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Focal example. The code above passed its displayed check in 1.66 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.powerSeries · 2 passing test cases, 5 distinct argument descriptions
Enter the coefficient as a function of the index. Keep the centre and starting index with the series when reading the convergence result.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.powerSeries("n^2/3^n").radius().radius);
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Focal example. The code above passed its displayed check in 0.639 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.powerSeries · 2 passing test cases, 5 distinct argument descriptions
The only singularity is at −2, three units from the centre.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`1-(-2)`));
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Focal example. The code above passed its displayed check in 0.132 ms on Node.
Same arithmetic expression. Replaced its first numeral 1 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
On the circle |z⁵|=32 and |2z+1|≤5. Rouché gives the same zero count as z⁵, namely five with multiplicity.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 32 / 40 · Series and singularities
Annuli of convergence
Worked by hand
Problem
Expand 1/(z−2) about zero for |z|>2.
Worked solution
Factor out z and use the geometric sum in 2/z. The expansion is Σ from n=0 to infinity of 2ⁿ/zⁿ⁺¹. The condition |2/z|<1 fixes the annulus.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Power or Laurent orders around 1–10 and a stated disk or annulus; nearby singularities bound convergence.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 33 / 40 · Maps and special functions
Möbius maps
Direct calculation@ratmath/complex
Problem
Under , find , and . Where does the real line go?
Worked solution
, , . Real has , so the real line goes to the unit circle (and the upper half-plane to the disc).
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
const T = complex.mobius(1, "-i", 1, "i");
console.log([T.apply(0), T.apply(1), T.apply("i")]);
Checked output
[-1, -i, 0]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.447 ms on Node.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.mobius · 4 passing test cases, 9 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.681 ms on Node.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.mobius · 4 passing test cases, 9 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 160 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.gamma · 7 passing test cases, 15 distinct argument descriptions
Find the cross ratio of the points 0, 1, 2, 3 on a line.
Worked solution
.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
const p = (x) => geo.point(x, 0);
console.log(String(geo.crossRatio(p(0), p(1), p(2), p(3))));
Checked output
4/3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Focal example. The code above passed its displayed check in 0.502 ms on Node.
Related workload in this unit.geo.midpoint · absolute coordinate. Baseline test points across courses 0, 1, 10, 100. Midpoint of (−k,0) and (k,2k) equals (0,k).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Coordinate size and dimension affect exact distance and dot products. Floating geometry near coincidence can lose significant digits.
Measured times, memory and outcomes
absolute coordinate · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.193
74.9
1
Baseline
Passed
0.197
75.2
10
Baseline
Passed
0.151
75.4
100
Baseline
Passed
0.169
75.6
1,000,000
Stretch
Passed
0.298
76.3
1,000,000,000
Stretch
Passed
0.175
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.point · 7 passing test cases, 20 distinct argument descriptions
On a line, , , . Find the harmonic conjugate of with respect to .
Worked solution
: , so , .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(String(geo.harmonicConjugate(geo.point(0, 0), geo.point(3, 0), geo.point(1, 0))));
Checked output
[-3 : 0 : 1]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Focal example. The code above passed its displayed check in 0.222 ms on Node.
Related workload in this unit.geo.midpoint · absolute coordinate. Baseline test points across courses 0, 1, 10, 100. Midpoint of (−k,0) and (k,2k) equals (0,k).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Coordinate size and dimension affect exact distance and dot products. Floating geometry near coincidence can lose significant digits.
Measured times, memory and outcomes
absolute coordinate · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.193
74.9
1
Baseline
Passed
0.197
75.2
10
Baseline
Passed
0.151
75.4
100
Baseline
Passed
0.169
75.6
1,000,000
Stretch
Passed
0.298
76.3
1,000,000,000
Stretch
Passed
0.175
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.harmonicConjugate · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log([analytic.laplace("t^2"), analytic.laplace("exp(2t)*sin(3t)")].map(String));
Checked output
["2/s^3", "3/((s - 2)^2 + 9)"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Focal example. The code above passed its displayed check in 0.656 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.laplace · 2 passing test cases, 7 distinct argument descriptions
Where does z↦z² fail the nonzero-derivative test for conformality?
Worked solution
Its derivative 2z vanishes at the origin. There the map doubles small angles.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 40 / 40 · Maps and special functions
Identity theorem
Worked by hand
Problem
Why do coincident values on {1/n} force two entire functions to agree?
Worked solution
Their difference has zeros accumulating at 0, an interior point of the connected domain. The identity theorem gives equality everywhere.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Möbius maps with four scalar coefficients, a few test points, and special functions at simple arguments away from poles.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.