kmath/kmath-jafama
2024-03-27 09:51:23 +03:00
..
api Prepare for 0.4.0 release 2024-02-18 15:05:56 +03:00
docs Reformat code 2024-03-27 09:11:12 +03:00
src/main/kotlin/space/kscience/kmath/jafama Merge branch 'dev' into dev-0.4 2024-02-07 21:53:49 +03:00
build.gradle.kts 0.4 WIP 2023-11-18 22:29:59 +03:00
README.md Dump API. Update readme 2024-03-27 09:51:23 +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.4.0.

Gradle Kotlin DSL:

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

dependencies {
    implementation("space.kscience:kmath-jafama:0.4.0")
}

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.