Recover Lie algebra bracket from the root system

I have coordinates of the $n$ roots in the $d$-dimensional space forming the root system of the $(n+d)$-dimensional Lie algebra. I want to implement the algorithm to recover the Lie bracket of the algebra.

1. The Lie bracket between the elements of the Cartan subalgebra is, by definition, zero: $$[x_i, x_j] = 0.$$
2. The Lie bracket between the $i$-th cartan subalgebra element and a root element is equal to the $i$-th coordinate of the root times the root element: $$[x_i, e_{\vec{\alpha}}] = \vec{\alpha}_i \cdot e_{\vec{\alpha}}.$$
3. How do I recover the Lie bracket between two roots? It can be shown to be proportional to the root element corresponding to the vector addition in the root space. I am interested in the proportionality coefficient.

Question: given two roots $\vec{\alpha}$ and $\vec{\beta}$ what is the easiest way to compute the proportionality coefficient $c$ in

$$[e_{\vec{\alpha}},\, e_{\vec{\beta}}] = c \cdot e_{\vec{\alpha}+\vec{\beta}}.$$

Update: question 2: when $\vec{\beta} = - \vec{\alpha}$ the Lie bracket is proportional to the linear combination of the Cartan subalgebra elements, right? Is it only true if $\vec{\beta} = - \vec{\alpha}$? How to calculate the proportionality coefficients (are they just coordinates of the root vector)?

P.S. I know this involves solving the recursive relation, but I am just looking for a general "easy to use" formula or rule for $c$.

If I'm not mistaken, what you are looking for is naturally set in what is usually called a Chevalley basis and, in particular, Chevalley's structure constants $N_{\alpha, \beta}$. Up to their signs, they are determined relatively easily from the root system, as we have
$(N_{\alpha, \beta})^2 = (r+1)^2$
where $r$ is the maximal integer such that $\beta-r\alpha$ is a root. See most books on that topic or T. Tao's blog entry (lemma 30). Of course we can write this as
$N_{\alpha, \beta} = \pm(r+1)$