The Kac-Peterson formula arises from affine Lie algebras. My goal is to prove the formula
$$(R(S))_{\Lambda,\Lambda'}=(-i)^{(d-r)/2}|L_w/L^\vee|^{-1/2}(k^\vee+g^\vee)^{-r/2}\sum_{\bar w\in\bar W} (\text{sign }\bar w)\exp\left(\dfrac{-4\pi i}{(\bar\theta,\bar\theta)} \dfrac{1}{k^\vee+g^\vee}(\bar w(\bar\Lambda+\bar\rho),\bar\Lambda'+\bar\rho)\right)$$
where $S$ is the modular-transform operator associated to the matrix $\begin{pmatrix}0&-1\\1&0\end{pmatrix}$ that sends $\tau$ to $-1/\tau$, $\lambda = (\bar\lambda,k,n)$ is a weight of the affine Lie algebra, $\bar w$ is a Weyl transformation acting on the $\bar\lambda$ part of the weight, i.e. $\bar\lambda \in \bar{\mathfrak {g}}$, $k$ is the level of the affine Lie algebra, $k^\vee = k\dfrac{2}{(\bar\theta,\bar\theta)}$ is the normalized level, $\bar\theta$ is the highest root of $\bar{\mathfrak g}$, and it is known that the following is true for $k^\vee$:
$$k^\vee = \sum_{i=0}^ra_i^\vee \Lambda^i = \Lambda^0 +(\bar\theta^\vee,\bar\Lambda)$$
where $\Lambda = \sum_{i=0}^r \Lambda^i \Lambda_{(i)}$, $\bar\theta = \sum_{i=1}^r a_i\bar\alpha^{(i)}$ where $r$ is the rank of $\bar{\mathfrak g}$, $\bar{\theta}^\vee=\dfrac{2}{(\bar\theta,\bar\theta)}\bar\theta$ and the fundamental weights $\Lambda_{(i)}$ are given by: $$\Lambda_{(i)}=(\bar\Lambda_{(i)},\frac 12(\bar\theta,\bar\theta)a_i^\vee,0)$$
Here $\bar\Lambda_{(i)}$ are the fundamental weights of $\bar{\mathfrak g}$.
The Coxeter number $g$ is given by $$g=\sum_{i=0}^r a_i$$ and the dual Coxeter number $g^\vee$ is given by $$g^\vee=\sum_{i=0}^ra_i^\vee=\dfrac{2}{(\bar\theta,\bar\theta)}\sum_{i=0}^ra_i$$ $\bar\rho$ is the Weyl vector of $\bar{\mathfrak g}$ and is given by $$\bar\rho=\sum_{i=1}^r\bar\Lambda_{(i)} = \dfrac 12 \sum_{\bar\alpha>0}\bar\alpha$$
I know that $$\tilde\chi_\Lambda(\lambda)=\exp(-s_\Lambda\delta)\chi_\Lambda(\lambda)=\exp(-s_\Lambda\delta)\dfrac{\sum_{w\in W}\text{sign}(w)e^{(w(\Lambda+\rho),\lambda)}}{\sum_{w\in W}\text{sign}(w)e^{(w(\rho),\lambda)}}$$ and $$\tilde\chi_\Lambda((0,0,-1/\tau))=\sum_{\Lambda'}(R(S))_{\Lambda,\Lambda'}\tilde\chi_{\Lambda'}((0,0,\tau))$$ and we also have $\lambda=\dfrac{(\bar\theta,\bar\theta)}{4\pi i}(0,0,n)=(0,0,\tau)\mapsto(0,0,-\dfrac1\tau)=(0,0,-\dfrac{4\pi i}{(\bar\theta,\bar\theta)}\dfrac 1n)$.
I can show that $k^\vee + g^\vee = \Lambda^0 + (\bar\theta^\vee, \bar\Lambda) + \sum_{i=1}^ra_i^\vee(\bar\alpha^{(i)},\sum_{j=1}^r\bar\Lambda_{(j)})= \Lambda^0 + (\bar\theta^\vee, \bar\Lambda+\bar\rho)$
How should I proceed?