--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

@ -177,6 +177,11 @@ FunctionMapper::FunctionMapper()
"{\n"
" return (real2)(a.x - x, a.y);\n"
"}\n";
s_GlobalMap["ComplexMinusComplex"] =
"inline real2 ComplexMinusComplex(real2 a, real2 b)\n"
"{\n"
" return (real2)(a.x - b.x, a.y - b.y);\n"
"}\n";
s_GlobalMap["ComplexSqrt"] =
"inline real2 ComplexSqrt(real2 a)\n"
"{\n"
@ -188,6 +193,11 @@ FunctionMapper::FunctionMapper()
"{\n"
" return (real2)(0.5 * log(fma(a.x, a.x, a.y * a.y)), atan2(a.y, a.x));\n"
"}\n";
s_GlobalMap["ComplexExp"] =
"inline real2 ComplexExp(real2 a)\n"
"{\n"
" return (real2)(cos(a.y), sin(a.y)) * exp(a.x);\n"
"}\n";
s_GlobalMap["Hash"] =
"inline real_t Hash(int a)\n"
"{\n"