public static function Taiutc($tai1, $tai2, &$utc1, &$utc2) {
    $big1;
    $i;
    $j;
    $a1;
    $a2;
    $u1;
    $u2;
    $g1;
    $g2;

    /* Put the two parts of the TAI into big-first order. */
    $big1 = ( $tai1 >= $tai2 );
    if ($big1) {
      $a1 = $tai1;
      $a2 = $tai2;
    }
    else {
      $a1 = $tai2;
      $a2 = $tai1;
    }

    /* Initial guess for UTC. */
    $u1 = $a1;
    $u2 = $a2;

    /* Iterate (though in most cases just once is enough). */
    for ($i = 0; $i < 3; $i++) {

      /* Guessed UTC to TAI. */
      $j = IAU::Utctai($u1, $u2, $g1, $g2);
      if ($j < 0)
        return $j;

      /* Adjust guessed UTC. */
      $u2 += $a1 - $g1;
      $u2 += $a2 - $g2;
    }

    /* Return the UTC result, preserving the TAI order. */
    if ($big1) {
      $utc1 = $u1;
      $utc2 = $u2;
    }
    else {
      $utc1 = $u2;
      $utc2 = $u1;
    }

    /* Status. */
    return $j;
  }