PR #10525: Fix tan inaccuracies on complex inputs with large and small absolute values
PR #10525: Fix tan inaccuracies on complex inputs with large and small absolute values

Imported from GitHub PR https://github.com/openxla/xla/pull/10525

As in the title.

Tan evaluation is verified against mpmath tan function. The corresponding unit tests are included in xla/tests/complex_unary_op_test.cc 

When https://github.com/google/jax/pull/20688 lands, the follow-up PR will enable Tan tests at complex infinities.
Copybara import of the project:

--
005ff68200fe6a343c10b8e7129448dfc0d9aa57 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix tan inaccuracies on complex inputs with large and small absolute values.

--
ad3d31f69fb62a9d024cf5f9011ce30fdfd4dfa4 by Pearu Peterson <pearu.peterson@gmail.com>:

Make generate_complex_unary_op_samples.py output clang-format stable

--
d88445489f525186800fb1c2a095bfca6b1de7bf by Pearu Peterson <pearu.peterson@gmail.com>:

Add unittests for Tan with complex inputs

Merging this change closes #10525

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/10525 from pearu:pearu/tan d88445489f525186800fb1c2a095bfca6b1de7bf
