if ((long) x * 128L > y * 2L)
  return map[quadrant][0];      // tan(0.5)*128
if ((long) x * 128L > y * 5L)
  return map[quadrant][1];      // tan(1.5)*128
if ((long) x * 128L > y * 8L)
  return map[quadrant][2];      // tan(2.5)*128
if ((long) x * 128L > y * 11L)
  return map[quadrant][3];      // tan(3.5)*128
if ((long) x * 128L > y * 14L)
  return map[quadrant][4];      // tan(4.5)*128
if ((long) x * 128L > y * 17L)
  return map[quadrant][5];      // tan(5.5)*128
if ((long) x * 128L > y * 21L)
  return map[quadrant][6];      // tan(6.5)*128
if ((long) x * 128L > y * 24L)
  return map[quadrant][7];      // tan(7.5)*128
if ((long) x * 128L > y * 27L)
  return map[quadrant][8];      // tan(8.5)*128
if ((long) x * 128L > y * 30L)
  return map[quadrant][9];      // tan(9.5)*128
if ((long) x * 128L > y * 34L)
  return map[quadrant][10];     // tan(10.5)*128
if ((long) x * 128L > y * 37L)
  return map[quadrant][11];     // tan(11.5)*128
if ((long) x * 128L > y * 41L)
  return map[quadrant][12];     // tan(12.5)*128
if ((long) x * 128L > y * 44L)
  return map[quadrant][13];     // tan(13.5)*128
if ((long) x * 128L > y * 48L)
  return map[quadrant][14];     // tan(14.5)*128
if ((long) x * 128L > y * 51L)
  return map[quadrant][15];     // tan(15.5)*128
if ((long) x * 128L > y * 55L)
  return map[quadrant][16];     // tan(16.5)*128
if ((long) x * 128L > y * 59L)
  return map[quadrant][17];     // tan(17.5)*128
if ((long) x * 128L > y * 62L)
  return map[quadrant][18];     // tan(18.5)*128
if ((long) x * 128L > y * 66L)
  return map[quadrant][19];     // tan(19.5)*128
if ((long) x * 128L > y * 70L)
  return map[quadrant][20];     // tan(20.5)*128
if ((long) x * 128L > y * 75L)
  return map[quadrant][21];     // tan(21.5)*128
if ((long) x * 128L > y * 79L)
  return map[quadrant][22];     // tan(22.5)*128
if ((long) x * 128L > y * 83L)
  return map[quadrant][23];     // tan(23.5)*128
if ((long) x * 128L > y * 88L)
  return map[quadrant][24];     // tan(24.5)*128
if ((long) x * 128L > y * 93L)
  return map[quadrant][25];     // tan(25.5)*128
if ((long) x * 128L > y * 97L)
  return map[quadrant][26];     // tan(26.5)*128
if ((long) x * 128L > y * 102L)
  return map[quadrant][27];     // tan(27.5)*128
if ((long) x * 128L > y * 108L)
  return map[quadrant][28];     // tan(28.5)*128
if ((long) x * 128L > y * 113L)
  return map[quadrant][29];     // tan(29.5)*128
if ((long) x * 128L > y * 119L)
  return map[quadrant][30];     // tan(30.5)*128
if ((long) x * 128L > y * 125L)
  return map[quadrant][31];     // tan(31.5)*128
if ((long) x * 128L > y * 131L)
  return map[quadrant][32];     // tan(32.5)*128
if ((long) x * 128L > y * 138L)
  return map[quadrant][33];     // tan(33.5)*128
if ((long) x * 128L > y * 145L)
  return map[quadrant][34];     // tan(34.5)*128
if ((long) x * 128L > y * 152L)
  return map[quadrant][35];     // tan(35.5)*128
if ((long) x * 128L > y * 160L)
  return map[quadrant][36];     // tan(36.5)*128
if ((long) x * 128L > y * 168L)
  return map[quadrant][37];     // tan(37.5)*128
if ((long) x * 128L > y * 177L)
  return map[quadrant][38];     // tan(38.5)*128
if ((long) x * 128L > y * 187L)
  return map[quadrant][39];     // tan(39.5)*128
if ((long) x * 128L > y * 197L)
  return map[quadrant][40];     // tan(40.5)*128
if ((long) x * 128L > y * 208L)
  return map[quadrant][41];     // tan(41.5)*128
if ((long) x * 128L > y * 220L)
  return map[quadrant][42];     // tan(42.5)*128
if ((long) x * 128L > y * 233L)
  return map[quadrant][43];     // tan(43.5)*128
if ((long) x * 128L > y * 247L)
  return map[quadrant][44];     // tan(44.5)*128
if ((long) x * 64L > y * 131L)
  return map[quadrant][45];     // tan(45.5)*64
if ((long) x * 64L > y * 140L)
  return map[quadrant][46];     // tan(46.5)*64
