You're comparing string references rather than their values, and you want String.equals()
e.g. z.equals(result)
However, I think what you're trying to do is compare two decimal numbers to a certain precision. It's more intuitive to calculate the difference and determine if that's within an acceptable error bound e.g.
if (Math.abs(z - result) < 0.01) {
// ok
}
See Math.abs(double a) for more details