Find a closed form formula of the estimated epsilon (squared distances ratio distortion) of the Johnson Lindenstrauss lemma. The goal is to implement it either as a pure python or pure numpy function to compute the eps out of the number of points (samples or observation) n and target dimension d.
The root expression as found by sympy is hard to rewrite as a python function that returns a complex variable: intermediate expression evaluation tend to overflow a lot. sympy is able to compute the numerical value when using evalf
but not compile the expression to a numerically stable numpy implementation when using lambdify
.