0

I work on DSP code, where some equations are of form:

tanh(x) = a*x + b (tanh or other hyperbolic functions)

Currently I use Newton-Raphson method. Is there a better/faster method of finding solution for this case?

I can use values in precomputed array.. but only one dimensional.

  • Newton's method should converge extremely rapidly for a problem of this type, even if you always take $x_0 = 0$. That said, a method based on inversion of power series could arguably be more efficient. – Ian Nov 05 '14 at 18:43
  • Also note that tanh and sech are the easiest cases here, because they are actually bounded. $\tanh$ in particular is in $[-1,1]$, which means that your solution is necessarily between $(-1-b)/a$ and $(1-b)/a$. So you can take your initial condition to be $-b/a$ and go from there. – Ian Nov 05 '14 at 18:56
  • Yes its about 4-5 iterations to 0.00001, but still quite expensive. How about lambert W, can this be utilized here? – user1132968 Nov 05 '14 at 18:58
  • I think the Lambert W function makes the tanh and sech problems worse if it can be applied at all, because it is computing the inverse of an unbounded function. The tanh and sech problems are really very well-posed already, all of the function evaluations are easy and the solution is known to be in a specified interval a priori. The cosh and sinh problems are more involved. – Ian Nov 05 '14 at 19:02
  • I just wonder if I can utilise a 1 dimensional precomputed array (lambert w would be). – user1132968 Nov 05 '14 at 19:07
  • Again, what would Lambert W get you? You can turn the problem into a Lambert W problem in some sense by writing the problem as $\frac{\exp(x) (\tanh(x)-b)}{a} = x \exp(x)$ i.e. $x=W \left ( \frac{\exp(x) (\tanh(x)-b)}{a} \right )$, but that really just makes the problem more badly scaled. I'm also still somewhat confused as to how 4-5 Newton iterations is actually expensive when the only special function evaluation is tanh and sech (which are easy to compute by just precisely computing $\exp$ once). – Ian Nov 05 '14 at 20:48

0 Answers0