„Exponenciális függvény” változatai közötti eltérés

[nem ellenőrzött változat][nem ellenőrzött változat]
Tartalom törölve Tartalom hozzáadva
Pasztillabot (vitalap | szerkesztései)
a Rendezés a gondolatjelek körül
267. sor:
 
where ''p'' is the real part of the multiplication:
: <math>\,p = u\log(r) - v\theta</math>
 
and ''q'' is the imaginary part of the multiplication:
274. sor:
Note that all of <math>\,x, y, u, v, r,</math> <math>\,\theta</math>, <math>\,p</math> and <math>\,q</math> are all real values in these computations. The result of <math>\,a^b</math> is thus <math>\,p + qi</math>.
 
Also note that since we compute and use <math>\,\log(r)</math> rather than r itself you don't have to compute the square root. Instead simply compute <math>\,\log(r) = \frac12\log(x^2 + y^2)</math>. Watch out for potential overflow though and possibly scale down the x and y prior to computing <math>\,x^2 + y^2</math> by a suitable power of 2 if <math>\,x</math> and <math>\,y</math> are so large that you would overflow. If you instead run the risk of underflow, scale up by a suitable power of 2 prior to computing the sum of the squares. In either case you then get the scaled version of <math>\,x</math> - we can call it <math>\,x'</math> and the scaled version of <math>\,y</math> - call it <math>\,y'</math> and so you get:
:<math>\,x = x'2^s</math> and <math>\,y = y'2^s</math>