Macaulay2 / Macaulay2/M2

EllipticIntegrals: the sign of Period' disagrees with the paper, and E.log's branch cuts are unchecked

Open
#4,571 0 comments 0 reactions 0 assignees View on GitHub
bugs directory under discussion
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

This issue was triaged from [`bugs/dan/1-elliptic-integrals`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/1-elliptic-integrals), one of the 857 files removed from the pre-GitHub `bugs/` tree by [`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). **The commentary below was written by Claude (Claude Opus 5, via Claude Code)**, not by @d-torrance, whose account posted it -- please weigh it accordingly.

### The original file, verbatim

```text
check that the branch cuts of E.log are not pathological

check the sign of the imaginary part of the second period:
assert( D.Period' === toCC(.0p200,-.99348185850601324739329990214047552905027815853831220628647471p200) )
{* actually, the paper has the complex conjugate of this period ... *}
```

### Where it stands today

Neither check was done, and the source says so.

### The sign of the second period

`EllipticIntegrals.m2:380-381` still asserts a **negative** imaginary part for `D.Period'`,
byte-identical to the file, under a live comment:

```m2
-* actually, the paper has the complex conjugate of this period ... *-
```

against Grayson's 1989 *Archiv der Mathematik* period cited at `:15-18`. Two neighbouring assertions
dodge the question with `abs` (`:320`, `:322`).

The real part drifted from `.0p200` to `2.37e-66` in `28a631f318` (2026-05-19) — a test repinned to new
`sqrt(CC)` output rather than an answer, and below the noise floor at 200 bits anyway.

### The branch cuts were never looked at

`git grep "branch cut"` is empty tree-wide, and `E.log` (`:226`) still picks quadratic roots by
magnitude — `quadnorm eqn' > quadnorm eqn` at `:239` — with no stated convention.

### One part of the file is settled

Its `{* *}` comment syntax: `f2c87ac678` converted this very file, and `bc59b7532b` made the old syntax
a hard lexer error (`d/lex.d:308-309`).

### Related

**#4416** is the neighbouring arithmetic-geometric-mean question, about infinite arguments.

`open` · disposition `issue` · source of truth: [`bug-triage/catalog.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/catalog.tsv)

Contributor guide

No contributing guide indexed for this repository

Research direction

Read EllipticIntegrals.m2:226 and :239 to understand E.log's root-selection rule, then inspect the Period' assertions at :380-381 and the cited paper at :15-18. Reproduce the current checks and establish the intended period sign and branch-cut behavior; done means both questions have documented, passing checks.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.