#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ch = getchar(), f = 0;
  int x = 0;
  while (ch < '0' || ch > '9') {
    f |= ch == '-';
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f ? -x : x;
}
int n, m, x, y;
double f[1005], a[1005][1005];
int main() {
  n = read(), m = read();
  x = read(), y = read();
  for (int i = n - 1; i >= x; i--) {
    if (m > 1)
      a[1][1] = a[m][m] = -2 / (double)3, a[1][2] = a[m][m - 1] = 1 / (double)3,
      a[1][m + 1] = -1 / (double)3 * (f[1]) - 1,
      a[m][m + 1] = -1 / (double)3 * (f[m]) - 1;
    else
      a[1][1] = -1 / (double)2, a[1][2] = -1 / (double)2 * (f[m]) - 1;
    for (int j = 2; j < m; j++)
      a[j][j] = -3 / (double)4, a[j][j - 1] = 1 / (double)4,
      a[j][j + 1] = 1 / (double)4, a[j][m + 1] = -1 / (double)4 * (f[j]) - 1;
    for (int j = 1; j <= m; j++) {
      if (j < m) a[j][m + 1] /= a[j][j];
      a[j][j + 1] /= a[j][j], a[j][j] = 1;
      if (j < m)
        a[j + 1][j + 1] -= a[j][j + 1] * a[j + 1][j],
            a[j + 1][m + 1] -= a[j][m + 1] * a[j + 1][j], a[j + 1][j] = 0;
    }
    f[m] = a[m][m + 1];
    for (int j = m - 1; j; j--) f[j] = a[j][m + 1] - a[j][j + 1] * f[j + 1];
  }
  printf("%.10lf\n", f[y]);
  return 0;
}
