summaryrefslogtreecommitdiffstats
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-02-22 19:51:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-02-22 19:51:56 (GMT)
commit1c8e1f0654f26765c89753bede75be9f3132e11e (patch)
tree2157752e98d7ff8223beda3de1b3d3041ab859a5 /Modules/cmathmodule.c
parent15d72703fccdcdcdce4122f624f5b6c85527567b (diff)
downloadcpython-1c8e1f0654f26765c89753bede75be9f3132e11e.zip
cpython-1c8e1f0654f26765c89753bede75be9f3132e11e.tar.gz
cpython-1c8e1f0654f26765c89753bede75be9f3132e11e.tar.bz2
asin micro-optimization suggested in email.
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index b961ca8..521d3aa 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -70,8 +70,9 @@ c_asin(Py_complex x)
/* -i * log[(sqrt(1-x**2) + i*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 sum = c_sum(sqrt_1_minus_x_sq, c_prod(c_i, x));
- return c_neg(c_prodi(c_log(sum)));
+ return c_neg(c_prodi(c_log(
+ c_sum(sqrt_1_minus_x_sq, c_prodi(x))
+ ) ) );
}
static char c_asin_doc[] =