diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2008-03-17 14:52:17 +0000 |
|---|---|---|
| committer | Charles Harris <charlesr.harris@gmail.com> | 2008-03-17 14:52:17 +0000 |
| commit | e99ac6619fc99a94c5fdad9e8a4134191ede2f8a (patch) | |
| tree | 4990404e0a2933708ed40ae984f2fa80a880ccab /numpy/core/src/umathmodule.c.src | |
| parent | 49a78cce45871f6df1c27bad474f02ff0c2f9d54 (diff) | |
| download | numpy-e99ac6619fc99a94c5fdad9e8a4134191ede2f8a.tar.gz | |
Fix arccosh for complex. The previous implementation could take the sqrt of a
number on the branch cut of sqrt, leading to roundoff problems. This seems to
have come about because the formula was derived using the non principal branch
of the sqrt, i.e., it used 1=(-1)*(-1).
Diffstat (limited to 'numpy/core/src/umathmodule.c.src')
| -rw-r--r-- | numpy/core/src/umathmodule.c.src | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index 18a3df465..84500e428 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -805,15 +805,14 @@ static void nc_acosh@c@(c@typ@ *x, c@typ@ *r) { nc_prod@c@(x, x, r); - nc_diff@c@(&nc_1@c@, r, r); + nc_diff@c@(r, &nc_1@c@, r); nc_sqrt@c@(r, r); - nc_prodi@c@(r, r); nc_sum@c@(x, r, r); nc_log@c@(r, r); return; /* - return nc_log(nc_sum(x,nc_prod(nc_i, - nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))); + return nc_log(nc_sum(x, + nc_sqrt(nc_diff(nc_prod(x,x),nc_1)))); */ } |
