search for: fmin

Displaying 20 results from an estimated 105 matches for "fmin".

Did you mean: fin
2014 Aug 13
5
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
Hi, I’d like to re-propose adding intrinsics for fmin / fmax. These can be used to implement the equivalent libm functions as defined in C99 and OpenCL, which R600 and AArch64 at least have instructions with the same semantics. This is not equivalent to a simple fcmp + select due to its handling of NaNs. This has been proposed before, but never deli...
2014 Aug 14
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
...uld still be left unspecified as they're optional in IEEE-754). > > - Steve > > Sent from my iPhone > >> On Aug 13, 2014, at 7:38 PM, Matt Arsenault <arsenm2 at gmail.com> wrote: >> >> Hi, >> >> I’d like to re-propose adding intrinsics for fmin / fmax. These can be used to implement the equivalent libm functions as defined in C99 and OpenCL, which R600 and AArch64 at least have instructions with the same semantics. This is not equivalent to a simple fcmp + select due to its handling of NaNs. >> >> This has been proposed befo...
2014 Aug 18
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
...fraunhofer.de/> > > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Stephen Canon > Sent: Thursday, August 14, 2014 18:03 > To: Matt Arsenault > Cc: llvm-commits; LLVM Developers Mailing List > Subject: Re: [LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics > > … actually, now that I’m able double-check this, I’m quite surprised to find that we didn’t define fmax(+0,–0) in IEEE–754, which says [paraphrased]: > > minNum(x,y) is x if x < y, y if y < x, and the number if one is a number and the other is N...
2014 Aug 18
3
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
...e can easily be expanded into IR, and does not have the wide hardware support (particularly in GPUs) that the IEEE version does. —Owen > On Aug 18, 2014, at 12:00 PM, Carter Schonwald <carter.schonwald at gmail.com> wrote: > > would it be in scope to have intrinsics analogues for fmin/fmax that return Nan if either arg is a nan? > Julia Lang and GHC Haskell are both likely to change their definitions of min/max on floats/doubles to return nan if either arg is Nan. > See here  <https://github.com/JuliaLang/julia/issues/7866> for the julia lang discussion, and I'...
1999 Dec 07
0
Minimize function of several variables?
Hi, Is there something like the Matlab function FMINS in any R packages? Here is the help file of fmins in case something similar exist under R with a different name. Thanks in advance. Yves Gauvreau *********************** function [x, options] = fmins(funfcn,x,options,grad,varargin) %FMINS Minimize function of several variables. % X = FMINS(...
2009 Mar 19
1
.Internal
I was trying to find source for optimize and I ran across function (f, interval, ..., lower = min(interval), upper = max(interval), maximum = FALSE, tol = .Machine$double.eps^0.25) { if (maximum) { val <- .Internal(fmin(function(arg) -f(arg, ...), lower, upper, tol)) list(maximum = val, objective = f(val, ...)) } else { val <- .Internal(fmin(function(arg) f(arg, ...), lower, upper, tol)) list(minimum = val, objective = f(val, ...)) } } Then I did a...
2018 Jul 23
2
RFC: What is the real behavior for the minnum/maxnum intrinsics?
...e are two problems. First the expected behavior for signaling NaNs needs to be clarified. Second, whether the returned value is expected to be canonicalized (as if by llvm.canonicalize). Currently according to the LangRef: Follows the IEEE-754 semantics for minNum, which also match for libm's fmin. If either operand is a NaN, returns the other non-NaN operand. Returns NaN only if both operands are NaN. If the operands compare equal, returns a value that compares equal to both operands. This means that fmin(+/-0.0, +/-0.0) could return either -0.0 or 0.0. This first line is a lie. This isn’...
2014 Sep 17
4
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
...posal. I could even be convinced if we wanted to add a pair of NaN-propagating intrinsics as well, for targets and languages that want those semantics, even if I disagree with them. I do think that, if we are using the minnum/maxnum names, we should explicitly note that they are equivalent to C’s fmin/fmax, but not std::min/std::max or Java(script)’s min/max. > > —Owen > > >> On Sep 15, 2014, at 12:26 PM, Dan Gohman <dan433584 at gmail.com> wrote: >> >> Given IEEE-754's sway, and its saying what it does on this point, but given also the popularity of N...
2006 Dec 28
1
calling optimize/fmin from C code
Hi, To make a calculation (an innermost loop) that uses optimize faster, I think I should write things in C. Is it possible to call fmin, which is called by optimize, from C? It is not listed in Writing R extensions, but I found double Brent_fmin(double ax, double bx, double (*f)(double, void *), void *info, double tol); in Applic.h. Is this the function I am looking for? My guess is that ax and bx are the end...
2014 Sep 15
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
Given IEEE-754's sway, and its saying what it does on this point, but given also the popularity of NaN-propagating min and max, how about a compromise? We add intrinsics following the IEEE-754 semantics, but we also follow IEEE-754 (and ARMv8) in renaming them to minnum and maxnum, to clarify which interpretation these intrinsics are using. -------------- next part -------------- An HTML
2014 Sep 12
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
> On Sep 12, 2014, at 10:27 AM, Dan Gohman <dan433584 at gmail.com> wrote: > > > More generally, I don’t see a compelling reason for LLVM to add intrinsic support for the version you’re proposing. Your choice can easily be expanded into IR, and does not have the wide hardware support (particularly in GPUs) that the IEEE version does. > > The IEEE version can also be
2011 Nov 16
1
"Non-finite finite-difference value" error in eha's aftreg
Hi list! I'm getting an error message when trying to fit an accelerated failure time parametric model using the aftreg() function from package eha: > Error in optim(beta, Fmin, method = "BFGS", control = list(trace = > as.integer(printlevel)), : > non-finite finite-difference value [2] This only happens when adding four specific covariates at the same time in the model (see below). I understand that kind of problem can come from a too high correlatio...
2014 Sep 13
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
...ion that it's a popular flag. > Also, as a practical issues, many GPUs have ISA-level support for the > IEEE-conforming version. Some (all?) of the AMD GPUs that Matt cares about > support it, and PTX has native operations for it as well. The IR expansion > of an IEEE-conforming fmin/fmax is at least three compares + selects, which > makes it very difficult to pattern match for these targets. > It's 2 compares + selects: float nan_swallowing_fmin(float a, float b) { return b != b ? a : (a < b ? a : b); } which is within the realm of pattern-matching. > &g...
2018 Jul 26
3
RFC: What is the real behavior for the minnum/maxnum intrinsics?
...gnaling NaNs needs to be clarified. Second, whether the >> returned value is expected to be canonicalized (as if by llvm.canonicalize). >> >> Currently according to the LangRef: >> >> Follows the IEEE-754 semantics for minNum, which also match for libm's >> fmin. >> >> If either operand is a NaN, returns the other non-NaN operand. Returns >> NaN only if both operands are NaN. If the operands compare equal, >> returns a value that compares equal to both operands. This means that >> fmin(+/-0.0, +/-0.0) could return either -0.0...
2007 Nov 10
1
polr() error message wrt optim() and vmmin
Hi, I'm getting an error message using polr(): Error in optim(start, fmin, gmin, method = "BFGS", hessian = Hess, ...) : initial value in 'vmmin' is not finite The outcome variable is ordinal and factored, and the independant variable is continuous. I've checked the source code for both polr() and optim() and can't find any variable...
2018 Apr 17
2
iterative read - write
...;")* *# create and calculate a new variable for time between call pusles * *Corbre_2 [c("TBC")] <- recode.variables(Corbre_2[c("TBC")] , "0 -> NA;")* *# Create new BW variable for band width then change data file name* *BW<-within(Corbre_2,BW<-Fmax-Fmin)* *# Create 2 new variables for fundamental H1 and third harmonic H3 frequencies * *#based on Fc that is generally loudest at the 2^nd harmonic.* *BW<-within(BW,FcH1<-Fc*.5)* *BW<-within(BW,FcH3<-FcH1*3)* *#rename to a DF to calculate the stats * *BatStats<-BW* *BatStats<-...
2008 Sep 28
0
constrained logistic regression: Error in optim() with method = "L-BFGS-B"
...per values for the variables. Here is the function, logitregVR <- function(x, y, wt = rep(1, length(y)), intercept = T, start = rep(0.1, p), ...) { #-------------------------------------------# # A function to be minimized (or maximized) # #-------------------------------------------# fmin <- function(beta, X, y, w) { p <- plogis(X %*% beta) -sum(2*w*ifelse(y, log(p), log(1-p))) # Residual Deviance: D = -2[Likelihood Ratio] #print(-sum(2*w*ifelse(y, log(p), log(1-p)))) } #----------------------------------------------------------------------# # A function to r...
2012 Dec 05
6
[LLVMdev] max/min intrinsics
...were recognized rather than looking for compare-select sequences. The suggestion was to change compare-selects into max and min intrinsic calls during instcombine. The intrinsics to add are: declare iN llvm.{smin,smax}.iN(iN %a, iN %b) declare iN llvm.{umin,umax}.iN(iN %a, iN %b) declare fN llvm.{fmin,fmax}.fN(fN %a, fN %b) What does the community think? Paul
2006 Mar 29
1
calling R's optimization routines from C
...ble sum = 0.0; int i; for (i=0; i<n; i++) { double t = X[i] - mu; sum += t*t; } return sum; } int main(void) { int i,n=1, trace=1, maxit=100, fail, fncount; double *par, abstol=0.0001, intol=.0001, alpha=1, beta=.5, gamma=2, *xin, *x, Fmin; MyData ex; par=malloc(n*sizeof(double)); xin=malloc(n*sizeof(double)); x=malloc(n*sizeof(double)); par[0]=5; xin[0]=5; ex.n=5; ex.X=malloc(ex.n*sizeof(double)); for(i=0;i<ex.n;i++) ex.X[i]=i; nmmin(n,xin,x,&Fmin,myfunc,&fail,abstol,intol,&ex,alpha,...
2008 Sep 29
0
Logistic Regression using optim() give "L-BFGS-B" error, please help
...lower/upper values for the variables. Here is the function, logitregVR <- function(x, y, wt = rep(1, length(y)), intercept = T, start = rep(0, p), ...) { #-------------------------------------------# # A function to be minimized (or maximized) # #-------------------------------------------# fmin <- function(beta, X, y, w) { p <- plogis(X %*% beta) #p <- ifelse(1-p < 1e-6, 1-1e-6, p) cat("----------", "\n") cat(paste("X = "), X, "\n") cat(paste("beta = "), beta, "\n") cat(paste("p = "), p, "\n&q...