if ((long) x * 64L > y * 149L)
  return map[quadrant][47];     // tan(47.5)*64
if ((long) x * 64L > y * 160L)
  return map[quadrant][48];     // tan(48.5)*64
if ((long) x * 64L > y * 172L)
  return map[quadrant][49];     // tan(49.5)*64
if ((long) x * 64L > y * 186L)
  return map[quadrant][50];     // tan(50.5)*64
if ((long) x * 64L > y * 202L)
  return map[quadrant][51];     // tan(51.5)*64
if ((long) x * 64L > y * 221L)
  return map[quadrant][52];     // tan(52.5)*64
if ((long) x * 64L > y * 243L)
  return map[quadrant][53];     // tan(53.5)*64
if ((long) x * 32L > y * 135L)
  return map[quadrant][54];     // tan(54.5)*32
if ((long) x * 32L > y * 151L)
  return map[quadrant][55];     // tan(55.5)*32
if ((long) x * 32L > y * 172L)
  return map[quadrant][56];     // tan(56.5)*32
if ((long) x * 32L > y * 199L)
  return map[quadrant][57];     // tan(57.5)*32
if ((long) x * 32L > y * 236L)
  return map[quadrant][58];     // tan(58.5)*32
if ((long) x * 16L > y * 144L)
  return map[quadrant][59];     // tan(59.5)*16
if ((long) x * 16L > y * 186L)
  return map[quadrant][60];     // tan(60.5)*16
if ((long) x * 8L > y * 130L)
  return map[quadrant][61];     // tan(61.5)*8
if ((long) x * 8L > y * 217L)
  return map[quadrant][62];     // tan(62.5)*8
if ((long) x * 2L > y * 163L)
  return map[quadrant][63];     // tan(63.5)*2
else
  return map[quadrant][64];     // tan(64.0)
