Rough y(x) approximation for simplified Cubic Bezier curve I need to get a very rough (and fast) $y(x)$ approximation of a simplified Cubic Bezier curve to use in my animation code, where there's only one control variable:
$$
P_0 = (0, 0)\\
P_1 = (0, 0)\\
P_2 = (k, 1)\\
P_3 = (1, 1)\\
$$
The curve looks like this: http://cubic-bezier.com/#0,0,.25,1 (here $k = 0.25$)
With these control points, I get the following parametric Cubic Bezier equation (with $t = 0..1$):
$$
x(t) = 3k (1-t) t^2 + t^3\\
y(t) = 3 (1-t) t^2 + t^3
$$
Or, in other representation:
\begin{aligned}
x(t) = (1 - 3k) t^3 + 3k t^2\\
y(t) = -2 t^3 + 3 t^2
\end{aligned}
How do I get a very very rough and simple $y(x)$ approximation for the given $k$ (0..1 too)? Solving the system is too difficult, and binary search is not suitable here because it's too slow. I've been banging my head around this for quite some time... Any ideas?
update: the approximation needs to be done in such way so that the curve is convex, like on the example, and starting/ending angles are approximately the same. Tried 3-point and 4-point Lagrange interpolating polynomials with no luck (see comments)...
update 2: discovered De Casteljau's algorithm, but it still seems too complex and slow for my needs. I need a really rough approximation within the constraints, and visually it looks simple, but on practice...
 A: Did you try to optimise it firs?
$$
x(t)=3k(1−t)t2+t3\\
y(t)=3(1−t)t2+t3
$$
means you do:
$$
a = t^{2}\\
b = at\\
c = 3(1-k)a
$$
so
$$
x(t) = kc+b\\
y(t) = c+b
$$
you can go deeper :)
A: How about this one:
real F(real x)
{
real y0=3*exp(2/3*log(x))-2*x, y13=3*x-2*x*sqrt(x), y1=x;
if(k<1/3)
{
real w=3*k; w-=(5.5*x*(1-x)-1)*w*(1-w);
return w*y13+(1-w)*y0;
}
else
{
real w=(3*k-1)/2; w-=(2*x-1+3*w*x^12)*w*(1-w);
return w*y1+(1-w)*y13;
}
}

I admit that exponents and logarithms are a bit slow but, perhaps, the precision is reasonable.
A: What about a clamped cubic spline with three knots and two slopes? The three knots are
\begin{align}
\left(x(0),y(0)\right)&=(0,0),\\
\left(x(0.5),y(0.5)\right)&=\left(\frac{3k+1}{8},\frac12\right)\\
\left(x(1),y(1)\right)&=(1,1).
\end{align}
And the slopes can be derived from
\begin{align}
\frac{dx}{dt}&=(1-3k)3t^2 + 6kt=3(1-k)t^2+6kt(1-t^2)\ge0,\\
\frac{dy}{dt}&=-6t^2+6t.
\end{align}
So $x(t)$ is monotonic increasing function in $t$ and the two tangent directions are given by:
\begin{align}
\left.\frac{dy}{dx}\right|_{x=0} &= \frac1k,\\
\left.\frac{dy}{dx}\right|_{x=1} &= 0.
\end{align}
See this, for instance, for how to construct a clamped cubic spline given the knots and tangent directions. If cubic splines are too complicated, you may try a quadratic spline, or even interpolate $y(x)$ using the single quadratic function that passes through $(x(0),y(0)),(x(0.5),y(0.5))$ and $(x(1),y(1))$. At any rate, note that your interpolant is not only a function in $x$, but also a function in $k$.
A: OK, I came up with a very rough approximation using simple Penner's equations:
$$
y(x) = 1 - (1 - x)^{1/max(k,0.2)}
$$
Not sure if it's the best way but it seems to be working OK.
