squarf <- function(x) { foo <- .Fortran("squarf", x = as.double(x), n = as.integer(length(x)), result = double(length(x))) return(foo$result) }