Displaying 20 results from an estimated 500 matches similar to: "branch cuts of atan()"
2003 Aug 20
2
Weighted circular mean
Hello,
Once again, I posted a message without a subject line. Sorry.... here is
the question again.
Is there a simple way to modify the circ.mean function in the CircStats
package to include a vector of weights to obtain a weighted average angle?
Thanks!
Martin
--
Martin Biuw
Sea Mammal Research Unit
Gatty Marine Laboratory, University of St Andrews
St Andrews, Fife KY16 8PA
Scotland
Ph:
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
atan(1i) -> 0 + Inf i
complex(1/5) -> 0.2 + 0i
atan(1i) -> (0 + Inf i) * (0.2 + 0i)
-> 0*0.2 + 0*0i + Inf i * 0.2 + Inf i * 0i
infinity times zero is undefined
-> 0 + 0i + Inf i + NaN * i^2
-> 0 + 0i + Inf i - NaN
-> NaN + Inf i
I am not sure how complex arithmetic could arrive at another answer.
I advise against messing with infinities... use atan2() if you don't
2023 Apr 03
1
Breaking Change in Rcomplex Layout?
On 4/3/23 14:07, Michael Milton wrote:
> Hi all,
>
> There seems to have been a breaking change in the R trunk caused by a fix
> to bug 18430 <https://bugs.r-project.org/show_bug.cgi?id=18430> that
> relates to the layout of the Rcomplex typedef. Previously it was a struct,
> but now it's a union by default
>
2012 Mar 06
2
Calling FORTRAN function from R issue?
Hello,
I am trying to call the BLAS Level1 function zdotc from R via
a .C call like this:
#include "R.h"
#include "R_ext/BLAS.h"
void testzdotc() {
Rcomplex zx[3], zy[3], ret_val;
zx[0].r = 1.0; zx[0].i = 0.0;
zx[1].r = 2.0; zx[0].i = 0.0;
zx[2].r = 3.0; zx[0].i = 0.0;
zy[0].r = 1.0; zy[0].i = 0.0;
zy[1].r = 2.0; zy[0].i = 0.0;
zy[2].r = 3.0;
2023 Apr 03
1
Breaking Change in Rcomplex Layout?
On 4/3/23 15:50, Michael Milton wrote:
> Okay, but I'm afraid this will only mean something to Rust users. The
> reason being that we encountered this issue in extendr: a Rust
> extension library for R. The specific compiler errors we encounter
> happen because bindgen (the Rust code generation library) read the
> changed R header files, and generated a new type definition
2023 Apr 04
1
Breaking Change in Rcomplex Layout?
Hi Tomas,
Thanks for this explanation. As you can probably tell I'm not much of a C
person, so I didn't realise this change would be invisible to C users. I
suppose R's stability contract only applies to C, and therefore changes
that break other languages such as Rust are out of scope. You are right
that this error is confused by bindgen's inability to handle anonymous
types, but
2006 Jul 19
2
Stirling numbers
Hi
anyone coded up Stirling numbers in R?
[I need unsigned Stirling numbers of the first kind]
cheers
Robin
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743
1999 Dec 15
1
Rcomplex
o `Rcomplex' is preferred to `complex' (a future reserved word
in C) for R complex objects passed to C.
I'm a bit confused here. Is "complex" or "Rcomplex" the future reserved
word in C (I thought "complex" already was, but I'm not a C programmer)
and is this because R storage modes should or should not have names
corresponding to C reserved
2024 Sep 05
3
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> Dear R Users,
>
> Is this desired behaviour?
> I presume it's a bug.
>
> atan(1i)
> # 0+Infi
>
> tan(atan(1i))
> # 0+1i
>
> atan(1i) / 5
> # NaN+Infi
There's no need to involve atan() and tan() in this:
> (0+Inf*1i)/5
[1] NaN+Infi
Why do you think this is a bug?
Duncan Murdoch
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Dear R Users,
Is this desired behaviour?
I presume it's a bug.
atan(1i)
# 0+Infi
tan(atan(1i))
# 0+1i
atan(1i) / 5
# NaN+Infi
There were some changes in handling of complex numbers. But it looks like a bug.
Sincerely,
Leonard
[[alternative HTML version deleted]]
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Perhaps
> Inf*1i
[1] NaN+Infi
clarifies why it is *not* a bug.
(Boy, did that jog some long dusty math memories :-) )
-- Bert
On Thu, Sep 5, 2024 at 2:48?PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> > Dear R Users,
> >
> > Is this desired behaviour?
> > I presume it's a bug.
> >
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
The thing is that real*complex, complex*real, and complex/real are not
"complex arithmetic"
in the requisite sense. The complex numbers are a vector space over
the reals, and
complex*real and real*complex are vector*scalar and scalar*vector.
For example, in the Ada programming language, we have
function "*" (Left, Right : Complex) return Complex;
function "*" (Left :
2004 Jan 21
2
derivative of atan(x) and similar functions
Dear R experts.
'D()' function recognizes some of the analitical functions, such as
sin, cos, etc. But I'd like to take analytical derivatives from asin,
atan etc. functions. Are there any R packages providing that features?
Thanks.
--
Timur.
2023 Apr 04
1
Breaking Change in Rcomplex Layout?
I don't think an auto-generated name (along the lines of u or u2) for the
anonymous structs would be helpful here. You can see that bindgen is
already generating a placeholder name ("__bindgen_anon_1"). A meaningful
name might be nice instead, but I get the impression that isn't an option
here since that would break the C API.
Can I ask, would it make sense for us to hard code
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
I expect that atan(1i) = (0 + infinity i) and that atan(1i)/5 = (0 +
infinity i)/5 = (0 + infinity i).
Here's what I get in C:
(0,1) = (0, 1)
atan((0,1)) = (0, inf)
atan((0,1))/5 = (0, inf)
Note the difference between I*infinity = (0,1)*infinity =
(0*infinity,1*infinity) = (NaN,infinity)
and (0,infinity)/5 = (0/5,infinity/5) = (0,infinity).
The former involves multiplying 0 by infinity, which
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
> complex(real = 0, imaginary = Inf)
[1] 0+Infi
> Inf*1i
[1] NaN+Infi
>> complex(real = 0, imaginary = Inf)/5
[1] NaN+Infi
See the Note in ?complex for the explanation, I think. Duncan can correct
if I'm wrong.
-- Bert
On Thu, Sep 5, 2024 at 3:20?PM Leo Mada <leo.mada at syonic.eu> wrote:
> Dear Bert,
>
> These behave like real divisions/multiplications:
>
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
Dear Bert,
These behave like real divisions/multiplications:
complex(re=Inf, im = Inf) * 5
# Inf+Infi
complex(re=-Inf, im = Inf) * 5
# -Inf+Infi
The real division / multiplication should be faster and also is well behaved. I was expecting R to do the real division/multiplication on a complex number. Which R actually does for these very particular cases; but not when only Im(x) is Inf.
2016 May 05
1
Too many spaces in deparsed complex numbers with digits17 control option
If you set the "digits17" control option in deparse, you get a lot of
unnecessary space in the representation of complex numbers.
> deparse(0 + 0i)
[1] "0+0i"
> deparse(0 + 0i, control = "digits17")
[1] "0 + 0i"
As far as I can tell, the logic for this comes from this piece of
/src/main/deparse.c:
if (TYPEOF(vector) == CPLXSXP
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
>>>>> Richard O'Keefe
>>>>> on Fri, 6 Sep 2024 17:24:07 +1200 writes:
> The thing is that real*complex, complex*real, and complex/real are not
> "complex arithmetic" in the requisite sense.
> The complex numbers are a vector space over the reals,
Yes, but they _also_ are field (and as others have argued mathematically only
2006 Mar 22
1
Double complex with gcc and Intel v9 Fortran (PR#8699)
Full_Name: Christian Marquardt
Version: 2.2.1
OS: Linux
Submission from: (NULL) (84.167.229.240)
Hello,
I believe this is a bug in the configuration / installation:
When configuring R-2.2.1 using the Intel v9 Fortran compiler as default Fortran
compiler and g++ as C++ compiler on a Suse 9.3 Linux, the configuration script
finds that the C and Fortran idea of double comples disagree.
I have