Displaying 20 results from an estimated 22 matches for "dbl_epsilon".
2017 Aug 11
2
Issues of R_pretty in src/appl/pretty.c
...= 1) gave 1000000 intervals
(on a machine), made me trace through the code to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c .
*lo is -1e300, *up is 1e300.
cell = fmax2(fabs(*lo),fabs(*up));
'cell' is 1e300.
i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3;
When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv is (int) 1e6.
Putting parentheses may avoid the floating point overflow. For example,
i_small = dx < cell * (U * imax2(1,*ndiv) * DBL_EPSIL...
2017 Aug 18
1
Issues of R_pretty in src/appl/pretty.c
...de to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c .
? ? > thank you.
? ? >> *lo is -1e300, *up is 1e300.
? ? >> cell = fmax2(fabs(*lo),fabs(*up));
? ? >> 'cell' is 1e300.
? ? >> i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3;
? ? >> When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv is (int) 1e6.
[[elided Yahoo spam]]
? ? >> Putting parentheses may avoid the floating point overflow. For example,
? ? >...
1999 Mar 06
1
bessel_?.c constants (fwd)
...1.0D+16
[...]
RTNSIG ENMTEN XLARGE
[...]
IEEE (IBM/XT,
SUN, etc.) (D.P.) 1.0E-4 8.90D-308 1.0D+4
[...]
Is there some reason for using different values in bessel_j.c than in
bessel_l.c? Or is this just a bug? ;^)
-Greg
PS: Where is DBL_EPSILON defined, and what is its value?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the su...
2017 Aug 14
0
Issues of R_pretty in src/appl/pretty.c
...e me trace through the code to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c .
thank you.
> *lo is -1e300, *up is 1e300.
> cell = fmax2(fabs(*lo),fabs(*up));
> 'cell' is 1e300.
> i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3;
> When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv is (int) 1e6.
well spotted!
> Putting parentheses may avoid the floating point overflow. For example,
> i_small = dx &...
1997 Apr 30
2
R-alpha: New Incomplete Beta Function
...tiply w by the factor
a b _ _ _
x (1-x) | (a+b) / ( a | (a) | (b) ) . */
y = a * log(x);
t = b * log(xc);
/* Resort to logarithms. */
y += t + lgamma(a + b) - lgamma(a) - lgamma(b);
y += log(w / a);
t = exp(y);
done:
if (flag == 1) {
if (t <= DBL_EPSILON)
t = 1 - DBL_EPSILON;
else
t = 1 - t;
}
return t;
}
/* Continued fraction expansion #1
* for incomplete beta integral
*/
static double incbcf(double a, double b, double x)
{
double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
double k1, k2, k3, k4, k5, k6, k7, k8;
double r, t, ans, thresh;...
2005 Apr 07
1
complex tangent (PR#7781)
...s the original NaN came from division of sinh and
cosh that had reached machine infinity.
static void z_tan(Rcomplex *r, Rcomplex *z)
{
double x2, y2, den;
x2 = 2.0 * z->r;
y2 = 2.0 * z->i;
den = cos(x2) + cosh(y2);
r->r = sin(x2)/den;
/* any limit above about log(DBL_EPSILON) will do */
if (fabs(r->i) < 40.0)
r->i = sinh(y2)/den;
else
r->i = 1.0;
}
2019 Dec 17
2
Build failure on powerpc64
...> for (i = 0, j = 0; i < len; i++, j += size) {
> ld1 = (long double) REAL(object)[i];
> format.c:
> static const long double tbl[] =
> ... but it doesn't. Perhaps the original code at issue:
> arithmetic.c:
> static LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
> only makes gcc unhappy because of the very large value trying to be stored
> in the static long double, which would make it span the "folded double" on
> that architecture.
> *****
> It seems that the options are:
> A) Patch the one place w...
2019 Dec 13
3
Build failure on powerpc64
...pecs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8
> -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -c
> arithmetic.c -o arithmetic.o
> arithmetic.c:180:26: error: initializer element is not constant
> 180 | static LDOUBLE q_1_eps = (1 / LDBL_EPSILON);
> | ^
> make[3]: *** [../../Makeconf:124: arithmetic.o] Error 1
> Took me a bit to figure out why, but this is happening because on
> powerpc64, gcc is compiled with -mlong-double-128, and the long double
> format used on PPC is IBM'...
2004 Oct 22
3
pgamma discontinuity (PR#7307)
Full_Name: Morten Welinder
Version: 2
OS: Solaris/space/gcc2.95.2
Submission from: (NULL) (65.213.85.217)
I changed src/nmath/standalone/test.c to read:
---------------------------------------------------------------------------------
#define MATHLIB_STANDALONE 1
#include <Rmath.h>
#include <stdio.h>
int
main()
{
double x;
for (x = 99990; x <= 100009; x++)
printf
2020 Mar 25
1
Build failure on powerpc64
...; i++, j += size) {
>>> ld1 = (long double) REAL(object)[i];
>
>>> format.c:
>>> static const long double tbl[] =
>
>>> ... but it doesn't. Perhaps the original code at issue:
>
>>> arithmetic.c:
>>> static LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
>
>>> only makes gcc unhappy because of the very large value trying to be stored
>>> in the static long double, which would make it span the "folded double" on
>>> that architecture.
>
>>> *****
>
>>> It seems that the options are:...
2016 Oct 10
0
optim(…?=, =?utf-8?Q?method=‘L-BFGS-B’) stops with an error message while violating the lower bound
...d Nocedal, the 2nd one being one of the
original L-BFGS-B(1997) paper, make two remarks, the 2nd one
about the "machine epsilon" used, and I can assure you that R's
optim() version never suffered from that; we've always been
using a C translation of the fortran code, and then used DBL_EPSILON.
R's (main) source file for that is in .../src/appl/lbfgsb.c, e.g., here
https://svn.r-project.org/R/trunk/src/appl/lbfgsb.c
OTOH, their remark 1 is very relevant and promising faster /
more reliable convergence.
I'd be "happy" if optim() could gain a new option, say, "L-BF...
2019 Dec 12
0
Build failure on powerpc64
.../rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8
-mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -c
arithmetic.c -o arithmetic.o
arithmetic.c:180:26: error: initializer element is not constant
180 | static LDOUBLE q_1_eps = (1 / LDBL_EPSILON);
| ^
make[3]: *** [../../Makeconf:124: arithmetic.o] Error 1
Took me a bit to figure out why, but this is happening because on
powerpc64, gcc is compiled with -mlong-double-128, and the long double
format used on PPC is IBM's 128bit long double which is two doub...
1999 Mar 06
0
bessel_?.c constants
...1.0D+16
[...]
RTNSIG ENMTEN XLARGE
[...]
IEEE (IBM/XT,
SUN, etc.) (D.P.) 1.0E-4 8.90D-308 1.0D+4
[...]
Is there some reason for using different values in bessel_j.c than in
bessel_l.c? Or is this just a bug? ;^)
-Greg
PS: Where is DBL_EPSILON defined, and what is its value?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the sub...
2005 Aug 09
0
qpois minor bug (PR#8058)
...om.c, qnbinom.c --
* FIXME: This is far from optimal [cancellation for p ~= 1, etc]: */
if(!lower_tail || log_p) {
p = R_DT_qIv(p); /* need check again (cancellation!): */
if (p == 0.) return 0;
if (p == 1.) return ML_POSINF;
}
/* temporary hack --- FIXME --- */
if (p + 1.01*DBL_EPSILON >= 1.) return ML_POSINF;
/* y := approx.value (Cornish-Fisher expansion) : */
z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE);
y = floor(mu + sigma * (z + gamma * (z*z - 1) / 6) + 0.5);
2003 Sep 22
2
PR#2894
...nity. Why not use an exit condition based on
how far away from 'a' you are?
qbeta.c:174 (prevent excess precision)
Might this not just get optimized out? I doubt modern compilers respect
the volatile keyword. You should probably replace this with a safe
comparison. if(fabs(tx-xinbta)<=DBL_EPSILON*fabs(xinbta))...
** This should be checked with someone familiar with floating point
arithmetic; I'm not and may have got the correct expression wrong.
The 'infinite loop' is due to the speed of the pbeta routine, rather than
the initial approximation from the qbeta. There is another a...
2020 Mar 25
0
Build failure on powerpc64
...= 0; i < len; i++, j += size) {
>> ld1 = (long double) REAL(object)[i];
>> format.c:
>> static const long double tbl[] =
>> ... but it doesn't. Perhaps the original code at issue:
>> arithmetic.c:
>> static LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
>> only makes gcc unhappy because of the very large value trying to be stored
>> in the static long double, which would make it span the "folded double" on
>> that architecture.
>> *****
>> It seems that the options are:
>>...
2008 Dec 16
0
[LLVMdev] Another compiler shootout
...pile times go down from 0.36s to 0.13s on x86 and 0.35s to 0.19s on x86-64
as expected.
Here's the code:
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define real float
#define epsilon FLT_EPSILON
//#define real double
//#define epsilon DBL_EPSILON
real delta, INFINITY;
typedef struct { real x, y, z; } Vec;
Vec vec(real x, real y, real z) { Vec r; r.x=x; r.y=y; r.z=z; return r; }
Vec add(const Vec a, const Vec b) { return vec(a.x+b.x, a.y+b.y, a.z+b.z); }
Vec sub(const Vec a, const Vec b) { return vec(a.x-b.x, a.y-b.y, a.z-b.z); }
Vec scale...
2003 Nov 24
0
PR#2894
...ty. Why not use an exit condition based on
how far away from 'a' you are?
qbeta.c:174 (prevent excess precision)
Might this not just get optimized out? I doubt modern compilers respect
the volatile keyword. You should probably replace this with a safe
comparison. if(fabs(tx-xinbta)<=DBL_EPSILON*fabs(xinbta))...
** This should be checked with someone familiar with floating point
arithmetic; I'm not and may have got the correct expression wrong.
The 'infinite loop' is due to the speed of the pbeta routine, rather than
the initial approximation from the qbeta. There is anothe...
2008 Dec 16
6
[LLVMdev] Another compiler shootout
FYI. http://leonardo-m.livejournal.com/73732.html
If anyone is motivated, please file bugs for the losing cases. Also,
it might make sense to incorporate the tests into our nightly tester
test suite.
Thanks,
Evan
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hi, Mark et al.:
Thanks, Mark.
Three comments:
1. Rvmmin was one of the methods I tried after Ravi
directed me to optimx. It returned NAs for essentially everything. See
my email of this subject stamped 4:43 PM Central time = 21:43 UTC.
2. It would be interesting to know if the current
algorithm behind optim and optimx with