Reda and Andreas 2008 from the National Renewable Energy Laboratory published a sun position algorithm with a reported uncertainty of +/- 0.0003 degrees. The report is available from NREL at this link. NREL has developed an implementation of the algorithm in C. License information is available at this link.