diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/core/utils.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/core/utils.kt index 33e78db33..d8a073d64 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/core/utils.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/core/utils.kt @@ -38,5 +38,5 @@ internal fun Buffer.array(): DoubleArray = when (this) { internal inline fun getRandomNormals(n: Int, seed: Long): DoubleArray { val u = Random(seed) - return (0 until n).map { sqrt(-2.0 * u.nextDouble()) * cos(2.0 * PI * u.nextDouble()) }.toDoubleArray() + return (0 until n).map { sqrt(-2.0 * ln(u.nextDouble())) * cos(2.0 * PI * u.nextDouble()) }.toDoubleArray() }