--User changes

-cosh, coth, csch, sech, sinh, tanh: Scale inputs by PI/4. This will produce different results, but is technically more correct.

--Code changes
 -cos, csch: move position of sign flip, shouldn't change output.
 -cot, coth, csc, csch, sec, sech, tan, tanh: add optimization.
This commit is contained in:
Person
2019-06-02 14:33:42 -07:00
parent 460dd6254f
commit a117432762
6 changed files with 206 additions and 146 deletions

View File

@ -301,6 +301,17 @@ public:
return v2T(a.x + x, a.y);
}
/// <summary>
/// Subtract complex from complex.
/// </summary>
/// <param name="a">The first complex number</param>
/// <param name="b">The second complex number</param>
/// <returns>a - b</returns>
static v2T ComplexMinusComplex(v2T a, v2T b)
{
return v2T(a.x - b.x, a.y - b.y);
}
/// <summary>
/// Subtract real from complex.
/// </summary>
@ -333,6 +344,16 @@ public:
return v2T(T(0.5) * std::log(a.x * a.x + a.y * a.y), std::atan2(a.y, a.x));
}
/// <summary>
/// Compute the inverse of the natural logarithm of a complex number.
/// </summary>
/// <param name="a">The complex number</param>
/// <returns>exp(a)</returns>
static v2T ComplexExp(v2T a)
{
return v2T(std::cos(a.y), std::sin(a.y)) * std::exp(a.x);
}
/// <summary>
/// Retrieve information about a piece of shared data by looking
/// up its name.