Displaying 10 results from an estimated 10 matches for "tanpi".
2016 Sep 09
3
Different results for tan(pi/2) and tanpi(1/2)
As the subject line says, we get different results for tan(pi/2) and
tanpi(1/2), though this should not be the case:
> tan(pi/2)
[1] 1.633124e+16
> tanpi(1/2)
[1] NaN
Warning message:
In tanpi(1/2) : NaNs produced
By redefining tanpi with sinpi and cospi, we can get closer:
> tanpi <- function(x) sinpi(x) / cospi(x)
> ta...
2016 Sep 09
3
Different results for tan(pi/2) and tanpi(1/2)
The same argument would hold for tan(pi/2).
I don't say the result 'NaN' is wrong,
but I thought,
tan(pi*x) and tanpi(x) should give the same result.
Hans Werner
On Fri, Sep 9, 2016 at 8:44 PM, William Dunlap <wdunlap at tibco.com> wrote:
> It should be the case that tan(pi*x) != tanpi(x) in many cases - that is why
> it was added. The limits from below and below of the real function
> tan(pi*x)...
2016 Sep 09
0
Different results for tan(pi/2) and tanpi(1/2)
...are many specific functions for
calculating in those regions.
On Fri, Sep 9, 2016 at 12:55 PM, Hans W Borchers <hwborchers at gmail.com> wrote:
> The same argument would hold for tan(pi/2).
> I don't say the result 'NaN' is wrong,
> but I thought,
> tan(pi*x) and tanpi(x) should give the same result.
>
> Hans Werner
>
>
> On Fri, Sep 9, 2016 at 8:44 PM, William Dunlap <wdunlap at tibco.com> wrote:
>> It should be the case that tan(pi*x) != tanpi(x) in many cases - that is why
>> it was added. The limits from below and below of th...
2016 Dec 01
1
Different results for cos,sin,tan and cospi,sinpi,tanpi
...>> i try sin, cos, and tan.
>>
>> >>> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi)
>> >> [1] 0.5444181 0.8388140 1.5407532
>>
>> >> However, *pi results the following
>>
>> >>> sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45)
>> >> [1] 1 0 0
>>
>> >> Please try whether the following becomes all right.
>>
>> > [..............................]
>>
>> > Yes, it does -- the fix will be in all future versions of R.
>>...
2016 Dec 01
2
Different results for cos,sin,tan and cospi,sinpi,tanpi
Hi,
i try sin, cos, and tan.
> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi)
[1] 0.5444181 0.8388140 1.5407532
However, *pi results the following
> sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45)
[1] 1 0 0
Please try whether the following becomes all right.
diff -ruN R-3.3.2.orig/src/nmath/cospi.c R-3.3.2/src/nmath/cospi.c
--- R-3.3.2.orig/src/nmath/cospi.c 2016-09-15 07:15:31.000000000 +0900
+++ R-3.3.2/src/nmath/cospi.c 2016-12-01 13:54:38.863357149 +0...
2016 Dec 01
0
Different results for cos,sin,tan and cospi,sinpi,tanpi
...t; >> Hi,
> >> i try sin, cos, and tan.
>
> >>> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi)
> >> [1] 0.5444181 0.8388140 1.5407532
>
> >> However, *pi results the following
>
> >>> sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45)
> >> [1] 1 0 0
>
> >> Please try whether the following becomes all right.
>
> > [..............................]
>
> > Yes, it does -- the fix will be in all future versions of R.
>
> oops.... not so quickly,...
2016 Dec 01
2
Different results for cos,sin,tan and cospi,sinpi,tanpi
...Thu, 1 Dec 2016 14:39:55 +0900 writes:
>> Hi,
>> i try sin, cos, and tan.
>>> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi)
>> [1] 0.5444181 0.8388140 1.5407532
>> However, *pi results the following
>>> sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45)
>> [1] 1 0 0
>> Please try whether the following becomes all right.
> [..............................]
> Yes, it does -- the fix will be in all future versions of R.
oops.... not so quickly, Martin!
Of course, the results then coin...
2017 Feb 17
4
Wish List: Extensions to the derivatives table
...ter but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p, log2, log10, cospi, sinpi, and tanpi.
While manual differentiation of these proposed additions is straight-forward, their absence complicates what otherwise could be much simpler, such as using deriv() or deriv3() to generate functions, for example to use as an nls model.
Thanks,
[[alternative HTML version deleted]]
2017 Feb 17
1
Wish List: Extensions to the derivatives table
...),
cospi = make.call("*", make.call("*", make.call("sinpi", expr[[2]]), make.call("-", D(expr[[2]], name))), quote(pi)),
sinpi = make.call("*", make.call("*", make.call("cospi", expr[[2]]), D(expr[[2]], name)), quote(pi)),
tanpi = make.call("/", make.call("*", D(expr[[2]], name), quote(pi)), make.call("^", make.call("cospi", expr[[2]]), 2)),
Jerry
From: Avraham Adler [mailto:avraham.adler at gmail.com]
Sent: Friday, February 17, 2017 4:16 PM
To: Jerry Lewis; r-devel at r-project.or...
2017 Feb 17
0
Wish List: Extensions to the derivatives table
...exible, since that table is programmed in C. It would be useful if R
> provided a mechanism for extending the derivative table, or barring that,
> provided a broader table. Currently unsupported mathematical functions of
> one argument include expm1, log1p, log2, log10, cospi, sinpi, and tanpi.
>
> While manual differentiation of these proposed additions is
> straight-forward, their absence complicates what otherwise could be much
> simpler, such as using deriv() or deriv3() to generate functions, for
> example to use as an nls model.
>
> Thanks,
>
> [[...