It is very likely that Point3D is somehow an alias for SVector, and the source of type instability is rprime (in result = r - rprime), which is some leftover from the running session (of type Any) and should be r_prime instead.
2 Likes