Position of the Sun, Meeus' "low accuracy" method, chapter 25.
Stated error: ~0.01° on the apparent longitude between 1900 and 2100, which is far more than enough to keep rise/set times within the minute.
As for the Moon, every function takes a JDE (Julian day in Terrestrial Time).
Summary
Types
Apparent geocentric solar position.
Functions
Equation of time in minutes (Meeus 28.3).
Altitude of the Sun's center at rise/set: −0.8333°.
Dip of the visible horizon for an observer elevation meters above the
surrounding terrain: ≈ 0.0347·√h degrees. Zero at or below sea level.
Apparent position of the Sun for a JDE.
Conventional twilight altitudes, in degrees.
Types
Functions
Equation of time in minutes (Meeus 28.3).
Example 28.b (1992 October 13, 0h TD): 13 min 42.6 s.
Altitude of the Sun's center at rise/set: −0.8333°.
elevation in meters above the visible horizon lowers this value by the
horizon dip, ≈ 0.0347·√h degrees — about one minute of earlier sunrise
per 100 m.
Dip of the visible horizon for an observer elevation meters above the
surrounding terrain: ≈ 0.0347·√h degrees. Zero at or below sea level.
Apparent position of the Sun for a JDE.
:radius_vector is in astronomical units, :equation_of_time in minutes
of time.
Meeus' example 25.a (1992 October 13, 0h TD):
iex> s = GreenCal.Astro.Sun.position(2_448_908.5)
iex> Float.round(s.longitude, 3) # published: 199.90895
199.909
iex> Float.round(s.declination, 3) # published: -7.78507
-7.785
@spec twilight_altitude(:civil | :nautical | :astronomical) :: float()
Conventional twilight altitudes, in degrees.
iex> GreenCal.Astro.Sun.twilight_altitude(:civil)
-6.0