nice! I have needed this before. I think you're using the Meeus algorithm from Astronomical Algorithms? it's a classic, great choice
The algorithm in Moontool for Windows [2], which Tiny Moon is based off of, is based off of Meeus' algorithm.
0. https://www.agopax.it/Libri_astronomia/pdf/Astronomical%20Al...