Low Precision Formula for Sun Position

Algorithm from the Astronomical Almanac, page C5 (2017 ed). Accuracy 1deg from 1950-2050.

Compute Geocentric RA/DEC of Sun.
JD:
RA: Hours
DEC: Degrees

//Low precision sun position from Astronomical Almanac page C5 (2017 ed).
//Accuracy 1deg from 1950-2050
function sunPosition(jd)	{
	const torad=Math.PI/180.0;
	n=jd-2451545.0;
	L=(280.460+0.9856474*n)%360;
	g=((375.528+.9856003*n)%360)*torad;
	if(L<0){L+=360;}
	if(g<0){g+=Math.PI*2.0;}

	lamba=(L+1.915*Math.sin(g)+0.020*Math.sin(2*g))*torad;
	beta=0.0;
	eps=(23.439-0.0000004*n)*torad;
	ra=Math.atan2(Math.cos(eps)*Math.sin(lamba),Math.cos(lamba));
	dec=Math.asin(Math.sin(eps)*Math.sin(lamba));
	if(ra<0){ra+=Math.PI*2;}
	return [ra/torad/15.0,dec/torad];
}