A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
From: Andrew Nikitin
Date: 2016 Feb 24, 08:21 -0800
Frank, you are spot on in pinpointing the source of the problem.
I, however would like to suggest slightly different interpretation on what happened.
Here is an excerpt (one of several) which causes problems in Henning's code:
// Mean longitude of the moon
Lmoon_mean = trunc(218.3164591+481267.88134236*TE-0.0013268*TE2+TE3/538841-TE4/65194000);
//Mean elongation of the moon
D = trunc(297.8502042+445267.1115168*TE-0.00163*TE2+TE3/545868-TE4/113065000);