I would like to speed up "times" operation(^
) in R.
x <- rnorm(2e+5)
require(rbenchmark)
benchmark(x^(3.33), x^2, x^1, replications = 500)
test replications elapsed relative user.self sys.self user.child sys.child
1 x^(3.33) 500 9.22 46.10 9.03 0.04 NA NA
3 x^1 500 5.47 27.35 5.36 0.10 NA NA
2 x^2 500 0.20 1.00 0.17 0.04 NA NA
Can I somehow speed up the first operation (x^(3.33)
)?
Why x^1
is so slow?
P.S. Where can I find the code of ^
operator?