function z = acsc(z)
%ACSC   Inverse cosecant, result in radians.
%   Y = ACSC(X)
%
%   The output Y has the same data format, if any, as the input X.
%
%   Inputs with abs(X) < 1 are not supported because DLARRAY does not
%   support complex numbers.
%
%   See also ACSC, DLARRAY.

%   Copyright 2020 The MathWorks, Inc.

% If this file is modified to not be a standard unary element-wise
% function, please also remove the following template tags.
%#define $UnaryFunction acsc($zdata)
%#template $UnaryElementWiseMaybeComplexTemplate
% Template inserted by deep.dev.generateDlarrayMethods, 2020-03-20 13:49 

% Extract data to work on and create a template output object.
[z, fdz, zdata] = extractUnaryElwiseData(z);

try
    zdata = acsc(matlab.lang.internal.move(zdata));
catch err
    if strcmp(err.identifier, 'parallel:gpu:array:NeedsComplexResult')
        error(message('deep:dlarray:ComplexNotSupported'))
    else
        rethrow(err);
    end
end

if ~isreal(zdata)
    error(message('deep:dlarray:ComplexNotSupported'));
end

z = restoreUnaryElwiseData(z, ...
    matlab.lang.internal.move(fdz), ...
    matlab.lang.internal.move(zdata));
%#template
end
