41 if (args.length () != 2)
44 bool is_single = args(0).is_single_type () || args(1).is_single_type ();
47 int numel_x = args(0).numel ();
48 int numel_a = args(1).numel ();
49 int len = std::max (numel_x, numel_a);
65 x = args(0).float_array_value ();
68 a =
FloatNDArray (output_dv, args(1).float_scalar_value ());
70 a = args(1).float_array_value ();
73 static const float tiny = math::exp2 (-50.0f);
74 static constexpr float eps = std::numeric_limits<float>::epsilon();
75 float y, Cj, Dj, bj, aj, Deltaj;
95 while ((std::abs ((Deltaj - 1) / y) >
eps) && (j < maxit))
98 Dj = 1 / (bj + aj*Dj);
118 x =
NDArray (output_dv, args(0).scalar_value ());
120 x = args(0).array_value ();
123 a =
NDArray (output_dv, args(1).scalar_value ());
125 a = args(1).array_value ();
128 static const double tiny = math::exp2 (-100.0);
129 static constexpr double eps = std::numeric_limits<double>::epsilon();
130 double y, Cj, Dj, bj, aj, Deltaj;
144 bj =
x(i) - a(i) + 1;
150 while ((std::abs ((Deltaj - 1) / y) >
eps) && (j < maxit))
153 Dj = 1 / (bj + aj*Dj);
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.