<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
math	B-Library
library	I-Library
(	O
or	O
maths	O
library	O
)	O
is	O
a	O
component	O
of	O
a	O
programming	O
language	O
's	O
standard	B-Library
library	I-Library
containing	O
functions	O
(	O
or	O
subroutines	O
)	O
for	O
the	O
most	O
common	O
mathematical	O
functions	O
,	O
such	O
as	O
trigonometry	O
and	O
exponentiation	O
.	O
</s>
<s>
Bit-twiddling	O
and	O
control	O
functionalities	O
related	O
to	O
floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
may	O
also	O
be	O
included	O
(	O
such	O
as	O
in	O
C	O
)	O
.	O
</s>
<s>
the	O
C	B-Language
standard	I-Language
library	I-Language
math	I-Language
functions	I-Language
,	O
</s>
<s>
In	O
some	O
languages	O
(	O
such	O
as	O
haskell	O
)	O
parts	O
of	O
the	O
standard	B-Library
library	I-Library
(	O
including	O
maths	O
)	O
are	O
imported	O
by	O
default	O
.	O
</s>
<s>
More	O
advanced	O
functionality	O
such	O
as	O
linear	B-Language
algebra	I-Language
is	O
usually	O
provided	O
in	O
3rd	O
party	O
libraries	O
,	O
such	O
as	O
a	O
linear	B-Library
algebra	I-Library
library	I-Library
or	O
vector	O
maths	O
library	O
.	O
</s>
<s>
In	O
a	O
math	B-Library
library	I-Library
,	O
it	O
is	O
frequently	O
useful	O
to	O
use	O
type	B-Language
punning	I-Language
to	O
interpret	O
a	O
floating-point	B-Algorithm
number	I-Algorithm
as	O
an	O
unsigned	O
integer	O
of	O
the	O
same	O
size	O
.	O
</s>
<s>
In	O
more	O
advanced	O
cases	O
,	O
bit	B-Algorithm
twiddling	I-Algorithm
may	O
be	O
used	O
to	O
modify	O
a	O
number	O
in	O
a	O
specific	O
way	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
a	O
high-precision	O
number	O
is	O
expressed	O
as	O
the	O
sum	O
of	O
two	O
or	O
three	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
Transcendental	O
functions	O
such	O
as	O
log	O
,	O
exponential	O
,	O
and	O
trig	O
functions	O
make	O
up	O
the	O
backbone	O
of	O
any	O
math	B-Library
library	I-Library
.	O
</s>
<s>
Range	O
reduction	O
(	O
also	O
argument	O
reduction	O
,	O
domain-spltting	O
)	O
is	O
the	O
first	O
step	O
for	O
any	O
function	O
,	O
after	O
checks	O
for	O
unusual	O
values	O
(	O
infinity	O
and	O
NaN	O
)	O
are	O
performed	O
.	O
</s>
<s>
Logarithm	O
in	O
base	O
2	O
is	O
relatively	O
straightforward	O
,	O
as	O
the	O
integer	O
part	O
k	O
is	O
already	O
in	O
the	O
floating-point	B-Algorithm
exponent	O
;	O
a	O
preliminary	O
range	O
reduction	O
is	O
accordingly	O
performed	O
,	O
yielding	O
k	O
.	O
The	O
mantissa	O
x	O
(	O
where	O
log2(x )	O
is	O
between	O
-1/2	O
and	O
1/2	O
)	O
is	O
then	O
compared	O
to	O
a	O
table	O
and	O
intervals	O
for	O
further	O
reduction	O
into	O
a	O
z	O
with	O
known	O
log2	O
and	O
an	O
in-range	O
x/z	O
,	O
along	O
with	O
polynomial	O
coefficients	O
used	O
for	O
the	O
interval	O
x/z	O
is	O
in	O
.	O
</s>
<s>
Exponential	O
in	O
base	O
2	O
is	O
similarly	O
the	O
"	O
base	O
case	O
"	O
due	O
to	O
floating-point	B-Algorithm
structure	O
.	O
</s>
