I want a function $f(v_{0x}, x_{end}, y_{end})$ that computes the starting velocity component $v_{0y}$ required to make the projectile land at the specified position $(x,y)$.
$v_{0y}$ is thus the initial velocity in vertical $y$-direction. $v_{0x}$ is the constant speed in positive $x$-direction, i.e. the initial horizontal velocity component. $x_{end}$ and $y_{end}$ are the end coordinates for $x$ and $y$ respectively.
I used the equation $\theta=\frac{\pi}{2}-\frac{1}{2}(\frac{\pi}{2}-\alpha)$ where $\alpha$ is the angle for the tangent $y_{end}/x_{end}$. This means that $\alpha=\arctan(y/x)$. Then I can compute the initial velocity $v_{0y}$ by $v_{0y}=\tan(\theta)\cdot v_{0x}$. This is supposed to give the angle for the projectile motion curve with the lowest possible initial velocity according to wikipedia.
To test it out, I compute the $y=v_{0y}\cdot t - g/2\cdot t^2$ as well as $t_{end}=x_{end}/v_{0x}$, but it doesn't reach the correct $y$ at the correct time when I plot it, and it doesn't even reach most positive $y_{end}$ values.
As you mentioned, the angle $\theta = \frac\pi2 - \frac12\left(\frac\pi2 - \alpha\right)$ where $\alpha=\arctan(y/x)$ is the angle at which you should launch the projectile in order to reach the point $(x,y)$ while launching the projectile with the lowest possible initial velocity.
Where you run into trouble with this is due to the condition, "with the lowest possible initial velocity." For a given point $(x,y)$ and a given uniform gravitational field, after you decide to use launch angle $\theta$ there is exactly one initial velocity $v_\min$ that will allow hitting $(x,y)$. If your initial velocity is any greater you will overshoot, and if it is any less you will undershoot.
Since you have decided to use launch angle $\theta$ and the initial velocity must then be $v_\min,$ it follows that the initial horizontal velocity must be $v_\min \cos\theta.$
Now what happens if $v_\min \cos\theta \neq v_{0x}$?
What happens is that the solution doesn't work. You set $v_{0y} = v_{0x} \tan\theta$ and this gives you an initial velocity $v = \sqrt{v_{0x}^2 + v_{0y}^2}$ that is either larger than $v_\min$ or smaller than $v_\min$ (as $v_{0x}$ is either larger or smaller than $v_\min \cos\theta$) and you either overshoot or undershoot.
What you need is a solution that does not restrict you to a "minimum" initial velocity or any other velocity that is not determined by $v_{0x}$.
Here is something for you to consider. Suppose you had a solution to this problem, that is, a formula for $v_{0y}$ given $v_{0x},$ $x_\mathrm{end},$ and $y_\mathrm{end}.$ If you launch your projectile with an initial velocity with components $v_{0x}$ and $v_{0y},$ what is the time at which the projectile with reach the point $(x_\mathrm{end}, y_\mathrm{end})$?
See if this allows you to work out $v_{0y}$.
Here's one more big fat hint. The initial launch angle and the total initial velocity are mere distractions in this problem. All you need to determine is the velocity component $v_{0y}$, and in simple parabolic projectile motion (uniform gravity, no air resistance, no rotation, no curvature of the Earth) the horizontal motion and the vertical motion of the projectile depend only on their respective initial velocities and the amount of time that has passed.