g | x | w | all
Bytes Lang Time Link
071APL Dyalog Unicode240521T183929ZAdá
115Python + numpy240522T122039ZStef
089Python 3240522T123855Zdr.me123
107Python240522T114229Zcorvus_1
087Google Sheets240522T062401Zz..
091Google Sheets240521T205307Zdoubleun
094JavaScript ES7240521T224652ZArnauld

APL (Dyalog Unicode), 87 71 bytes

Anonymous infix lambda taking [a,b] as left argument, [c,d] as right argument, and returning [x,y] for \$x+yi\$.

{(*-/⍵×⌽p)×2 1○+/⍵×p←({0=⍺:○.5××⍵⋄(¯3○⍵÷⍺)+○(0>⍺)ׯ1*0>⍵}/⍺),.5×⍟+/⍺×⍺}

Try it online!

{} is an anonymous lambda with as left argument and as right argument.

The only operations used (and only on reals) are:

Note that there's no atan2 on the list. I implement it as \$\text{atan2}(a,b)=\big(\tan^{-1}\frac{b}a\big)+\pi\Big(\frac{(1-2[0>b])\,\text{sgn}\,a}2-[0>b]\Big)\$

Python + numpy, 115 bytes

-9 bytes thanks to corvus_192

lambda x,y:[(e:=exp(linalg.det([y,t:=[arctan2(*x[::-1]),log(hypot(*x))]])))*cos(y@t),e*sin(y@t)]
from numpy import*

Attempt This Online!

If someone has a trick to remove a few of these 12 pairs of brackets...

Explanation

To compute (a + i b) ** (c + i d), it is helpful to have the two quantities

c log(norm(a,b)) - d atan2(b,a)
c atan2(b,a) + d log(norm(a,b))

It turns out that withy = (c,d) and t = (atan2(b,a), log(norm(a,b))):

Python 3, 89 bytes

import math
e=lambda a,b,c,d:math.e**((c+1j*d)*(math.log(a**2+b**2)/2+1j*math.atan2(b,a)))

Try it online

Python, 107 bytes

lambda a,b,c,d:[g(c*(p:=atan2(b,a))+d*log(h:=hypot(a,b)))*h**c/exp(d*p)for g in[cos,sin]]
from math import*

Attempt This Online!

A port of Arnaulds JS answer

Google Sheets, 87 bytes

Expects \$a\$, \$b\$, \$c\$, \$d\$ in \$A1\$, \$B1\$, \$C1\$, \$D1\$ respectively and it returns the result in two horizontally adjacent cells.

=LET(a,LN(A1^2+B1^2)/2,b,ATAN2(A1,B1),c,EXP(C1*a-D1*b),d,C1*b+D1*a,{c*COS(d),c*SIN(d)})

enter image description here

Google Sheets, 91 bytes

=let(s,A1^2+B1^2,a,atan2(A1,B1),r,s^(C1/2)/exp(D1*a),u,C1*a+D1*ln(s)/2,{r*cos(u),r*sin(u)})

Put the four coefficients in cells A1:D1 and the formula in cell E1.

Returns the real and imaginary parts as a two-element array. To get an actual complex number, replace the final { array expression } with complex() (98 bytes) or text() (119 bytes, see the edits). The latter gives negative imaginary part with unary plus, as in -0.266+-0.082i, which is a valid complex number format in Google Sheets as well.

screenshot

Ungolfed:

=let( 
  s, A1^2 + B1^2, 
  a, atan2(A1, B1), 
  r, s^(C1 / 2) / exp(D1 * a), 
  u, C1 * a + D1 * ln(s) / 2, 
  { r * cos(u), r * sin(u) } 
)

-5 bytes thanks to Arnauld.

The same in JavaScript (non-competing, 102 bytes):

with(Math)f=(a,b,c,d,s=a*a+b*b,p=atan2(b,a),r=s**(c/2)/exp(d*p),u=c*p+d*log(s)/2)=>[r*cos(u),r*sin(u)]

JavaScript (ES7), 94 bytes

Returns [real, img].

This is essentially the formula used by doubleunary, except I'm computing \$\sqrt{a^2+b^2}\$ (with hypot) instead of \$a^2+b^2\$ to get rid of both divisions by 2.

with(Math)f=(a,b,c,d,p=atan2(b,a))=>[cos,sin].map(g=>g(c*p+d*log(h=hypot(a,b)))*h**c/exp(d*p))

Try it online!