mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
asin micro-optimization suggested in email.
This commit is contained in:
parent
15d72703fc
commit
1c8e1f0654
1 changed files with 3 additions and 2 deletions
|
|
@ -70,8 +70,9 @@ c_asin(Py_complex x)
|
||||||
/* -i * log[(sqrt(1-x**2) + i*x] */
|
/* -i * log[(sqrt(1-x**2) + i*x] */
|
||||||
const Py_complex squared = c_prod(x, x);
|
const Py_complex squared = c_prod(x, x);
|
||||||
const Py_complex sqrt_1_minus_x_sq = c_sqrt(c_diff(c_one, squared));
|
const Py_complex sqrt_1_minus_x_sq = c_sqrt(c_diff(c_one, squared));
|
||||||
const Py_complex sum = c_sum(sqrt_1_minus_x_sq, c_prod(c_i, x));
|
return c_neg(c_prodi(c_log(
|
||||||
return c_neg(c_prodi(c_log(sum)));
|
c_sum(sqrt_1_minus_x_sq, c_prodi(x))
|
||||||
|
) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static char c_asin_doc[] =
|
static char c_asin_doc[] =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue