Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f5dc966e71
Fetching contributors…

Cannot retrieve contributors at this time

499 lines (449 sloc) 15.044 kB
// DO NOT EDIT! Autogenerated file, created by tools/make_trig_code.pl.
using Niecza;
using System;
public partial class Builtins {
static readonly Func<Variable,Variable> sin_d = sin;
public static Variable sin(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, sin_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Sin());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Sin(v1));
}
}
static readonly Func<Variable,Variable> asin_d = asin;
public static Variable asin(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, asin_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Asin());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Asin(v1));
}
}
static readonly Func<Variable,Variable> cos_d = cos;
public static Variable cos(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cos_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cos());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Cos(v1));
}
}
static readonly Func<Variable,Variable> acos_d = acos;
public static Variable acos(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acos_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acos());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Acos(v1));
}
}
static readonly Func<Variable,Variable> tan_d = tan;
public static Variable tan(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, tan_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Tan());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Tan(v1));
}
}
static readonly Func<Variable,Variable> atan_d = atan;
public static Variable atan(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, atan_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Atan());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Atan(v1));
}
}
static readonly Func<Variable,Variable> sinh_d = sinh;
public static Variable sinh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, sinh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Sinh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Sinh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> asinh_d = asinh;
public static Variable asinh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, asinh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Asinh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Asinh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> cosh_d = cosh;
public static Variable cosh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cosh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cosh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Cosh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> acosh_d = acosh;
public static Variable acosh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acosh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acosh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Acosh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> tanh_d = tanh;
public static Variable tanh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, tanh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Tanh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Tanh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> atanh_d = atanh;
public static Variable atanh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, atanh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Atanh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Atanh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> acotanh_d = acotanh;
public static Variable acotanh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acotanh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acotanh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Acotanh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> asec_d = asec;
public static Variable asec(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, asec_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Asec());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Acos(1 / v1));
}
}
static readonly Func<Variable,Variable> cosech_d = cosech;
public static Variable cosech(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cosech_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cosech());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Cosech();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> acosech_d = acosech;
public static Variable acosech(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acosech_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acosech());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Acosech();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> sec_d = sec;
public static Variable sec(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, sec_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Sec());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(1 / Math.Cos(v1));
}
}
static readonly Func<Variable,Variable> acosec_d = acosec;
public static Variable acosec(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acosec_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acosec());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Asin(1 / v1));
}
}
static readonly Func<Variable,Variable> cotanh_d = cotanh;
public static Variable cotanh(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cotanh_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cotanh());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Cotanh();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> sech_d = sech;
public static Variable sech(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, sech_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Sech());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Sech();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
static readonly Func<Variable,Variable> cotan_d = cotan;
public static Variable cotan(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cotan_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cotan());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(1 / Math.Tan(v1));
}
}
static readonly Func<Variable,Variable> acotan_d = acotan;
public static Variable acotan(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, acotan_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Acotan());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(Math.Atan(1 / v1));
}
}
static readonly Func<Variable,Variable> cosec_d = cosec;
public static Variable cosec(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, cosec_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Cosec());
}
{
double v1 = PromoteToFloat(r1, n1);
return MakeFloat(1 / Math.Sin(v1));
}
}
static readonly Func<Variable,Variable> asech_d = asech;
public static Variable asech(Variable a1) {
P6any o1 = a1.Fetch();
int r1;
if (!o1.mo.is_any)
return HandleSpecial1(a1,o1, asech_d);
P6any n1 = GetNumber(a1, o1, out r1);
if (r1 == NR_COMPLEX) {
Complex v1 = PromoteToComplex(r1, n1);
return MakeComplex(v1.Asech());
}
{
Complex v1 = PromoteToComplex(r1, n1);
Complex v2 = v1.Asech();
if (v2.im < -1e-15 || v2.im > 1e-15) {
return MakeFloat(double.NaN);
} else {
return MakeFloat(v2.re);
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.