Added a "preview" flag to avoid store or modify variable and functions during preview (just after a return it become effective)
ans is no more assigned if retVal is nan
When name of function is in input the formula is printed.