I have a curve in the complex plane given by $$ f(t) = \sum_k r_k\exp(2\pi\mathrm{i}(t+\varphi_k)p_k). $$ Some of the parameters are specially chosen: $r_k>0$, $\sum_k r_k=1$, $p_k\in\mathbb{Z}$, $\mathrm{gcd}(p\ldots)=1$, $\varphi_k\in\mathbb{R}$. These restrictions are probably not very important for this question.
When I plot the curve, it will sometimes have some self-kissing points: points $t_1$ and $t_2$ where $f(t_1)=f(t_2)$ and $f'(t_1)\parallel f'(t_2)$. A self-kissing point doesn't have to be a self-crossing: at the self-intersection with parallel tangent vectors, the normal vectors can be pointing the opposite ways.
Can anybody suggest a good method for finding such points? I can't seem to think of a real-valued function that changes sign at the self-kissing point. I would like to be able to find these points once every frame in an animation, so efficiency can be an issue. If you can suggest a reference for this, that helps too.
Edit Direct root finding doesn't work because such a point would be a multiple root and the curve might come close to touching itself without doing so to numerical accuracy. Optimizing a function like $|f(t_1)-f(t_2)|^2$ doesn't work: it has many spurious critical points. Splitting the interval $[0,1]$ into $N$ parts and treating the curve as approximately quadratic inside each interval also doesn't work because there are two variables in $f(t_1)-f(t_2)$, and so requires $O(N^2)$ work, which is too much. (Although when looking for self-intersection points instead, this can work because of efficient line segment intersection algorithms.)