kmath/kmath-jafama
2022-07-24 12:01:02 +03:00
..
docs Generated benchmarking reports 2021-06-15 17:14:18 +07:00
src/main/kotlin/space/kscience/kmath/jafama Revert license removal and update copyright 2021-11-16 18:14:34 +07:00
build.gradle.kts Update gradle-tools, do Kotlin 1.6.0 migrations 2021-11-24 15:32:06 +07:00
README.md Fix readme 2022-07-24 12:01:02 +03:00

Module kmath-jafama

Integration with Jafama.

  • jafama-double : Double ExtendedField implementations based on Jafama

Artifact:

The Maven coordinates of this project are space.kscience:kmath-jafama:0.3.1-dev-1.

Gradle Groovy:

repositories {
    maven { url 'https://repo.kotlin.link' }
    mavenCentral()
}

dependencies {
    implementation 'space.kscience:kmath-jafama:0.3.1-dev-1'
}

Gradle Kotlin DSL:

repositories {
    maven("https://repo.kotlin.link")
    mavenCentral()
}

dependencies {
    implementation("space.kscience:kmath-jafama:0.3.1-dev-1")
}

Example usage

All the DoubleField uses can be replaced with JafamaDoubleField or StrictJafamaDoubleField.

import space.kscience.kmath.jafama.*
import space.kscience.kmath.operations.*

fun main() {
    val a = 2.0
    val b = StrictJafamaDoubleField { exp(a) }
    println(JafamaDoubleField { b + a })
    println(StrictJafamaDoubleField { ln(b) })
}

Performance

According to KMath benchmarks on GraalVM, Jafama functions are slower than JDK math; however, there are indications that on Hotspot Jafama is a bit faster.

Can't find appropriate benchmark data. Try generating readme files after running benchmarks.