#evaluation #function #math #solana #reduce #tachyon #transcendental

tachyon-math-library

Solana library for low compute-unit cost evaluation of transcendental functions

1 unstable release

0.5.2 Dec 13, 2023

#47 in #reduce

50 downloads per month

MIT license

36KB
807 lines

Tachyon

Tachyon is a Solana library for on-chain math. Specifically, it greatly reduces the compute unit cost for evaluating transcendental functions (exp, ln, sin, etc).

Unlike normal arithmetic, evaluating transcendental functions can involve computationally costly algorithms behind the scenes (usually Taylor Series approximations, sometimes more optimized like bitshift calculations for log base 2).

Tachyon uses pre-populated lookup tables combined with interpolation for very accurate function evaluation, and roughly constant compute unit cost.

Tachyon is in the early stages of development, but will soon been deployed on mainnet for public use. Developers may also choose to deploy their own version of Tachyon. Tachyon can also be used to optimize arbitrary use-case specific single-variable functions (if your project has some expensive function that is being called repeatedly).

For implementing Tachyon in your own project, and to see compute unit cost vs. error measurements, please see this repo.

Dependencies

~20–29MB
~497K SLoC