Open adeeconometrics opened 6 months ago
Function | Forward Mode | Reverse Mode | Scalar | Vector | Matrix |
---|---|---|---|---|---|
arithmetic |
|
|
|
|
|
exp |
|
|
|
|
|
pow |
|
|
|
|
|
ln |
|
|
|
|
|
sin |
|
|
|
|
|
cos |
|
|
|
|
|
tan |
|
|
|
|
|
cot |
|
|
|
|
|
sec |
|
|
|
|
|
csc |
|
|
|
|
|
asin |
|
|
|
|
|
acos |
|
|
|
|
|
atan |
|
|
|
|
|
acot |
|
|
|
|
|
asec |
|
|
|
|
|
acsc |
|
|
|
|
|
sinh |
|
|
|
|
|
cosh |
|
|
|
|
|
tanh |
|
|
|
|
|
coth |
|
|
|
|
|
sech |
|
|
|
|
|
csch |
|
|
|
|
|
asinh |
|
|
|
|
|
acosh |
|
|
|
|
|
atanh |
|
|
|
|
|
acoth |
|
|
|
|
|
asech |
|
|
|
|
|
acsch |
|
|
|
|
|
Review for handling domain errors in inverse and inverse hyperbolic derivative rules
asin
and asinh
acos
and acosh
asec
and asech
atan
and atanh
acot
and acoth
acsc
and acsch
Example:
// WARNING: Domain error should be handled in the future
TEST(RSymbol, AcscScalar) {
ad::RSym a{0.5}; // should include multivariate tests
auto c = acsc(a);
const auto df_c = ad::gradient(c);
EXPECT_DOUBLE_EQ(c.value(), 1.0 / std::asin(0.5));
EXPECT_DOUBLE_EQ(df_c.at(a),
-1.0 / (std::sqrt(1 - std::pow(0.5, 2)) * std::abs(0.5)));
}