Simplifying $\frac{1}{\sqrt{x-i}}\left\{1-2 \sum_{n=1}^{\infty}(-1)^{n-1} \exp \left(-\pi n^{2}\left(\frac{1}{x-i}+i\right)\right)\right\}$

This is related to another recent question of mine. Considering that $$\psi(x)=\sum_{n=1}^{\infty} \exp \left(-n^{2} \pi x\right)$$ has the finctional equation $$\frac{1+2 \psi(x)}{1+2 \psi(1 / x)}=\frac{1}{\sqrt{x}}$$ my goal was to find a functional equation for $$f(x)=\sum_{n=1}^{\infty}(-1)^{n-1} \exp \left(-n^{2} \pi x\right)$$ and using the hint given in the comments there, I got this $$(1-2f(x))=\frac{1}{\sqrt{x-i}}\left\{1-2 \sum_{n=1}^{\infty}(-1)^{n-1} \exp \left(-\pi n^{2}\left(\frac{1}{x-i}+i\right)\right)\right\}$$ But as we can see in the right ride of the equation we have some complex terms and this expression must be purely real valued.

So my question is, how to get rid of the complex terms?

Thanks.

$$f(x)=\sum_{n=1}^{\infty}(-1)^{n-1} \exp \left(-n^{2} \pi x\right)=\frac{1}{2} \left(1-\vartheta _4\left(0,e^{-\pi x}\right)\right)$$ whgere appears Jacobi theta function (have a look here and here).
$$\exp \left(-\pi n^{2}\left(\frac{1}{x-i}+i\right)\right)=$$ $$\exp \left(-\frac{\pi n^2 x}{x^2+1}\right)\Big[\cos \left(\pi n^2 \left(\frac{1}{x^2+1}+1\right)\right)-i \sin \left(\pi n^2 \left(\frac{1}{x^2+1}+1\right)\right) \Big]$$ and, in the argument of the trigonometric functions, the $$n^2 \pi$$ term has to disappear.