Accuracy of Mathematical Functions in Julia

Basic computer arithmetic operations are correctly rounded, whilst mathematical functions such as \(e^{x}\) , \(\ln(x)\) , or \(\sin(x)\) in general are not, meaning that implementations may provide different results when presented with the same input, differing in accuracy. We present a methodology and a software tool suited for exhaustive and non-exhaustive testing of mathematical functions in the Julia programming language. The software (a test bench) is designed to be easy to set up for running the accuracy tests in automatic regression testing. Users only need to supply a list of formats, choose the rounding modes, and specify the input space search strategies based on how long they can afford the testing to run. We have utilized the test bench to determine the errors of a subset of mathematical functions in Julia 1.12.7, for binary16, binary32, and binary64 IEEE 754 floating-point formats, and found maximum errors of \(0.4998\) to \(0.5002\) ULPs in binary16, and \(0.49\) to \(2.41\) ULPs in binary32 and \(0.49\) to \(2.46\) ULPs in binary64. The functions that are correctly rounded (error below \(0.5\) ULP) in binary16 and binary32 are sqrt and cbrt, and only sqrt in binary64. The following functions are correctly rounded only for binary16: asin, atanh, cospi, log2, sinh, sinpi, tanh.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Mathematical Software
Published
2026-10-28
DOI
https://doi.org/10.1145/3860891
Primary Topic
Numerical Methods and Algorithms
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Accuracy of Mathematical Functions in Julia

Mantas Mikaitis, Tejaswa Rizyal, Mosè Giordano
1 links
ACM Transactions on Mathematical Software
Numerical Methods and Algorithms
article

Accuracy of Mathematical Functions in Julia

Mantas Mikaitis, Tejaswa Rizyal, Mosè Giordano
article en

Abstract

Basic computer arithmetic operations are correctly rounded, whilst mathematical functions such as \(e^{x}\) , \(\ln(x)\) , or \(\sin(x)\) in general are not, meaning that implementations may provide different results when presented with the same input, differing in accuracy. We present a methodology and a software tool suited for exhaustive and non-exhaustive testing of mathematical functions in the Julia programming language. The software (a test bench) is designed to be easy to set up for running the accuracy tests in automatic regression testing. Users only need to supply a list of formats, choose the rounding modes, and specify the input space search strategies based on how long they can afford the testing to run. We have utilized the test bench to determine the errors of a subset of mathematical functions in Julia 1.12.7, for binary16, binary32, and binary64 IEEE 754 floating-point formats, and found maximum errors of \(0.4998\) to \(0.5002\) ULPs in binary16, and \(0.49\) to \(2.41\) ULPs in binary32 and \(0.49\) to \(2.46\) ULPs in binary64. The functions that are correctly rounded (error below \(0.5\) ULP) in binary16 and binary32 are sqrt and cbrt, and only sqrt in binary64. The following functions are correctly rounded only for binary16: asin, atanh, cospi, log2, sinh, sinpi, tanh.

ACM Transactions on Mathematical Software
University of Leeds (GB), University College London (GB)
University of Leeds, Engineering and Physical Sciences Research Council
Openalex Percentile: Top 97%
Numerical Methods and Algorithms
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon