10 using TransformVisitor::bvisit;
14 void bvisit(
const Sin &x)
17 auto newarg = apply(farg);
18 auto expo =
mul(I, newarg);
24 void bvisit(
const Cos &x)
27 auto newarg = apply(farg);
28 auto expo =
mul(I, newarg);
34 void bvisit(
const Tan &x)
37 auto newarg = apply(farg);
38 auto expo =
mul(I, newarg);
44 void bvisit(
const Cot &x)
47 auto newarg = apply(farg);
48 auto expo =
mul(I, newarg);
54 void bvisit(
const Csc &x)
57 auto newarg = apply(farg);
58 auto expo =
mul(I, newarg);
64 void bvisit(
const Sec &x)
67 auto newarg = apply(farg);
68 auto expo =
mul(I, newarg);
74 void bvisit(
const Sinh &x)
77 auto newarg = apply(farg);
81 void bvisit(
const Cosh &x)
84 auto newarg = apply(farg);
88 void bvisit(
const Tanh &x)
91 auto newarg = apply(farg);
92 auto pos_exp =
exp(newarg);
93 auto neg_exp =
exp(
neg(newarg));
94 result_ =
div(
sub(pos_exp, neg_exp),
add(pos_exp, neg_exp));
97 void bvisit(
const Csch &x)
100 auto newarg = apply(farg);
101 auto pos_exp =
exp(newarg);
102 auto neg_exp =
exp(
neg(newarg));
106 void bvisit(
const Sech &x)
109 auto newarg = apply(farg);
110 auto pos_exp =
exp(newarg);
111 auto neg_exp =
exp(
neg(newarg));
115 void bvisit(
const Coth &x)
118 auto newarg = apply(farg);
119 auto pos_exp =
exp(newarg);
120 auto neg_exp =
exp(
neg(newarg));
121 result_ =
div(
add(pos_exp, neg_exp),
sub(pos_exp, neg_exp));
125 RCP<const Basic> rewrite_as_exp(
const RCP<const Basic> &x)
134 using TransformVisitor::bvisit;
138 void bvisit(
const Cos &x)
141 auto newarg = apply(farg);
145 void bvisit(
const Tan &x)
148 auto newarg = apply(farg);
153 void bvisit(
const Cot &x)
156 auto newarg = apply(farg);
161 void bvisit(
const Csc &x)
164 auto newarg = apply(farg);
168 void bvisit(
const Sec &x)
171 auto newarg = apply(farg);
177 RCP<const Basic> rewrite_as_sin(
const RCP<const Basic> &x)
186 using TransformVisitor::bvisit;
190 void bvisit(
const Sin &x)
193 auto newarg = apply(farg);
197 void bvisit(
const Tan &x)
200 auto newarg = apply(farg);
205 void bvisit(
const Cot &x)
208 auto newarg = apply(farg);
209 result_ =
div(
cos(newarg),
213 void bvisit(
const Csc &x)
216 auto newarg = apply(farg);
221 void bvisit(
const Sec &x)
224 auto newarg = apply(farg);
229 RCP<const Basic> rewrite_as_cos(
const RCP<const Basic> &x)
The base class for SymEngine.
RCP< const Basic > get_arg() const
Main namespace for SymEngine package.
RCP< const Basic > div(const RCP< const Basic > &a, const RCP< const Basic > &b)
Division.
std::enable_if< std::is_integral< T >::value, RCP< const Integer > >::type integer(T i)
RCP< const Basic > sub(const RCP< const Basic > &a, const RCP< const Basic > &b)
Substracts b from a.
RCP< const Basic > exp(const RCP< const Basic > &x)
Returns the natural exponential function E**x = pow(E, x)
RCP< const Basic > mul(const RCP< const Basic > &a, const RCP< const Basic > &b)
Multiplication.
RCP< const Basic > cos(const RCP< const Basic > &arg)
Canonicalize Cos:
RCP< const Basic > add(const RCP< const Basic > &a, const RCP< const Basic > &b)
Adds two objects (safely).
RCP< const Basic > neg(const RCP< const Basic > &a)
Negation.
RCP< const Basic > sin(const RCP< const Basic > &arg)
Canonicalize Sin: