<divclass="platform-hinted UnderCoverText"data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-jafama:dokkaHtmlPartial/main"><pclass="paragraph">Integration with <ahref="https://github.com/jeffhain/jafama">Jafama</a>.</p><ul><li><pclass="paragraph">src/main/kotlin/space/kscience/kmath/jafama/ : Double ExtendedField implementations based on Jafama</p></li></ul><h2class=""> Artifact:</h2><pclass="paragraph">The Maven coordinates of this project are <codeclass="lang-kotlin">space.kscience:kmath-jafama:0.3.1-dev-RC</code>.</p><pclass="paragraph"><strong>Gradle Groovy:</strong></p><divclass="sample-container"><pre><codeclass="block lang-groovy"theme="idea">repositories {<br> maven { url 'https://repo.kotlin.link' }<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation 'space.kscience:kmath-jafama:0.3.1-dev-RC'<br>}</code></pre><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph"><strong>Gradle Kotlin DSL:</strong></p><divclass="sample-container"><pre><codeclass="block lang-kotlin"theme="idea">repositories {<br> maven("https://repo.kotlin.link")<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation("space.kscience:kmath-jafama:0.3.1-dev-RC")<br>}</code></pre><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2class=""> Example usage</h2><pclass="paragraph">All the <codeclass="lang-kotlin">DoubleField</code> uses can be replaced with <codeclass="lang-kotlin">JafamaDoubleField</code> or <codeclass="lang-kotlin">StrictJafamaDoubleField</code>.</p><divclass="sample-container"><pre><codeclass="block lang-kotlin"theme="idea">import space.kscience.kmath.jafama.*<br>import space.kscience.kmath.operations.*<br><br>fun main() {<br> val a = 2.0<br> val b = StrictJafamaDoubleField { exp(a) }<br> println(JafamaDoubleField { b + a })<br> println(StrictJafamaDoubleField { ln(b) })<br>}</code></pre><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2class=""> Performance</h2><pclass="paragraph">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.</p><blockquoteclass="quotation"><pclass="paragraph"><strong>Can't find appropriate benchmark data. Try generating readme files after running benchmarks</strong>.</p></blockquote></div></div>