added checks for type and dimension compability in maths intrinsic functions