A long way has been passed, and AppleScript can already do the math fast enough. I will try to replenish the list of functions in this topic:
set x to pi / 3
my cos(x) -- RESULT: 0.5
my sin(x) -- RESULT: 0.866025
my exp(x) -- RESULT: 2.849654
my ln(x) -- RESULT: 0.046118
my tan(x) -- RESULT: 1.732051
my ctan(x) -- RESULT: 0.57735
my atan(x) -- RESULT: 0.808449
my arccot(x) -- RESULT: 0.762348
my arcsin(-pi / 4) -- RESULT: -0.903339
my arccos(-pi / 4) -- RESULT: 2.474135
my logyX(x / 9, 1 / 3) -- Logarithm of pi/27 with base 1/3 -- RESULT: 1.958022
----------------------- COSINE function ----------------------------------------------------------------
on cos(z as real)
set theAccuracy to 1.0E-6 --the precision
set z to z mod (2 * pi)
set aCos to 1
set a to 1
set n to 0
repeat
set n to n + 2
set a to -a * z * z / (n - 1) / n -- new Tailor serie's member
set aCos to aCos + a
if a < 0 then
if -a < theAccuracy then exit repeat
else
if a < theAccuracy then exit repeat
end if
end repeat
return aCos div 1 + (round 1000000 * (aCos mod 1)) / 1.0E+6
end cos
------------------------- SINE function --------------------------------------------------------------
on sin(z as real)
set theAccuracy to 1.0E-6 -- the precision
set z to z mod (2 * pi)
set aSin to z
set a to 1
set n to 0
repeat
set n to n + 2
set a to -a * z * z / (n - 1) / n
set adding to a * z / (n + 1) -- new Tailor serie's member
set aSin to aSin + adding
if adding < 0 then
if -adding < theAccuracy then exit repeat
else
if adding < theAccuracy then exit repeat
end if
end repeat
return aSin div 1 + (round 1000000 * (aSin mod 1)) / 1.0E+6
end sin
---------------------- EXPONENT function -----------------------------------------------------------------
on exp(z as real)
set theAccuracy to 1.0E-6 -- the precision
set aExp to 1
set a to 1
set n to 1
repeat
set n to n + 1
set a to a * z / (n - 1)
set aExp to aExp + a -- add new Tailor serie's member
if a < 0 then
if -a < theAccuracy then exit repeat
else
if a < theAccuracy then exit repeat
end if
end repeat
return aExp div 1 + (round 1000000 * (aExp mod 1)) / 1.0E+6
end exp
----------------------- NATURAL LOGARITHM function ----------------------------------------------------------------
on ln(z as real) -- limitation: z>0
if z ≤ 0 then return "The parameter z should be >0"
set x to (z - 1) / (z + 1) -- convert big number z to number -1<x<1
set theAccuracy to 1.0E-6 -- the precision
set anLn to 2 * x -- first Tailor serie's member
set a to x -- part of Tailor serie's member
set n to 1 -- counter of Tailor serie's member
repeat
set n to n + 1
set a to a * x * x -- update part of Tailor serie's member
set adding to 2 * a / (2 * n - 1) -- new Tailor serie's member
set anLn to anLn + adding -- update ln's value
if adding < 0 then --
if -adding < theAccuracy then exit repeat
else
if adding < theAccuracy then exit repeat
end if
end repeat
return anLn div 1 + (round 1000000 * (anLn mod 1)) / 1.0E+6
end ln
------------------------- TANGENT function ---------------------------------------------------
on tan(z as real)
set z to (z + pi / 2) mod pi - pi / 2
if z = pi / 2 or z = -pi / 2 then return "Infinite Number: ∞"
set theAccuracy to 1.0E-6 -- the precision
set aSin to z
set aCos to 1
set a to 1
set aPreviousTan to 0
set n to 0
repeat
set n to n + 2
set a to -a * z * z / (n - 1) / n
set aCos to aCos + a -- add new Tailor serie's member
set aSin to aSin + a * z / (n + 1) -- add new Tailor serie's member
set atan to aSin / aCos
if atan > aPreviousTan then
if atan - aPreviousTan < theAccuracy then exit repeat
else
if aPreviousTan - atan < theAccuracy then exit repeat
end if
set aPreviousTan to atan
end repeat
return atan div 1 + (round 1000000 * (atan mod 1)) / 1.0E+6
end tan
------------------------- COTANGENT function --------------------------------------------
on ctan(z as real)
set x to (z + pi / 2) mod pi - pi / 2
if x = -pi or x = pi or x = 0 then return "Infinite Number: ∞"
set theAccuracy to 1.0E-6 -- the precision
set aSin to x
set aCos to 1
set a to 1
set aPreviousCotan to 1
set n to 0
repeat
set n to n + 2
set a to -a * x * x / (n - 1) / n
set aCos to aCos + a -- add new Tailor serie's member
set aSin to aSin + a * x / (n + 1) -- add new Tailor serie's member
set aCotan to aCos / aSin
if aCotan > aPreviousCotan then
if aCotan - aPreviousCotan < theAccuracy then exit repeat
else
if aPreviousCotan - aCotan < theAccuracy then exit repeat
end if
set aPreviousCotan to aCotan
end repeat
return aCotan div 1 + (round 1000000 * (aCotan mod 1)) / 1.0E+6
end ctan
------------------------- ARCTANGENT function --------------------------------------------
on atan(z)
set x to z
set theAccuracy to 1.0E-6
set k to 0.57735026919 -- tan(pi/6)
set k0 to 0.26794919243 -- tan(pi/12)
set flag to false -- segmentation flag
if z < 0 then set x to -x
if x > 1 then set x to 1 / x -- limit argument to 0..1
if x > k0 then set {flag, x} to {true, (x - k) / (1 + k * x)} -- determine segmentation
-- Argument is now < tan(pi/12). Approximate the function
set arcTang to x
set dx to x
set n to 1
repeat
set n to n + 1
set dx to -dx * x * x
set adding to dx / (2 * n - 1)
set arcTang to arcTang + adding
if adding > 0 then
if adding < theAccuracy / (n - 1) then exit repeat
else
if -adding < theAccuracy / (n - 1) then exit repeat
end if
end repeat
if flag then set arcTang to arcTang + pi / 6 -- restore offset if needed
if z > 1 or z < -1 then set arcTang to pi / 2 - arcTang -- restore complement if needed
if z < 0 then set arcTang to -arcTang -- restore sign if needed
return arcTang div 1 + (round 1000000 * (arcTang mod 1)) / 1.0E+6
end atan
------------------------- ARCCOTANGENT function --------------------------------------------
on arccot(z)
set z to 1 / z
set x to z
set theAccuracy to 1.0E-6
set k to 0.57735026919 -- tan(pi/6)
set k0 to 0.26794919243 -- tan(pi/12)
set flag to false -- segmentation flag
if z < 0 then set x to -x
if x > 1 then set x to 1 / x -- limit argument to 0..1
if x > k0 then set {flag, x} to {true, (x - k) / (1 + k * x)} -- determine segmentation
-- Argument is now < tan(pi/12). Approximate the function
set arccoTang to x
set dx to x
set n to 1
repeat
set n to n + 1
set dx to -dx * x * x
set adding to dx / (2 * n - 1)
set arccoTang to arccoTang + adding
if adding > 0 then
if adding < theAccuracy / (n - 1) then exit repeat
else
if -adding < theAccuracy / (n - 1) then exit repeat
end if
end repeat
if flag then set arccoTang to arccoTang + pi / 6 -- restore offset if needed
if z > 1 or z < -1 then set arccoTang to pi / 2 - arccoTang -- restore complement if needed
if z < 0 then set arccoTang to -arccoTang -- restore sign if needed
return arccoTang div 1 + (round 1000000 * (arccoTang mod 1)) / 1.0E+6
end arccot
------------------------- ARCSINE function --------------------------------------------
on arcsin(z)
if z < -1 or z > 1 then return "Parametr z should be ≥ -1 and ≤ 1"
if z = -1 then return 1.570796 -- pi/2
set z to z / (1 + (1 - z * z) ^ 0.5)
set x to z
set theAccuracy to 1.0E-6
set k to 0.57735026919 -- tan(pi/6)
set k0 to 0.26794919243 -- tan(pi/12)
set flag to false -- segmentation flag
if z < 0 then set x to -x
if x > 1 then set x to 1 / x -- limit argument to 0..1
if x > k0 then set {flag, x} to {true, (x - k) / (1 + k * x)} -- determine segmentation
-- Argument is now < tan(pi/12). Approximate the function
set arcSine to x
set dx to x
set n to 1
repeat
set n to n + 1
set dx to -dx * x * x
set adding to dx / (2 * n - 1)
set arcSine to arcSine + adding
if adding > 0 then
if adding < theAccuracy / (n - 1) then exit repeat
else
if -adding < theAccuracy / (n - 1) then exit repeat
end if
end repeat
if flag then set arcSine to arcSine + pi / 6 -- restore offset if needed
if z > 1 or z < -1 then set arcSine to pi / 2 - arcSine -- restore complement if needed
if z < 0 then set arcSine to -arcSine -- restore sign if needed
return 2 * arcSine div 1 + (round 1000000 * (2 * arcSine mod 1)) / 1.0E+6
end arcsin
------------------------- ARCCOSINE function --------------------------------------------
on arccos(z)
if z < -1 or z > 1 then return "Parametr z should be ≥ -1 and ≤ 1"
if z = -1 then return -1.570796 -- -pi/2
set z to (1 - z * z) ^ 0.5 / (1 + z)
set x to z
set theAccuracy to 1.0E-6
set k to 0.57735026919 -- tan(pi/6)
set k0 to 0.26794919243 -- tan(pi/12)
set flag to false -- segmentation flag
if z < 0 then set x to -x
if x > 1 then set x to 1 / x -- limit argument to 0..1
if x > k0 then set {flag, x} to {true, (x - k) / (1 + k * x)} -- determine segmentation
-- Argument is now < tan(pi/12). Approximate the function
set arcCosine to x
set dx to x
set n to 1
repeat
set n to n + 1
set dx to -dx * x * x
set adding to dx / (2 * n - 1)
set arcCosine to arcCosine + adding
if adding > 0 then
if adding < theAccuracy / (n - 1) then exit repeat
else
if -adding < theAccuracy / (n - 1) then exit repeat
end if
end repeat
if flag then set arcCosine to arcCosine + pi / 6 -- restore offset if needed
if z > 1 or z < -1 then set arcCosine to pi / 2 - arcCosine -- restore complement if needed
if z < 0 then set arcCosine to -arcCosine -- restore sign if needed
return 2 * arcCosine div 1 + (round 1000000 * (2 * arcCosine mod 1)) / 1.0E+6
end arccos
----------------------- LOGARITHM of X with base Y ------------------------------------------------
on logyX(zx as real, zy as real) -- limitation: zx>0 and zy≠1
if zx ≤ 0 then return "The parameter zx should be >0"
if zy ≤ 0 or zy = 1 then return "The base zy should be >0 and ≠1"
set x to (zx - 1) / (zx + 1) --convert big number zx to number -1<x<1
set y to (zy - 1) / (zy + 1) --convert big number zy to number -1<y<1
set theAccuracy to 1.0E-6 -- the precision
set {Ln1, Ln2} to {2 * x, 2 * y} -- first Tailor serie's member
set anLn to x / y
set oldLn to anLn
set {a1, a2} to {x, y} -- parts of Tailor serie's member
set n to 1 -- counter of Tailor serie's member
repeat
set n to n + 1
set {a1, a2} to {a1 * x * x, a2 * y * y} -- update part of Tailor serie's member
set {adding1, adding2} to {2 * a1 / (2 * n - 1), 2 * a2 / (2 * n - 1)} -- new Tailor serie's members
set {Ln1, Ln2} to {Ln1 + adding1, Ln2 + adding2}
set anLn to Ln1 / Ln2 -- update ln's value
if anLn > oldLn then --
if anLn - oldLn < 0.1 * theAccuracy then exit repeat
else
if oldLn - anLn < 0.1 * theAccuracy then exit repeat
end if
set oldLn to anLn
end repeat
return anLn div 1 + (round 1000000 * (anLn mod 1)) / 1.0E+6
end logyX