Algorithm from the Astronomical Almanac, page C5 (2017 ed). Accuracy 1deg from 1950-2050.
//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=((357.528+.9856003*n)%360)*torad;
if(L<0){L+=360;}
if(g<0){g+=Math.PI*2.0;}
lambda=(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(lambda),Math.cos(lambda));
dec=Math.asin(Math.sin(eps)*Math.sin(lambda));
if(ra<0){ra+=Math.PI*2;}
return [ra/torad/15.0,dec/torad];
}