Calculates arcsine. Fuzz testing shows that relative error is always smaller than 0.01%. Uses the polynomial approximation functions found in, but chooses between them at x=0.4788 due to differences in the relative errors as can be seen here

See the desmos link for what functions f and g in the code refer to.


function g(int256 _x) internal pure returns (int256)


function f(int256 _x) internal pure returns (int256)


function arcsin(int256 _x) internal pure returns (int256)

Arcsine function

Name Type Description
_x int256 A integer with 18 fixed decimal points, where the whole part is bounded inside of [-1,1]
Name Type Description
[0] int256 The arcsine, with 18 fixed decimal points