All I want to do is numerically map the upper-half plane $\mathbb H:=\{z\in\mathbb C:\Im(z)>0\}$ to the unit square $[0,1)^2$. How this can be done is described in the Wikipedia article of the Schwarz-Christoffel mapping.$^1$ The mapping is given by $$f(z)=\int^z\frac1{\sqrt{\zeta(1-\zeta^2)}}\:{\rm d}\zeta.$$
Now the C++ standard only contains the function ellint_1 (see https://en.cppreference.com/w/cpp/experimental/special_functions), which computes an incomplete elliptic integral of the first kind with a real argument. So, in order to implement my mapping, it would be helpful to rewrite it as a sum of real and imaginary parts.
In the book of Abramowitz and Stegun, there is a formula which allows us to rewirte the incomplete elliptic integral of the first kind as a sum of real and imaginary parts:
However, I don't even understand the implicit equations (due to some print error maybe?). So, if anyone could clarify how we exactly need to apply this, I would be really thankful.
In the Handbook of Elliptic Integrals for Engineers and Scientists , there is a different formula:
However, since I have no idea what $k'$ is or how we can determine it, I again don't know how to implement this.
$^1$ But without a reference and I wasn't able to find a proof in the literature ... In the literature, I only find other formulas which are claimed to map $\mathbb H$ to a rectangle. Not only that, they somehow seem to map points on the real line (the border of $\mathbb H$) to the vertices of the rectange ... That's confusing to me, since shouldn't we map $-\infty$ to $(0,0)$, $\infty$ to $(0,1)$ and $\infty+{\rm i}\infty$ to $(1,1)$?



The answer is given in some posts linked to yours by MSE.
Another way is to use the Carlson $RF$ integral, which is easy to implement. Here is my Asymptote implementation. The Asymptote language is close to C++. The
pairtype is the type for complex numbers.