public static double Atanh(double x) { if (x > 1.0 || x < -1.0) throw new ArithmeticException("range exception"); return 0.5 * Math.Log((1.0 + x) / (1.0 - x)); }