The following three categories are equivalent:
- Smooth projective algebraic curves over $\mathbb{C}$ and nonconstant algebraic maps.
- Compact connected Riemann surfaces and nonconstant holomorphic maps.
- The opposite of the category of finitely generated field extensions of $\mathbb{C}$ of transcendence degree $1$ and morphisms of extensions of $\mathbb{C}$.
Some of the functors between these are easy to describe. $1 \Rightarrow 2$ is given by taking the underlying complex manifold, and $2 \Rightarrow 3$ is given by taking the field of meromorphic functions. But the proofs that these are equivalences is nontrivial (I think $1 \Leftrightarrow 2$ is hard and I don't remember how hard $2 \Leftrightarrow 3$ is).
In particular, studying finite extensions of $\mathbb{C}(t)$ is equivalent to studying branched covers of $\mathbb{CP}^1$ (in either the algebraic or the holomorphic categories), which is how Galois theory fits into all of this.
I think the reason the formula does not apply is that the singularity is not an "ordinary singularity of multiplicity r" (a.k.a. $r$ distinct lines crossing at a point).
From your second chart, we have a cusp at the origin, and if we blow it up (basically substitute $xz$ for $z$ and factor out an $x^2$ -- this is equivalent to enlarging the coordinate ring by adjoining $z/x$, which is integral over it), we're left with
$$4 x^2 z^4-5 x^2 z^2+x^2-z^2=0$$
And the lowest degree part is $x^2 - z^2 = 0 = (x-z)(x+z)$,
so locally the singularity is now ordinary of multiplicity 2. If this were the entire singularity, we would just be subtracting $1$, but since we also needed the function $z/x$ to resolve the cusp, we also subtract one more.
More details to justify the last part. For any smooth projective curve $C$, let $f: \tilde{C} \to C$ be the normalization. There is a short exact sequence
$0 \to \mathcal{O}_C \to f_*\mathcal{O}_{\tilde{C}} \to F \to 0$,
where $F$ is supported only along the singularities of $C$, and is a finite-length $\mathcal{O}_C$-module. Let its length be $\ell$. The cohomology gives
$0 \to H^0(\mathcal{F}) \to H^1(\mathcal{O}_C) \to H^1(f_*\mathcal{O}_{\tilde{C}}) \to 0$,
so in particular $g_a(C) + \ell = g(\tilde{C})$, where $g_a(C)$ means the arithmetic genus and $g(\tilde{C})$ is the geometric genus. So $\ell$ is basically "how many extra regular functions" the normalization has.
The claim is that $\ell = 2$. Resolving the cusp introduced $z/x$ to the coordinate ring. I think $z/x$ satisfies a quadratic polynomial (this is true at least locally, you can check that
$$ (1-4z^2) (z/x)^2 + (5z^2 - x^2) = 0,$$
and since the leading coefficient doesn't vanish at the origin, this is as good as a monic polynomial.)
So we've only introduced one more function in this step. Then, the second step introduces the $\tfrac{1}{2}r(r-1) = 1$ additional function to separate the two lines.
Best Answer
Let $f \in \mathbb{C}[x_0, x_1, y_0, y_1]$ be a polynomial such that $f(\lambda x_0, \lambda x_1, y_0, y_1) = \lambda^af(x_0, x_1, y_0, y_1)$ and $f(x_0, x_1, \mu y_0, \mu y_1) = \mu^bf(x_0, x_1, y_0, y_1)$, then $$X = \{([x_0, x_1], [y_0, y_1]) \in \mathbb{CP}^1\times\mathbb{CP}^1 \mid f(x_0, x_1, y_0, y_1) = 0\}$$ is a curve. If $X$ is smooth, it has genus $(a-1)(b-1)$, so every genus can be realised. As $\mathbb{CP}^1\times\mathbb{CP}^1$ embeds in $\mathbb{CP}^3$ via the Segre embedding, $X$ is a curve in $\mathbb{CP}^3$.
Another way of constructing curves in a projective space is via complete intersections. Let $f_1, \dots, f_{n-1} \in \mathbb{C}[x_0, \dots, x_n]$ be homogeneous polynomials of degrees $d_1, \dots, d_{n-1}$ respectively, then
$$Y = \{[x_0, \dots, x_n] \in \mathbb{CP}^n \mid f_1(x_0, \dots, x_n) = \dots = f_{n-1}(x_0, \dots, x_n) = 0\}$$
is a curve. If $Y$ is smooth, it has genus $1 - \frac{1}{2}(n + 1 - d_1 - \dots - d_{n-1})d_1\dots d_{n-1}$. This construction gives rise to many genera that don't appear in the degree-genus formula, but not all of them: see this sequence. For example, there is no choice of dimension $n$ and degrees $d_1, \dots, d_{n-1}$ which give rise to a genus two curve, i.e. a genus two curve is not a complete intersection.