This package implements takum arithmetic, a new tapered
precision machine number format. Eight new data types are defined, namely
Takum8
, Takum16
, Takum32
and Takum64
for the (logarithmic) takums,
a logarithmic number system, and LinearTakum8
, LinearTakum16
,
LinearTakum32
and LinearTakum64
for the linear takums, a floating-point
format. Internally the reference C99 library
libtakum is used for the
actual computations for the most part.
Using this package one is able to evaluate takums for real-world applications in terms of precision. Given it is a software implementation the performance is overall worse than the respective usual IEEE 754 floating-point hardware implementations, but it is sufficient to evaluate the formats for reasonably sized numerical benchmarks.
The eight takum number types Takum8
, Takum16
, Takum32
, Takum64
LinearTakum8
, LinearTakum16
, LinearTakum32
, LinearTakum64
have been implemented to behave as much as any built-in floating-point
type. They are subtypes of AbstractFloat
even though takum itself
is strictly speaking not a floating-point number format, but a
logarithmic number system. However, as the majority of numerical code is
written to accept AbstractFloat
s rather than Real
s and takums share
many properties of a typical floating-point number system, this decision
was made deliberately and for good reasons.
julia> using Takums
julia> x = Takum8(4.0)
Takum8(3.955)
julia> sqrt(x)
Takum8(2.117)
A wide range of functions are implemented for the number types. If you find a floating-point function you need that is not yet implemented, please raise an issue.
Takums.jl is developed by Laslo Hunhold and licensed under the ISC license. See LICENSE for copyright and license details.