Skip to contents

Element-wise inverse square root on numeric or complex vectors (or objects which can be coerced to them).

Usage

# S3 method for default
rsqrt(x)

Arguments

x

a numeric or complex vector or array.

Value

a numeric or complex vector or array.

Details

rsqrt(x) is equivalent to 1 / sqrt(x) where sqrt() is the default square root function, i.e. \(1/\sqrt{x}\).

Author

Chloe Serre-Combe, Amelie Vernay

Examples

rsqrt(4)
#> [1] 0.5
rsqrt(c(1,4,9,16))
#> [1] 1.0000000 0.5000000 0.3333333 0.2500000