Pascal, ≥ 162162 194 bytes
“Extended Pascal” (ISO standard 10206) defines that complex
numbers are part of the language.
When calling one of these functions, a real
argument is automatically promoted to a complex
value (because the formal parameter list says the function
requires a complex
number).
functionconst i=cmplx(0,1);type r=complex;function s(x:complexr):complex;beginr;begin s:=cmplx=−i*ln(0,−1sqrt(1−x*x)*ln+i*x);end;function c(x:r):r;begin c:=−i*ln(sqrt(1−x*xx*x−1)+cmplx+x);end;function t(0,1x:r)*x:r;begin t:=i/2*ln((1−i*x)end/(1+i*x));end
Ungolfed:
const
i = cmplx(0, 1);
function arcsin(protected x: complex): complex;
begin
arcsin := cmplx(0, −1)−i * ln(sqrt(1 − sqr(x)) + cmplx(0, 1)i * x);
end;
function carccos(protected x: complex):complex;begin ccomplex;
begin
arccos :=cmplx(0,−1)*ln= −i * ln(sqrt(x*x−1sqr(x)+x − 1)end + x);
end;
function arccosarctan(protected x: complex): complex;
begin
arccosarctan := cmplx(0,i −1)/ 2 * ln(sqrt(sqr(1 − i * x) −/ (1) + i * x));
end;
Arc tangent is actually already part of the language.
Both in ISO standard 7185 (built“Standard Pascal”) and ISO standard 10206 (“Extended Pascal”) the built-in function arctan
) is available.
Since complex
numbers are defined by EP, only the latter accepts and can return complex
values.
arctan(x)