#include <bits/stdc++.h>
const int M = 1005;
int read() {
  int x = 0, flag = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x * flag;
}
int n, m, x, y;
double f[M], a[M][M], b[M];
double frac(double a, double b) { return a * 1.0 / b; }
void build() {
  a[1][1] = -frac(2, 3);
  a[1][2] = frac(1, 3);
  a[m][m - 1] = frac(1, 3);
  a[m][m] = -frac(2, 3);
  b[1] = -frac(f[1], 3) - 1;
  b[m] = -frac(f[m], 3) - 1;
  for (int i = 2; i < m; i++) {
    a[i][i - 1] = a[i][i + 1] = frac(1, 4);
    a[i][i] = -frac(3, 4);
    b[i] = -frac(f[i], 4) - 1;
  }
}
void gauss() {
  for (int i = 1; i < m; i++) {
    double rt = a[i + 1][i] / a[i][i];
    a[i + 1][i] -= rt * a[i][i];
    a[i + 1][i + 1] -= rt * a[i][i + 1];
    b[i + 1] -= rt * b[i];
  }
  f[m] = b[m] / a[m][m];
  for (int i = m - 1; i >= 1; i--) {
    f[i] = (b[i] - f[i + 1] * a[i][i + 1]) / a[i][i];
  }
}
int main() {
  n = read();
  m = read();
  x = read();
  y = read();
  if (m == 1) {
    printf("%.10lf\n", (n - x) * 2.0);
    return 0;
  }
  for (int i = n - 1; i >= x; i--) {
    build();
    gauss();
  }
  printf("%.10lf\n", f[y]);
}
