tcal_rs 0.2.0

Number theory functions library - Rust port of libqalculate number theory module
Documentation
/set approximation exact
/set fr 2

x + 3 = 0
	x = -3
-x^2 + 3x = 1
	x = (sqrt(5) + 3) / 2 or x = 3/2 - sqrt(5) / 2
x^3-5x^2-4x+20=0
	x = 5 or x = 2 or x = -2
2x^3 + 5x -5x^2 + 21 = 9x + x^3 + 1
	x = 5 or x = 2 or x = -2
x*(2x^2 + 5 -5x) + 21 = 9x + x^3 +1
	x = 5 or x = 2 or x = -2

abs(x - abs(x)) - (abs(x) - x)
	0
sqrt(8 + 2*sqrt(15)) - (sqrt(5) + sqrt(3))
	0
x / abs(x) - sgn(x)
	0
factor x + 2*sqrt(x) + 1
	(sqrt(x) + 1)^2
abs(x - y) - abs(y - x)
	0
/assume positive
sqrt(x + 2*sqrt(x) + 1)
	sqrt(x) + 1
factor x + 2 * sqrt(xy) + y
	(sqrt(x) + sqrt(y))^2
ln(x^2 + 2*x + 1)
	2 * ln(x + 1)
x^(log(y, x))
	y
/assume unknown

coeff(3x + 4, 0)
	4
coeff(3y + 4, 1)
	3
coeff(3a + 4, 2)
	0
coeff(4x*(2x^2 + 5 -5x), 3)
	8
coeff(x^3-7x^2-4x-5x^2, 2)
	-12
coeff(1+x^3-4x-5x^2-1, 0)
	0
coeff(3x + 4, 1, x)
	3
coeff(3x + 4, 1, y)
	0
coeff(3x + 2y + 4, 1, y)
	2

pcontent(3x + 6)
	3
pcontent(2x^3-4x^2-6x-8x^2)
	2
pcontent(2y^3-3y^2-6y-8y^2)
	1
pcontent(2x^3-3x^2-6x-8x^2, y)
	2x^3 - 11x^2 - 6x

lcoeff(6+ 3x)
	3
lcoeff(6 -5x^2 + 3x^2)
	-2
lcoeff(6 -5x^2 + 3x^2, y)
	6 - 2x^2
lcoeff(6 -5x^2 + 3x^2 + 2y, y)
	2

ldegree(3x)
	1
ldegree(6 -5x^2 - 6)
	2
ldegree(-5x^2, y)
	0
ldegree(3yx^2 + 2y, y)
	1

degree(3x + 6)
	1
degree(2x^3-4x^2-6x-8x^2)
	3
degree(2x^3-3x^2-6x-2x^3)
	2
degree(2x^3-3x^2-6x-2x^3, y)
	0

primpart(3x + 6)
	x + 2
primpart(-12x^3 + 30x - 20)
	6x^3 - 15x + 10
primpart(2xy + 8y + 16, y)
	(xy) / 2 + 2y + 4

tcoeff(6+ 3x)
	6
tcoeff(-5x^2 + 3x - x)
	2
tcoeff(6x -5x^2 + 3x^2, y)
	6x - 2x^2
tcoeff(6 -5x^2 + 3x^2 + 2y, y)
	6 - 2x^2

punit(-3x)
	-1
punit(1-3x)
	-1
punit(3x-1)
	1