PR #10376: Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
PR #10376: Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.

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

As in the title.

Tests and improvement reports are in https://github.com/google/jax/pull/20144.

Accuracy tests are enabled in https://github.com/google/jax/pull/20436
Copybara import of the project:

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

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/10376 from pearu:pearu/expm1 42e222a436787c52adf453c8c0c39125b010e2b2
