Skip to content

Implement apparent sidereal time (equation of the equinoxes)#12

Open
MattBlack85 wants to merge 3 commits intomainfrom
claude/implement-sidereal-time-YGcjd
Open

Implement apparent sidereal time (equation of the equinoxes)#12
MattBlack85 wants to merge 3 commits intomainfrom
claude/implement-sidereal-time-YGcjd

Conversation

@MattBlack85
Copy link
Copy Markdown
Owner

Add get_apparent_sidereal_time_from_date() to sidereal_time.rs.
Apparent sidereal time = mean sidereal time + Δψ cos ε, where Δψ is
nutation in longitude and ε is the true obliquity of the ecliptic
(Meeus, Astronomical Algorithms 2nd ed., Ch. 12, p. 87-88).

Also adds mean_obliquity() helper (Meeus eq. 22.2), a test against
Example 12.a (1987 April 10), and a Criterion benchmark.

claude added 3 commits March 27, 2026 19:19
Add get_apparent_sidereal_time_from_date() to sidereal_time.rs.
Apparent sidereal time = mean sidereal time + Δψ cos ε, where Δψ is
nutation in longitude and ε is the true obliquity of the ecliptic
(Meeus, Astronomical Algorithms 2nd ed., Ch. 12, p. 87-88).

Also adds mean_obliquity() helper (Meeus eq. 22.2), a test against
Example 12.a (1987 April 10), and a Criterion benchmark.
Replace the full 63-term IAU 1980 nutation series (126 trig calls) with
the 4-term approximation from Meeus p. 88 (4 sin + 1 cos). Accurate to
~0.5" (~0.03s of time), which is sufficient for sidereal time purposes.
Drops the nutation module dependency from sidereal_time.rs entirely.
…accuracy

Replace the 4-term approximation with the full 63-term IAU 1980 nutation
series, keeping accuracy while optimizing with three techniques:

- Skip delta_eps/cos accumulation entirely (only Δψ is needed for the
  equation of the equinoxes) — halves trigonometric calls vs get_nutation
- FMA (mul_add) chains for all argument and amplitude arithmetic
- AVX2 SIMD (delta_psi_avx2_fma): batches arg computation and amplitude
  accumulation 4 rows at a time using _mm256_fmadd_pd; sin is still
  evaluated per-lane (std has no vectorised trig)

Also tightens get_nutation to use sin_cos() so both components share
a single trig call per row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants