search for: atan

Displaying 20 results from an estimated 130 matches for "atan".

Did you mean: alan
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 ?
...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. > > > > 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? > > Dunca...
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]]
2005 May 16
1
branch cuts of atan()
Hi the following gave me a shock: > atan(2) [1] 1.107149 > atan(2+0i) [1] -0.4636476+0i > or, perhaps more of a gotcha: > atan(1.0001+0i) [1] -0.7853482+0i > atan(0.9999+0i) [1] 0.7853482+0i > evidently atan()'s branch cuts aren't where I thought they were. Where do I look for documentation on this? --...
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/...
2024 Sep 05
0
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-05 6:12 p.m., Leo Mada wrote: > Dear Duncan, > > Here is also the missing information: > R version 4.4.1 (2024-06-14 ucrt) > Platform: x86_64-w64-mingw32/x64 > Running under: Windows 10 x64 (build 19045) > > Regarding the results: > atan(1i) > #?0+Infi > Re(atan(1i)) > # 0 > Im(atan(1i)) > #? Inf > > 0 + Inf i is a valid complex number: > tan(atan(1i)) > # 0+1i > > Inf / 5 > # Inf > > Note: atan(1i) / 5 should have generated 0 + Inf * 1i; even the explicit > complex number fails: &gt...
2024 Sep 06
0
BUG: atan(1i) / 5 = NaN+Infi ?
It seems to me that the documentation of R's complex class & R's atan function do not tell us what to expect, so (as others have suggested), some additional notes are needed. I think that mathematically atan(1i) should be NA_complex_, but R seems not to use any mathematically standard compactification of the complex plane (and I'm not sure that IEEE does either)....
2004 Dec 16
3
Qyery on bark equation in floor0 code
Hi All, I need some clarifications regarding the mismatch I found in the code and the specification. (a) In the specification, the bark(x) equation is given as: bark(x) = 13.1 atan(.00074x) + 2.24 atan(.0000000158(x^2)) + .0001x whereas in the code it is given as: #define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n)) Which one of these is the proper one ? (b) Also, we are planning to implement a fixed point code for the Vorbis decoder. And as...
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
...:* Bert Gunter <bgunter.4567 at gmail.com> > *Sent:* Friday, September 6, 2024 1:12 AM > *To:* Duncan Murdoch <murdoch.duncan at gmail.com> > *Cc:* Leo Mada <leo.mada at syonic.eu>; r-help at r-project.org < > r-help at r-project.org> > *Subject:* Re: [R] 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> > w...
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
...______________________________ From: Bert Gunter <bgunter.4567 at gmail.com> Sent: Friday, September 6, 2024 1:12 AM To: Duncan Murdoch <murdoch.duncan at gmail.com> Cc: Leo Mada <leo.mada at syonic.eu>; r-help at r-project.org <r-help at r-project.org> Subject: Re: [R] 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<mailto:murdoch.duncan at gmail.com>> wrote: On 2024-09-0...
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...
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-06 12:44 a.m., Richard O'Keefe wrote: > 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) =...
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.
2000 Nov 26
2
References for the BARK/MEL stuff
Could someone point me to the BARK/MEL tables that these macros (from vorbis/scales.h) are trying to approximate? #define toBARK(f) (13.1*atan(.00074*(f))+2.24*atan((f)*(f)*1.85e-8)+1e-4*(f)) #define fromBARK(z) (102.*(z)-2.*pow(z,2.)+.4*pow(z,3)+pow(1.46,z)-1.) #define toMEL(f) (log(1.+(f)*.001)*1442.695) #define fromMEL(m) (1000.*exp((m)/1442.695)-1000.) I was wondering if I could come up with different functions that were easier...
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
...pe and then operate" model is more important than getting good answers, well, it's THEIR language, not mine. But let's not pretend that the answers are *right* in any other sense. On Fri, 6 Sept 2024 at 11:07, Jeff Newmiller via R-help <r-help at r-project.org> wrote: > > 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...
2009 Sep 23
1
Numerical integration problem
...m on my machine running R 2.9.0. Any suggestions on what might be causing this and what I can do to avoid it would be very gratefully received. Hoping for some insights Marcus ########################## #Problem example #Works fine: integrate(hazard, 0,Inf, v=0.1, gam=pi*232/200, pos=list(r=5,th=atan(3/4)), a=10, b0=10, bt=0.1) #Gives error "...integral probably divergent": integrate(hazard, 0,Inf, v=0.1, gam=pi*231/200, pos=list(r=5,th=atan(3/4)), a=10, b0=10, bt=0.1) #Plot the integrands - doesn't look obviously problematic h <- hazard(seq(0,500,0.1),0.1,pi*231/200,pos=list...
2007 Jan 19
3
integrate and quadratic forms
...of a quadratic form following Imhof's (1961, Biometrika 48) procedure. The parameters are: lambda=c(.6,.3,.1) h=c(2,2,2) sigma=c(0,0,0) q=3 I've implemented Imhof's procedure two ways that, for me, should give the same answer: #more legible integral1 = function(u) { o=(1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2 rho=prod((1+lambda^2*u^2)^(h/4))*exp( (1/2)*sum((sigma*lambda*u)^2/(1+lambda^2*u^2)) ) integrand = sin(o)/(u*rho) } #same as above integral2= function(u) { ((1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2)/ (u*(prod((1...
2006 Mar 28
2
atan2(1,1i)
Hi ?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex vectors. Well, I would expect atan2(1,1i) to be equal to atan(-1i), but > atan2(1,1i) Error in atan2(y, x) : Non-numeric argument to mathematical function > R.version _ platform powerpc-apple-darwin8.5....
2006 Mar 28
2
atan2(1,1i)
Hi ?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex vectors. Well, I would expect atan2(1,1i) to be equal to atan(-1i), but > atan2(1,1i) Error in atan2(y, x) : Non-numeric argument to mathematical function > R.version _ platform powerpc-apple-darwin8.5....
2008 May 27
5
Rotated text on a regression line
...rary x and y values y=x*2-rnorm(1:10) plot(x,y,pch=16,xlim=c(0,10)) #create the graph abline(lm(y~x)) #calculate the y coordinate of the text: yval=predict(lm(y~x),list(x=rep(2,length(x))))[1] #calculate the slope: slope=as.numeric(lm(y~x)[[1]][2]) text(2,yval,"Regression",srt=180/pi*atan(slope),adj=0) #### What am I doing wrong here? Many thanks in advance for any help! Best wishes Christoph (using R 2.6.1 on Windows XP)