The Walsh matrix is an interesting fractal matrix with the property that every single value in a Walsh matrix has a value of either -1 or 1. Additionally, the size of a Walsh matrix is always a power of 2.
Because each Walsh matrix is identical to the top-left quarter of the immediately higher-order Walsh matrix, we can create a generalized "infinite Walsh matrix" by considering the limit of the sequence of Walsh matrices of order N, as N goes to infinity. From here on, we will call this infinite generalization the Walsh matrix.
Your task is to build a program that takes the coordinates of a location in the Walsh matrix and returns the value that occurs there.
Your program will accept two integers
y as input (in any form you choose), and output the value that appears in the
x+1th row of the
y+1th column of the Walsh matrix. For example, the input
1, as the 3rd row in the 6th column of the Walsh matrix has a value of 1. The input
-1, as the 7th row in the 5th column of the Walsh matrix has a value of -1. The input
-1, as the 2384720th row of the 394803rd column has a value of -1.
The shortest code to do this in any language wins.