#ifndef POINCARE_HYPERBOLIC_TANGENT_H #define POINCARE_HYPERBOLIC_TANGENT_H #include #include #include namespace Poincare { class HyperbolicTangent : public StaticHierarchy<1> { using StaticHierarchy<1>::StaticHierarchy; public: Type type() const override; Expression * clone() const override; template static std::complex computeOnComplex(const std::complex c, AngleUnit angleUnit); private: /* Layout */ ExpressionLayout * createLayout(PrintFloat::Mode floatDisplayMode, int numberOfSignificantDigits) const override { return LayoutEngine::createPrefixLayout(this, floatDisplayMode, numberOfSignificantDigits, name()); } int writeTextInBuffer(char * buffer, int bufferSize, PrintFloat::Mode floatDisplayMode, int numberOfSignificantDigits) const override { return LayoutEngine::writePrefixExpressionTextInBuffer(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, name()); } const char * name() const { return "tanh"; } /* Simplification */ Expression * shallowReduce(Context& context, AngleUnit angleUnit) override; /* Evaluation */ Evaluation * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override { return ApproximationEngine::map(this, context, angleUnit,computeOnComplex); } Evaluation * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override { return ApproximationEngine::map(this, context, angleUnit, computeOnComplex); } }; } #endif