Numworks Epsilon  1.4.1
Graphing Calculator Operating System
hyperbolic_arc_tangent.cpp
Go to the documentation of this file.
3 extern "C" {
4 #include <assert.h>
5 }
6 #include <cmath>
7 
8 namespace Poincare {
9 
12 }
13 
16  return a;
17 }
18 
19 Expression * HyperbolicArcTangent::shallowReduce(Context& context, AngleUnit angleUnit) {
20  Expression * e = Expression::shallowReduce(context, angleUnit);
21  if (e != this) {
22  return e;
23  }
24 #if MATRIX_EXACT_REDUCING
25  Expression * op = editableOperand(0);
26  if (op->type() == Type::Matrix) {
27  return SimplificationEngine::map(this, context, angleUnit);
28  }
29 #endif
30  return this;
31 }
32 
33 template<typename T>
34 Complex<T> HyperbolicArcTangent::computeOnComplex(const Complex<T> c, AngleUnit angleUnit) {
35  if (c.b() != 0) {
36  return Complex<T>::Float(NAN);
37  }
38  return Complex<T>::Float(std::atanh(c.a()));
39 }
40 
41 }
#define NAN
Definition: math.h:30
Expression * clone() const override
c(generic_all_nodes)
Expression * editableOperand(int i)
Definition: expression.h:176
#define atanh(x)
Definition: math.h:169
const Expression * m_operands[T]
friend class HyperbolicArcTangent
Definition: expression.h:48
static Complex< T > Float(T x)
Definition: complex.cpp:23