Fixes #633

@lamblin . Unit tests to be added.
For this test, it may be better to move it in theano/tensor, and test the elemwise version? It will be easier to test a wider range of values.