search for: ieee_754

Displaying 20 results from an estimated 29 matches for "ieee_754".

Did you mean: ieee754
2003 Dec 30
1
Accuracy: Correct sums in rowSums(), colSums() (PR#6196)
...ar = "1991", url = "citeseer.nj.nec.com/goldberg91what.html" } (http://citeseer.nj.nec.com/goldberg91what.html) and in the article "Floating-point Summation", by Evan Manning, in C/C++ User's Journal, Sept. 1996. The proposed improvement has been tested in !IEEE_754 mode, the patch is attached. It is intended to be applied against R-1.7.1/src/main/array.c --------- Cut here ---------- *** array.c.old Mon Dec 15 17:33:23 2003 --- array.c Mon Dec 15 17:33:45 2003 *************** *** 1016,1022 **** int OP, n, p, cnt = 0, i, j, type; Rboolean NaRm, ke...
1999 Oct 15
2
IEEE_754 logic
Can anybody of the architects of R enlighten me about the reasoning behind the selection of the IEEE 754 mode for the building of R, please? Special points of interest are: 1. The selection seems to be based on the availability of isnan() and finite(). Is this a common way to test for IEEE 754? 2. The C9x draft introduces isfinite() instead of finite() (and as I see, some systems, e.g. the
1999 Mar 12
1
R 68.3 on OSF V4.0 problems
...l as possibly also to this mailing list): I am not a recipient of the list. My problem is that floating-point operations seem weird. If I 'make' the package as instructed, R quits (right after the welcome messages) with a "floating exception"; if I change things so as not to use IEEE_754 (whatever that means, and however 'configure' decided to use it), then the treatment of 0/0 and the like (NaN, Inf) seems weird. Should not 'configure' pick the correct options for my machine, and should not R recognize NaN and Inf? The "oddities" of the build and instal...
1999 Sep 13
5
axis() produces junk on DEC alpha (PR#274)
Full_Name: Albrecht Gebhardt Version: 0.65.0 OS: Digital Unix 4.0E Submission from: (NULL) (212.17.104.62) Plottimg on the Alpha stopped working with 0.65.0. The tickmarks have a length of -Inf and go across the whole plot. A first solution is the following patch: --- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999 +++ src/main/plot.c Mon Sep 13 01:58:16 1999 @@ -832,7 +832,7 @@
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x. In R 1.9.1 Arith.h and Rmath.h contained code like #ifdef IEEE_754 # define ISNAN(x) (isnan(x)!=0) #else # define ISNAN(x) R_IsNaNorNA(x) #endif #define R_FINITE(x) R_finite(x) int R_IsNaNorNA(double); int R_finite(double); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks because on MacOS X in /usr/include/architectu...
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x. In R 1.9.1 Arith.h and Rmath.h contained code like #ifdef IEEE_754 # define ISNAN(x) (isnan(x)!=0) #else # define ISNAN(x) R_IsNaNorNA(x) #endif #define R_FINITE(x) R_finite(x) int R_IsNaNorNA(double); int R_finite(double); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks because on MacOS X in /usr/include/architectu...
2020 Sep 04
2
Misleading documentation on FP to integer conversion instructions?
The LLVM IR reference manual states, for fptosi: "The ‘fptosi’ instruction converts its floating-point <http://llvm.org/docs/LangRef.html#t-floating> operand into the nearest (rounding towards zero) signed integer value." I interpreted this to mean that it rounds: The nearest integer to 0.3 is 0. The nearest integer to 0.9 is 1. The nearest integer to 0.5 is either 0 or 1. And
1999 Oct 13
1
formatReal()-bug (or Is there anybody out there w/o IEEE754?)
On a system with IEEE_754 undefined, I run into an bug, when the value of an element of the first argument (e.g., x[0]) of formatReal() is NA: 1. (format.c:235) if (!R_FINITE ..) gives nanflag=1 (!naflag remains 0) 2. (format.c:272..288) *m gets an value of -2147483643 (from the format fiddling, sho...
2005 Jan 05
1
Standalone Mathlib, C++ and ISNAN()
...om from C++ programs, and the API includes the special values ISNAN() and R_FINITE() and the missing test ISNA(). R_FINITE is no problem. It is defined as R_finite, which is declared in Rmath.h and included in libRmath. ISNAN() however is broken. In R 1.9 it was defined as R_IsNaNorNA unless IEEE_754 was defined which was not done in the standalone libRmath/Rmath.h. R_IsNaNorNA was declared in Rmath and included in libRmath. So it would work, although probably not when built against an installed R library because R.h would likely define IEEE_754. In R2.0 ISNAN() is defined using isnan th...
2019 Dec 08
2
What should dnorm(0, 0, -Inf) return?
...estion, I cannot speak for R's developers but I would like to > provide some information on the problem. Here are the first few lines of > the dnorm function located at src\nmath\dnorm.c: > > ``` > double dnorm4(double x, double mu, double sigma, int give_log) > { > #ifdef IEEE_754 > if (ISNAN(x) || ISNAN(mu) || ISNAN(sigma)) > return x + mu + sigma; > #endif > if(!R_FINITE(sigma)) return R_D__0; > if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */ > if (sigma <= 0) { > if (sigma < 0) ML_ERR_return_NAN; > /*...
2004 Mar 17
5
build on Irix failed reg-tests
Dear R-devel, Has anyone seen this problem? We tried building R-1.8.1 (and R-1.9.0 alpha 2004-03-17) on an Irix 6.5 box using ./configure CC="cc -64" F77="f77 -64" --with-tcltk=no --enable-R-shlib make check failed because NA + 0 gave NaN instead of NA. I've tried both 32- and 64-bit build, with and without --enable-R-shlib. The same symptom occur in all cases. Any
2019 Dec 07
2
What should dnorm(0, 0, -Inf) return?
Hi, Apropos of a recent Inf question, I've previously wondered if dnorm "does the right thing" with dnorm(0, 0, -Inf) which gives zero. Should that be zero or NaN (or NA)? The help says "'sd < 0' is an error and returns 'NaN'" and since -Inf < 0 is TRUE, then... is this a bug? Thank you, Stephen Rochester, MN USA
2020 Sep 04
4
Misleading documentation on FP to integer conversion instructions?
...the result is prescribed to be 0. > > In actuality, the instruction truncates, returning 0 for all cases. > > Should this be reworded, perhaps to use the word "truncate”? > > > “Rounding towards zero” is a term of art from IEEE 754. See > https://en.wikipedia.org/wiki/IEEE_754#Directed_roundings > > I agree that the documentation could be made more accessible by *also* > using the colloquial term “truncation”, but round-towards-zero is the > correct name for this behavior and should be retained. > > —Owen > ___________________________________________...
2004 Apr 11
3
pcauchy precision (PR#6756)
Full_Name: Morten Welinder Version: snapshot OS: Submission from: (NULL) (65.213.85.129) Two things are wrong. 1. There is nan test outside IEEE_754. 2. The meat part of the function should really be something like... if (!lower_tail) x = -x; if (fabs (x) > 1) { double temp = atan (1 / x) / M_PI; return (x > 0) ? R_D_Clog (temp) : R_D_val (-temp); } else return R_D_val (0.5 + atan (x) / M_PI); ...instead...
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
2019 Dec 07
0
What should dnorm(0, 0, -Inf) return?
Good question, I cannot speak for R's developers but I would like to provide some information on the problem. Here are the first few lines of the dnorm function located at src\nmath\dnorm.c: ``` double dnorm4(double x, double mu, double sigma, int give_log) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(mu) || ISNAN(sigma)) return x + mu + sigma; #endif if(!R_FINITE(sigma)) return R_D__0; if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */ if (sigma <= 0) { if (sigma < 0) ML_ERR_return_NAN; /* sigma == 0 */ return (x =...
2002 Jan 16
0
round() doesn't (PR#1139)
...ase of 1.4.0! ---- begin C code for fround.c: ---- double fround(double x, double digits) { #define MAX_DIGITS DBL_MAX_10_EXP /* = 308 (IEEE); was till R 0.99: (DBL_DIG - 1) */ /* Note that large digits make sense for very small numbers */ double pow10, sgn, intx; int dig; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(digits)) return x + digits; if(!R_FINITE(x)) return x; #endif if (digits > MAX_DIGITS) digits = MAX_DIGITS; dig = (int)floor(digits + 0.5); if(x < 0.) { sgn = -1.; x = -x; } else sgn = 1.; if (dig == 0) { return sgn * R_rint(x);...
2004 Apr 15
0
phyper accuracy and efficiency (PR#6772)
...amp; term >= GNUM_EPSILON * sum) { term *= i * (NB - n + i) / (n + 1 - i) / (NR + 1 - i); sum += term; i--; } return log_p ? log1pgnum (sum) : 1 + sum; } gnm_float phyper (gnm_float i, gnm_float NR, gnm_float NB, gnm_float n, int lower_tail, int log_p) { gnm_float d, pd; #ifdef IEEE_754 if (isnangnum (i) || isnangnum (NR) || isnangnum (NB) || isnangnum (n)) return i + NR + NB + n; #endif i = floorgnum (i + 1e-7); NR = floorgnum (NR + 0.5); NB = floorgnum (NB + 0.5); n = floorgnum (n + 0.5); if (NR < 0 || NB < 0 || !finitegnum (NR + NB) || n < 0 || n > NR + NB...
2005 Aug 09
0
qpois minor bug (PR#8058)
...amma = sigma; should be replaced by gamma = 1.0/sigma; /* the skewness */ The reference is Abramowitz and Stegun 'Handbook of Mathmatical Functions' pages 935 and 928 Mikael double qpois(double p, double lambda, int lower_tail, int log_p) { double mu, sigma, gamma, z, y; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(lambda)) return p + lambda; #endif if(!R_FINITE(lambda)) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); if(lambda < 0) ML_ERR_return_NAN; if(lambda == 0) return 0; mu = lambda; sigma = sqrt(lambda); gamma = sigma; /* Note :...
2000 Aug 26
0
Re: [R] too large alpha or beta in dbeta ? (PR#643)
...or >> plot(function(x)exp(dbeta(x, 534,646, log = TRUE)), n = 1001) MM> -- MM> I'll have a look. fixed for R-devel (1.2 unstable), and the patch is --- src/nmath/dbeta.c 2000/03/03 17:18:30 1.7 +++ src/nmath/dbeta.c 2000/08/25 16:16:35 1.8 @@ -30,7 +30,15 @@ #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; + +# define xmax 171.61447887182298/* (fixme) -->> ./gammalims.c */ + +#else + static double xmax = 0; double xmin; + if (xmax == 0) + gammalims(&xmin, &xmax); #endif + if (a...