Check out the sidereal code in Lady Heather (it's in heathmsc.cpp) and see if anything looks usable. Heather uses double precision floating point for all the time functions. To display sidereal times set the time zone to GMST, GMAT, LMST, or LAST. Also, if you are doing integer arithmetic, check very carefully for overflows, etc.