search for: ldouble

Displaying 20 results from an estimated 21 matches for "ldouble".

Did you mean: double
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...rm=FALSE)) user system elapsed 4.49 0.00 4.51 Following the source code, I'm pretty sure the code (https://github.com/wch/r-source/blob/trunk/src/main/summary.c#L112-L128) performing the calculation is: static Rboolean rsum(double *x, R_xlen_t n, double *value, Rboolean narm) { LDOUBLE s = 0.0; Rboolean updated = FALSE; for (R_xlen_t i = 0; i < n; i++) { if (!narm || !ISNAN(x[i])) { if(!updated) updated = TRUE; s += x[i]; } } if(s > DBL_MAX) *value = R_PosInf; else if (s < -DBL_MAX) *value = R_NegInf; else *value = (double) s; return u...
2019 Dec 17
2
Build failure on powerpc64
...static long double ld1; > 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: &g...
2019 Dec 13
3
Build failure on powerpc64
...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 > f...
2015 Jun 01
0
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...ding two hours troubleshooting, but a few minutes after you post to R-devel, it's just jumps to you (is there a word for this other than "impatient"?); Let me answer my own question. The discrepancy between my sum2() code and the internal code for base::sum() is that the latter uses LDOUBLE = long double (on some system it's only double, cf. https://github.com/wch/r-source/blob/trunk/src/nmath/nmath.h#L28-L33), whereas my sum2() code uses double. So using long double, I can reproduce the penalty of having NA_real_ with na.rm=FALSE; > sum3 <- inline::cfunction(sig=c(x=&quot...
2006 Feb 02
3
Make error durring compilation of OpenSSH 4.3p1 on HP-UX 11.00
Hi, compilation of OpenSSH 4.2p1 / OpenSSL 0.9.8a / zlib 1.2.3 worked fine on Linux i386 / x86_64, SunOS, AIX and HP-UX. Compilation of OpenSSH 4.3p1 / OpenSSL 0.9.8a / zlib 1.2.3 works fine now only on Linux i386 / x86_64, SunOS, AIX. But on HP-UX 11.00 (gcc 3.3.2), "make" produces following... (cd openbsd-compat && make) gcc -o ssh ssh.o readconf.o
2020 Mar 25
1
Build failure on powerpc64
...= 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...
2013 Mar 20
1
double in summary.c : isum
Hi, Please consider the following : > x = as.integer(2^30-1) [1] 1073741823 > sum(c(rep(x, 10000000), rep(-x,9999999))) [1] 1073741824 Tested on 2.15.2 and a recent R-devel (r62132). I'm wondering if s in isum could be LDOUBLE instead of double, like rsum, to fix this edge case? https://svn.r-project.org/R/trunk/src/main/summary.c Thanks, Matthew
2010 Aug 23
1
Speeding up sum and prod
...and in the development release of 2010-08-19) makes a costly call of ISNAN even when the option is na.rm=FALSE. The inner loop can also be sped up a bit in other respects. Here is the old procedure, in src/main/summary.c: static Rboolean rsum(double *x, int n, double *value, Rboolean narm) { LDOUBLE s = 0.0; int i; Rboolean updated = FALSE; for (i = 0; i < n; i++) { if (!ISNAN(x[i]) || !narm) { if(!updated) updated = TRUE; s += x[i]; } } *value = s; return(updated); } and here is my modified version: static Rboolean rsum(do...
2020 Mar 25
0
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...
2019 Dec 13
0
Build failure on powerpc64
...ons.c: static long double ld1; 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 where the compiler determine...
2010 Sep 03
1
Fourteen patches to speed up R
...test-matprod.r With no external BLAS, this patch speeds up long vector-vector products by a factor of about six, matrix-vector products by a factor of about three, and some matrix-matrix products by a factor of about two. Issue: The matrix multiply code in matprod using an LDOUBLE (long double) variable to accumulate sums, for improved accuracy. On a SPARC system I tested on, operations on long doubles are vastly slower than on doubles, so that the patch produces a large slowdown rather than an improvement. This is also an issue for the "sum&qu...
2019 Dec 12
0
Build failure on powerpc64
...switches -specs=/usr/lib/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 l...
2003 May 14
0
Patch: Allow statistics to specify xferred bytes greater than MAXLONG
...eedup is 1890.86 (This is tested on a Solaris 8 system, using Sun's Forte 6.2 compiler.) hf --------- patch below ------ % diff -c lib/snprintf.c~ lib/snprintf.c *** lib/snprintf.c~ Mon May 7 02:59:38 2001 --- lib/snprintf.c Tue May 13 15:41:31 2003 *************** *** 88,94 **** #define LDOUBLE double #endif ! #ifdef HAVE_LONG_LONG #define LLONG long long #else #define LLONG long --- 88,94 ---- #define LDOUBLE double #endif ! #ifdef HAVE_LONGLONG #define LLONG long long #else #define LLONG long *************** *** 555,566 **** static double my_modf(double x...
2010 Sep 03
0
Pointer to fourteen patches to speed up R
...test-matprod.r With no external BLAS, this patch speeds up long vector-vector products by a factor of about six, matrix-vector products by a factor of about three, and some matrix-matrix products by a factor of about two. Issue: The matrix multiply code in matprod using an LDOUBLE (long double) variable to accumulate sums, for improved accuracy. On a SPARC system I tested on, operations on long doubles are vastly slower than on doubles, so that the patch produces a large slowdown rather than an improvement. This is also an issue for the "sum&qu...
2011 Mar 11
1
[PATH 9/12] VTPM mini-os: New stubdom applications
This patch ports 5 new applications to the stubdom makefile structure for inclusion into stubdom domains. While these are required for vtpm-stubdom and vtpmmgrdom they could be used with other stubdom applications. -libgmp 4.3.2 -openssl 1.0.0a -polarssl 0.12.1 -berlios tpm_emulator 0.6.1 -vtpm_manager (from the tools directory) Signed off by: Matthew Fioravante
2002 Dec 20
1
smbclient and large file support
...quot;)); + DEBUG(0,("Output is /dev/null, assuming dry_run\n")); dry_run = True; } tarhandle=-1; --- samba-2.2.7a/source/lib/snprintf.c Wed Jun 5 12:31:29 2002 +++ samba-2.2.7a-fixed/source/lib/snprintf.c Thu Dec 19 15:42:00 2002 @@ -341,6 +341,7 @@ fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); break; case 'G': flags |= DP_F_UP; @@ -349,6 +350,7 @@ fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); + fmtfp (buffe...
2019 Feb 21
0
code for sum function
...https://cran.r-project.org/doc/manuals/R-admin.html#Obtaining-R https://cran.r-project.org/doc/manuals/R-admin.html#Using-Subversion-and-rsync There is also a web access to subversion, so specifically the sum is available in https://svn.r-project.org/R/trunk/src/main/summary.c The definition of LDOUBLE is here https://svn.r-project.org/R/trunk/src/include/Defn.h The index of R manuals is here https://cran.r-project.org/manuals.html The online documentation inside R gives for ?sum "??? Loss of accuracy can occur when summing values of different signs: ???? this can even occur for sufficien...
2006 Mar 17
3
[Bug 1173] scp reports lost connection for very large files
...ax); static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags); + LLONG value, int base, int min, int max, int flags); static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags); static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); @@ -468,10 +468,10 @@ /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int b...
2010 Aug 23
1
Internal state indicating if a data object has NAs/no NAs/not sure (Was: Re: Speeding up matrix multiplies)
...-------------------------------------- > > static void matprod(double *x, int nrx, int ncx, > ? ? ? ? ? ? ? ? ? ?double *y, int nry, int ncy, double *z) > { > ? ?char *transa = "N", *transb = "N"; > ? ?int i, ?j, k; > ? ?double one = 1.0, zero = 0.0; > ? ?LDOUBLE sum; > ? ?Rboolean do_it_here; > > ? ?/* NOTE: ncx must be equal to nry. */ > > ? ?if (nrx==1 && ncy==1) { > > ? ? ? ?/* Do dot product quickly. */ > > ? ? ? ?sum = 0.0; > ? ? ? ?for (i = 0; i<ncx; i++) > ? ? ? ? ? ?sum += x[i] * y[i]; > ? ? ? ?z[0] =...
2019 Feb 20
3
code for sum function
Dear Tomas, Where do I find these files? Do they contain the code for the sum function? What do you mean exactly with your point on long doubles? Where can I find documentation on this? Cheers, Rampal On Mon, Feb 18, 2019, 15:38 Tomas Kalibera <tomas.kalibera at gmail.com wrote: > See do_summary() in summary.c, rsum() for doubles. R uses long double > type as accumulator on systems