Here's my code:
Code: Select all
arsinh(x) {
static terms := [0, 0, 0, 0, 0, 0, 0, 0]
If x is not number
return
power := 1, s := abs(x)
While s > .0625
s := sqrt(sqrt(s * s + 1) - 1), power *= 2
terms[1] := x := (x < 0 ? -1 : 1) * s, term := 2, term_pwr := 3, xc := .5, xt := x, xf := x * x
While term <= 8
terms[term] := (term & 1 ? 1 : -1) * xc * (xt *= xf) / term_pwr, ++term, xc *= term_pwr, xc /= term_pwr + 1, term_pwr += 2
sum := 0, term := 8
While term > 0
sum += terms[term--]
return sum * power
}
Can someone tell me what's wrong with this function?