if ((long) x * 128L > y * 131L) {
  if ((long) x * 64L > y * 160L) {
    if ((long) x * 32L > y * 172L) {
      if ((long) x * 16L > y * 186L) {
        if ((long) x * 8L > y * 217L) {
          if ((long) x * 2L > y * 163L)
            return map[quadrant][64];   // tan(64.5)*2
          else
            return map[quadrant][63];   // tan(63.5)*2
        } else {
          if ((long) x * 8L > y * 130L)
            return map[quadrant][62];   // tan(62.5)*8
          else
            return map[quadrant][61];   // tan(61.5)*8
        }
      } else {
        if ((long) x * 32L > y * 236L) {
          if ((long) x * 16L > y * 144L)
            return map[quadrant][60];   // tan(60.5)*16
          else
            return map[quadrant][59];   // tan(59.5)*16
        } else {
          if ((long) x * 32L > y * 199L)
            return map[quadrant][58];   // tan(58.5)*32
          else
            return map[quadrant][57];   // tan(57.5)*32
        }
      }
    } else {
      if ((long) x * 64L > y * 221L) {
        if ((long) x * 32L > y * 135L) {
          if ((long) x * 32L > y * 151L)
            return map[quadrant][56];   // tan(56.5)*32
          else
            return map[quadrant][55];   // tan(55.5)*32
        } else {
          if ((long) x * 64L > y * 243L)
            return map[quadrant][54];   // tan(54.5)*64
          else
            return map[quadrant][53];   // tan(53.5)*64
        }
      } else {
        if ((long) x * 64L > y * 186L) {
          if ((long) x * 64L > y * 202L)
            return map[quadrant][52];   // tan(52.5)*64
          else
            return map[quadrant][51];   // tan(51.5)*64
        } else {
          if ((long) x * 64L > y * 172L)
            return map[quadrant][50];   // tan(50.5)*64
          else
            return map[quadrant][49];   // tan(49.5)*64
        }
      }
    }
  } else {
    if ((long) x * 128L > y * 197L) {
      if ((long) x * 128L > y * 247L) {
        if ((long) x * 64L > y * 140L) {
          if ((long) x * 64L > y * 149L)
            return map[quadrant][48];   // tan(48.5)*64
          else
            return map[quadrant][47];   // tan(47.5)*64
        } else {
          if ((long) x * 64L > y * 131L)
            return map[quadrant][46];   // tan(46.5)*64
          else
            return map[quadrant][45];   // tan(45.5)*64
        }
      } else {
        if ((long) x * 128L > y * 220L) {
          if ((long) x * 128L > y * 233L)
            return map[quadrant][44];   // tan(44.5)*128
          else
            return map[quadrant][43];   // tan(43.5)*128
        } else {
          if ((long) x * 128L > y * 208L)
            return map[quadrant][42];   // tan(42.5)*128
          else
            return map[quadrant][41];   // tan(41.5)*128
        }
      }
    } else {
      if ((long) x * 128L > y * 160L) {
        if ((long) x * 128L > y * 177L) {
          if ((long) x * 128L > y * 187L)
            return map[quadrant][40];   // tan(40.5)*128
          else
            return map[quadrant][39];   // tan(39.5)*128
        } else {
          if ((long) x * 128L > y * 168L)
            return map[quadrant][38];   // tan(38.5)*128
          else
            return map[quadrant][37];   // tan(37.5)*128
        }
      } else {
        if ((long) x * 128L > y * 145L) {
          if ((long) x * 128L > y * 152L)
            return map[quadrant][36];   // tan(36.5)*128
          else
            return map[quadrant][35];   // tan(35.5)*128
        } else {
          if ((long) x * 128L > y * 138L)
            return map[quadrant][34];   // tan(34.5)*128
          else
            return map[quadrant][33];   // tan(33.5)*128
        }
      }
    }
  }
} else {
  if ((long) x * 128L > y * 55L) {
    if ((long) x * 128L > y * 88L) {
      if ((long) x * 128L > y * 108L) {
        if ((long) x * 128L > y * 119L) {
          if ((long) x * 128L > y * 125L)
            return map[quadrant][32];   // tan(32.5)*128
          else
            return map[quadrant][31];   // tan(31.5)*128
        } else {
          if ((long) x * 128L > y * 113L)
            return map[quadrant][30];   // tan(30.5)*128
          else
            return map[quadrant][29];   // tan(29.5)*128
        }
      } else {
        if ((long) x * 128L > y * 97L) {
          if ((long) x * 128L > y * 102L)
            return map[quadrant][28];   // tan(28.5)*128
          else
            return map[quadrant][27];   // tan(27.5)*128
        } else {
          if ((long) x * 128L > y * 93L)
            return map[quadrant][26];   // tan(26.5)*128
          else
            return map[quadrant][25];   // tan(25.5)*128
        }
      }
    } else {
      if ((long) x * 128L > y * 70L) {
        if ((long) x * 128L > y * 79L) {
          if ((long) x * 128L > y * 83L)
            return map[quadrant][24];   // tan(24.5)*128
          else
            return map[quadrant][23];   // tan(23.5)*128
        } else {
          if ((long) x * 128L > y * 75L)
            return map[quadrant][22];   // tan(22.5)*128
          else
            return map[quadrant][21];   // tan(21.5)*128
        }
      } else {
        if ((long) x * 128L > y * 62L) {
          if ((long) x * 128L > y * 66L)
            return map[quadrant][20];   // tan(20.5)*128
          else
            return map[quadrant][19];   // tan(19.5)*128
        } else {
          if ((long) x * 128L > y * 59L)
            return map[quadrant][18];   // tan(18.5)*128
          else
            return map[quadrant][17];   // tan(17.5)*128
        }
      }
    }
  } else {
    if ((long) x * 128L > y * 27L) {
      if ((long) x * 128L > y * 41L) {
        if ((long) x * 128L > y * 48L) {
          if ((long) x * 128L > y * 51L)
            return map[quadrant][16];   // tan(16.5)*128
          else
            return map[quadrant][15];   // tan(15.5)*128
        } else {
          if ((long) x * 128L > y * 44L)
            return map[quadrant][14];   // tan(14.5)*128
          else
            return map[quadrant][13];   // tan(13.5)*128
        }
      } else {
        if ((long) x * 128L > y * 34L) {
          if ((long) x * 128L > y * 37L)
            return map[quadrant][12];   // tan(12.5)*128
          else
            return map[quadrant][11];   // tan(11.5)*128
        } else {
          if ((long) x * 128L > y * 30L)
            return map[quadrant][10];   // tan(10.5)*128
          else
            return map[quadrant][9];    // tan(9.5)*128
        }
      }
    } else {
      if ((long) x * 128L > y * 14L) {
        if ((long) x * 128L > y * 21L) {
          if ((long) x * 128L > y * 24L)
            return map[quadrant][8];    // tan(8.5)*128
          else
            return map[quadrant][7];    // tan(7.5)*128
        } else {
          if ((long) x * 128L > y * 17L)
            return map[quadrant][6];    // tan(6.5)*128
          else
            return map[quadrant][5];    // tan(5.5)*128
        }
      } else {
        if ((long) x * 128L > y * 8L) {
          if ((long) x * 128L > y * 11L)
            return map[quadrant][4];    // tan(4.5)*128
          else
            return map[quadrant][3];    // tan(3.5)*128
        } else {
          if ((long) x * 128L > y * 5L) {
            return map[quadrant][2];    // tan(2.5)*128 hi==lo
          } else {
            if ((long) x * 128L > y * 2L)
              return map[quadrant][1];  // tan(1.5)*128
            else
              return map[quadrant][0];  // tan(0.5)*128
          }
        }
      }
    }
  }
}
