I am going to move some of the content from the above comments into an answer in order to provide a possible resolution for this question.
I don’t think you can you use Calc functions in BASIC. Even changing the first line to:
IMPARA (x as string, y as string) as Var_Type
…gives the same error. It sounds like it is unhappy with the IMDIV(), IMPRODUCT(), and IMSUM() functions as being ‘not defined’. Complex numbers (e.g., “-10+8i”) are treated as strings, so the function needs to parse the arguments into real and imaginary parts, convert these parts to numbers, do the math, and then re-create the string (answer) to be returned.