Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 19/05/2016
- --Last update: 26/05/2016
- --[[ Notes:
- Does:
- As funções-raiz de muitas funções da biblioteca oficial de math
- xatan
- Does:
- Avalia uma série válida no intervalo [0,0.66].
- Args:
- x --> Número
- satan
- Does:
- Reduz seus argumentos (conhecido por ser positivo). Requer xatan
- Args:
- x --> Número
- ]]--
- xatan=function(x)
- local P = {
- -8.750608600031904122785e-01,
- -1.615753718733365076637e+01,
- -7.500855792314704667340e+01,
- -1.228866684490136173410e+02,
- -6.485021904942025371773e+01,
- }
- local Q = {
- 2.485846490142306297962e+01,
- 1.650270098316988542046e+02,
- 4.328810604912902668951e+02,
- 4.853903996359136964868e+02,
- 1.945506571482613964425e+02,
- }
- local z = x^2
- z = z * ((((P[1]*z+P[2])*z+P[3])*z+P[4])*z + P[5])/(((((z+Q[1])*z+Q[2])*z+Q[3])*z+Q[4])*z + Q[5])
- z = x*z + x
- return z
- end
- satan=function(x)
- if x <= .66 then
- return xatan(x)
- end
- if x > 2.41421356237309504880 then
- return math.pi/2-xatan(1/x)
- end
- return math.pi/4+xatan((x-1)/(x+1)) + .5*6.123233995736765886130e-17
- end
Advertisement
Add Comment
Please, Sign In to add comment