Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,13 +1,14 @@
|
|||
library(gmp) #for big number factorization
|
||||
options(scipen=20)
|
||||
|
||||
arith_deriv <- function(x){
|
||||
arith_deriv <- function(x) {
|
||||
if(x %in% c(0, 1, -1)) return(0)
|
||||
n <- abs(x)
|
||||
facs <- as.numeric(factorize(n))
|
||||
nfacs <- length(facs)
|
||||
if(nfacs==1) return(sign(x))
|
||||
if(nfacs == 1) return(sign(x))
|
||||
d <- sum(facs[1:2])
|
||||
if(nfacs>2){
|
||||
if(nfacs > 2) {
|
||||
c_prod <- cumprod(facs)
|
||||
for(i in 3:nfacs) d <- d*facs[i]+c_prod[i-1]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue