#include #include #include #include #include #include #include extern "C" { #include } #include namespace Poincare { Expression::Type HyperbolicSine::type() const { return Type::HyperbolicSine; } Expression * HyperbolicSine::clone() const { HyperbolicSine * a = new HyperbolicSine(m_operands, true); return a; } Expression * HyperbolicSine::shallowReduce(Context& context, AngleUnit angleUnit) { Expression * e = Expression::shallowReduce(context, angleUnit); if (e != this) { return e; } #if MATRIX_EXACT_REDUCING Expression * op = editableOperand(0); if (op->type() == Type::Matrix) { return SimplificationEngine::map(this, context, angleUnit); } #endif return this; } template Complex HyperbolicSine::computeOnComplex(const Complex c, AngleUnit angleUnit) { if (c.b() == 0) { return Complex::Float(std::sinh(c.a())); } Complex e = Complex::Float(M_E); Complex exp1 = Power::compute(e, c); Complex exp2 = Power::compute(e, Complex::Cartesian(-c.a(), -c.b())); Complex sub = Subtraction::compute(exp1, exp2); return Division::compute(sub, Complex::Float(2)); } }