On this line:
if a(z)>=Twin*ors+Twin && b(z)==Twin*ors
you are assuming that you can test for exact equivalence of binary floating point values. That is rarely a good approach. The robust approach is to compare the absolute different against a tolerance:
abs(A-B)<tol
Read about the nature of working with binary floating point numbers:
This is highly recommended: