So you are using a tool that builds a single valued function to fit something that is obviously not. What did you expect? Magic?
Software does what it is programmed to do. It does not magically rewrite itself when you give it a problem of a completely different sort. In fact, I fail to understand why you would downrate a tool for not solving a class of problem it is explicitly not designed to solve.
If you have a closed manifold, like a ball or some other multivalued form, then don't use this tool. I have NEVER claimed it would solve that problem. Instead, you might look into tools like convex hulls, alpha shapes, CRUST, etc. Or, you might choose to convert the problem into spherical coordinates, at which point gridfit would be able to build a viable surface.
Or maybe you just wanted to complain with no good reason.
VPI uses a Pollard rho algorithm for factoring. While it is significantly better than MATLAB's builtin factor tool, which can only handle numbers as large as about 10 digits or so, the scheme I used is often ineffectual on numbers that are the product of two seriously large primes. Of course, that is a difficult problem in general, else many of the encryption schemes in common use today would fail miserably.
One of my goals has been to re-write factor to use a better scheme, but until then I should put in a warning message when factor has failed to resolve a composite number fully into its prime factors.
So you did nothing wrong here, except to give factor a number too large for it to handle.
First, great tools!
Second, what am I doing wrong?
>> p1 = vpi('40094690950920881030683735292761468389214899724061')
>> p2 = vpi('37975227936943673922808872755445627854565536638199')
p2 = 37975227936943673922808872755445627854565536638199
It should give p1 and p2...