public static function Gmst82($dj1, $dj2) {
    /* Coefficients of IAU 1982 GMST-UT1 model */
    $A = 24110.54841 - DAYSEC / 2.0;
    $B = 8640184.812866;
    $C = 0.093104;
    $D = -6.2e-6;

    /* Note: the first constant, A, has to be adjusted by 12 hours */
    /* because the UT1 is supplied as a Julian date, which begins  */
    /* at noon.                                                    */

    $d1;
    $d2;
    $t;
    $f;
    $gmst;

    /* Julian centuries since fundamental epoch. */
    if ($dj1 < $dj2) {
      $d1 = $dj1;
      $d2 = $dj2;
    }
    else {
      $d1 = $dj2;
      $d2 = $dj1;
    }
    $t = ($d1 + ($d2 - DJ00)) / DJC;

    /* Fractional part of JD(UT1), in seconds. */
    $f = DAYSEC * (fmod($d1, 1.0) + fmod($d2, 1.0));

    /* GMST at this UT1. */
    $gmst = IAU::Anp(DS2R * (($A + ($B + ($C + $D * $t) * $t) * $t) + $f));

    return $gmst;
  }