本文整理汇总了C++中sinh函数的典型用法代码示例。如果您正苦于以下问题:C++ sinh函数的具体用法?C++ sinh怎么用?C++ sinh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sinh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: YgooSmathYPfsinh
INLINE P YgooSmathYPfsinh(P x) {
INTFLO iz, ix; ix.i = (PINT)x;
iz.f = (float)sinh((double)ix.f);
return (P)iz.i;
}
示例2: _sinh
inline double _sinh(double arg) { return sinh(arg); }
示例3: sinhf
float
sinhf (float x)
{
return (float) sinh ((double) x);
}
示例4: str_char
double Formulaeditor::factor(qint32& nPosition, QString& strCharacter)
{
qreal f = 0.0;
qint32 wI = 0, wL = 0, wBeginn = 0, wError = 0;
if (strCharacter == str_char(0)) return 0.0;
// read digit and save as float in f
if (((strCharacter >= "0") && (strCharacter <= "9")) || (strCharacter == "."))
{
wBeginn = nPosition;
do
{
char_n(nPosition, strCharacter);
}
while ((((strCharacter >= "0") && (strCharacter <= "9")) || (strCharacter == ".")));
if (strCharacter == ".")
{
do
{
char_n(nPosition, strCharacter);
}
while (!(((qint8)strCharacter.at(0).digitValue() >= 0) && ((qint8)strCharacter.at(0).digitValue() <= 9)) || (strCharacter.at(0) == '.'));
}
QString g_strF = m_strFunction.mid(wBeginn - 1, nPosition - wBeginn);
f = g_strF.toFloat();
}
else
{
QString strCharacterUpper = strCharacter.toUpper();
if (strCharacter == "(")
{
char_n(nPosition, strCharacter);
f = expression(nPosition, strCharacter);
if (strCharacter == ")")
char_n(nPosition, strCharacter);
}
else if (strCharacterUpper == "X")
{
char_n(nPosition, strCharacter);
f = m_dFktValue;
}
else
{
bool gefunden = false;
qint32 AnzStdFunctions = m_strStandardFunction.length() - 1;
for (wI = 1; wI <= AnzStdFunctions; wI++)
{
wL = m_strStandardFunction.at(wI).length();
QString strFunktionUpper = m_strFunction.mid(nPosition - 1, wL);
strFunktionUpper = strFunktionUpper.toUpper();
QString strDummy(m_strStandardFunction.at(wI));
strDummy = strDummy.toUpper();
if (strFunktionUpper == strDummy)
{
gefunden = true;
nPosition = nPosition + wL - 1;
char_n(nPosition, strCharacter);
// ! recursion !!!!!!!!!!!!!!!!!!!!!!
f = factor(nPosition, strCharacter);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (strFunktionUpper == "ABS")
f = fabs(f);
else if (strFunktionUpper == "SQRT")
if (f >= 0)
f = sqrt(f);
else
wError = -1;
else if (strFunktionUpper == "SINH")
f = sinh(f);
else if (strFunktionUpper == "COSH")
f = cosh(f);
else if (strFunktionUpper == "TANH")
f = tanh(f);
else if (strFunktionUpper == "ARCTAN")
f = atan(f);
else if (strFunktionUpper == "LN")
{
if (f >= 0)
f = log(f);
else
wError = -1;
}
else if (strFunktionUpper == "LOG")
{
if (f >= 0)
f = log10(f);
else
wError = -1;
}
else if (strFunktionUpper == "EXP")
{
//if (f <= 41)
f = exp(f);
//else
//wError = -1;
}
else if (strFunktionUpper == "SIN")
//.........这里部分代码省略.........
示例5: c_qd_sinh
void c_qd_sinh(const double *a, double *b) {
qd_real bb;
bb = sinh(qd_real(a));
TO_DOUBLE_PTR(bb, b);
}
示例6: math_sinh
static VALUE
math_sinh(VALUE obj, VALUE x)
{
Need_Float(x);
return DBL2NUM(sinh(RFLOAT_VALUE(x)));
}
示例7: math_sinh
static int math_sinh (lua_State *L) {
lua_pushnumber(L, sinh(luaL_checknumber(L, 1)));
return 1;
}
示例8: printf
//.........这里部分代码省略.........
// yParticle = fRand->Uniform( fYmin+yStringShift, fYmax+yStringShift ); //use it to "shuffle" particles in y!
// yParticle += fRand->Gaus(0,1);
// yParticle = fRand->Uniform( -yStringSize/2, yStringSize/2 );
yParticle = fRand->Uniform( -yStringSize/2+yStringShift, yStringSize/2+yStringShift );
// to get pions = 0.8 when half of them goes from rho decays:
// probabilities for rho, pions, kaons+protons should be 0.25, 0.5, 0.25
// k=1 //ratio of pions from rho-s to pions from string
// a=0.8 //ratio of final state pions to all charged
// x=(a*k)/(2*k+2-a*k)
// y=(a*k)/(2*k+2-a*k)*2/k
// z=1-x-y
// check: (2*x+y)/(2*x+y+z)
// TMP: just assign mass for particle. Todo?: separate mechanisms for mesons and proton (?)
double particleMass = mPion;
// ##### tune particle ratios!
if (0) // only rho mesons!!!
{
while ( fabs(particleMass-mRho) > mRhoWidth/2 )
particleMass = fRand->Gaus(mRho,mRhoWidth/2);//( fRand->Uniform(0,1) > 0.5 ? fRand->Gaus(mRho,mRhoWidth/2) : mPion );
}
// else //if (0)
// {
// double probPID = fRand->Uniform(0,1);
// if ( probPID < 0.0 )
// particleMass = fRand->Gaus(mRho,mRhoWidth/2);//( fRand->Uniform(0,1) > 0.5 ? fRand->Gaus(mRho,mRhoWidth/2) : mPion );
// else if ( probPID < 0.75 )
// particleMass = mPion;
// else //kaon or proton (13% and 4%)
// {
// if ( fRand->Uniform(0,1) < 13./(13+4) )
// particleMass = mKaon;
// else
// particleMass = mProton;
// }
// }
else
{
short q1 = breakPointType[iBreak];
short q2 = breakPointType[iBreak+1];
if ( q1 == 0 && q2 == 0 ) // u/d quarks => pions
particleMass = mPion;
else if ( (q1 == 0 && q2 == 1)
|| (q1 == 1 && q2 == 0) ) // u/d and s quarks => kaons
particleMass = mKaon;
else if ( q1 == 1 && q2 == 1 ) // two s quarks => phi
particleMass = mPhi;
else if ( (q1 == 0 && q2 == 2)
|| (q1 == 2 && q2 == 0) ) // u/d quarks and diquark => protons/neutrons (!!! also neutrons!)
particleMass = mProton;
else if ( (q1 == 1 && q2 == 2)
|| (q1 == 2 && q2 == 1) ) // s quark and diquark => Lambda
particleMass = mLambda;
else if ( q1 == 3 || q2 == 3 ) // KOSTYL': if at least one of the two string ends is a c-quark
//(q1 == 0 && q2 == 3)
// || (q1 == 3 && q2 == 0) ) // u/d quarks and c quark => D-meson
particleMass = mD0;
else
{
cout << "breakPointTypes: impossible configuration! "
<< q1 << " and " << q2 << endl;
particleMass = mLambda;
}
}
// cout << particleMass << endl;
// ptParticle = fRand->Exp(0.45);
// prepare lorentz vector
if (1) //use direct sampling of pt "boltzman" distr
{
if ( fabs( particleMass-mPion) < 0.001 )
ptParticle = funcPtBoltzmanLikePion->GetRandom();
else if ( fabs( particleMass-mKaon) < 0.001 )
ptParticle = funcPtBoltzmanLikeKaon->GetRandom();
else if ( fabs( particleMass-mProton) < 0.001 )
ptParticle = funcPtBoltzmanLikeProton->GetRandom();
else if ( fabs( particleMass-mD0) < 0.001 )
ptParticle = funcPtBoltzmanLikeDmeson->GetRandom();
}
if (0)
phiParticle = fRand->Uniform( 0, TMath::TwoPi() );
double mT = sqrt( ptParticle*ptParticle + particleMass*particleMass );
double pX = ptParticle * cos(phiParticle);
double pY = ptParticle * sin(phiParticle);
double pZ = mT*sinh(yParticle);
vArr[iBreak].SetXYZM( pX, pY, pZ, particleMass );
}
return nParticlesInString;
}
示例9: fun_fit
//function to fit
double fun_fit(double Z2,double M,int t)
{
if(parity==1) return Z2*exp(-M*TH)*cosh(M*(TH-t))/sinh(M);
else return Z2*exp(-M*TH)*sin(M*(TH-t))/sinh(M);
}
示例10: Reel
Constante& Rationnel::sinush()const
{
Reel* res = new Reel(sinh((float)num/den));
return *res;
}
示例11: HHVM_FUNCTION
double HHVM_FUNCTION(sinh, double arg) { return sinh(arg); }
示例12: printf
#include <stdio.h>
#include <math.h>
printf("%f\n", sin(0.12));
printf("%f\n", cos(0.12));
printf("%f\n", tan(0.12));
printf("%f\n", asin(0.12));
printf("%f\n", acos(0.12));
printf("%f\n", atan(0.12));
printf("%f\n", sinh(0.12));
printf("%f\n", cosh(0.12));
printf("%f\n", tanh(0.12));
printf("%f\n", exp(0.12));
printf("%f\n", fabs(-0.12));
printf("%f\n", log(0.12));
printf("%f\n", log10(0.12));
printf("%f\n", pow(0.12, 0.12));
printf("%f\n", sqrt(0.12));
printf("%f\n", round(12.34));
printf("%f\n", ceil(12.34));
printf("%f\n", floor(12.34));
void main() {}
示例13: r_sinh
double r_sinh(real *x)
#endif
{
return( sinh(*x) );
}
示例14: operator
//.........这里部分代码省略.........
double nCNa = ((nConIntraNa/ConExtraNa)*exp(nCurlyPhi)- 1)/
(exp(nCurlyPhi)- 1);
double ngNaNMDA = ((nPK*F*F)/(RT))*ConExtraNa;
double nINaNMDA = 1.e-3 * ngNaNMDA * nA2 * nB2 * nCNa * nVm;
double nCCa = ((nConIntraCa/ConExtraCa)*exp(2*nCurlyPhi)- 1)/
(exp(2*nCurlyPhi)- 1);
double ngCaNMDA = ((4*6*nPK*F*F)/(RT))*ConExtraCa;
double nICaNMDA = 1.e-3 * ngCaNMDA * nA2 * nB2 * nCCa * nVm;
//nIKNMDA*=bNMDA;
//nINaNMDA*=bNMDA;
//nICaNMDA*=bNMDA;
double aConGLU=ConExtraglu;
double aA2 = 1100*aConGLU/(1100*aConGLU + 190) ;
double aCK = ((aConIntraK/ConExtraK)*exp(aCurlyPhi)- 1)/
(exp(aCurlyPhi)- 1);
double agKAMPA = ((aPK*F*F)/(RT))*ConExtraK ;
double aIKAMPA = 1.e-3 * agKAMPA * aA2 * aCK * aVm;
double aCNa = ((aConIntraNa/ConExtraNa)*exp(aCurlyPhi)- 1)/
(exp(aCurlyPhi)- 1);
double agNaAMPA = ((aPK*F*F)/(RT))*ConExtraNa;
double aINaAMPA = 1.e-3 * agNaAMPA * aA2 * aCNa * aVm;
//aIKAMPA*=bAMPA;
//aINaAMPA*= bAMPA;
//courants de la pompe Na+/K+
double nCapitalPhi = FRT*(nVm + 176.5);
double nA3 = pow(ConExtraK/(ConExtraK + 3.7),2) ;
double nB3 = pow(nConIntraNa/(nConIntraNa + 0.6),3) ;
double nC3 = (0.052*sinh(nCapitalPhi))/(0.026*exp(nCapitalPhi) +
22.5*exp(-nCapitalPhi));
double nIKpompeKNa = -0.01 * nrNaK * depol * nA3 * nB3 * nC3 ;
//double nINapompeKNa = (3/2)*(-10)^(-2) * nrNaK * depol * nA3 * nB3 * nC3;
double nINapompeKNa = (1.5)*0.01 * nrNaK * depol * nA3 * nB3 * nC3;
double aCapitalPhi = FRT*(aVm + 176.5);
double aA3 = pow(ConExtraK/(ConExtraK + 3.7),2) ;
double aB3 = pow(aConIntraNa/(aConIntraNa + 0.6),3) ;
double aC3 = (0.052*sinh(aCapitalPhi))/(0.026*exp(aCapitalPhi) +
22.5*exp(-aCapitalPhi));
double aIKpompeKNa = -0.01 * arNaK * depol * aA3 * aB3 * aC3 ;
double aINapompeKNa = (1.5)*0.01 * arNaK * depol * aA3 * aB3 * aC3;
//courant de la pompe Ca2+
double nICapompe = depol*ngCapompe*0.01*nConIntraCa/(nConIntraCa+0.0002);
double aICapompe = depol*agCapompe*0.01*aConIntraCa/(aConIntraCa+0.0002);
//courant de la pompe Cl-
double nIClpompe=-0.01 * depol *ngClpompe * nConIntraCl/(nConIntraCl+25);
double aIClpompe=-0.01 * depol *agClpompe * aConIntraCl/(aConIntraCl+25);
//courants de l'antiport Na+/Ca2+
double aa=F/(2*RT);
double nA4 = pow(nConIntraNa,3)*ConExtraCa*exp(aa*nVm)
- pow(ConExtraNa,3)*nConIntraCa*exp(-aa*nVm);
示例15: ctss_calculate_biquad_coeff
void ctss_calculate_biquad_coeff(CTSS_DSPNode *node,
CTSS_BiquadType type,
float freq,
float dbGain,
float bandwidth) {
CTSS_BiquadState *state = node->state;
float a0, a1, a2, b0, b1, b2;
float A = powf(10.0f, dbGain / 40.0f);
float omega = HZ_TO_RAD(freq);
float sn = sinf(omega);
float cs = cosf(omega);
float alpha = sn * sinh(CT_LN2 / 2.0f * bandwidth * omega / sn);
float beta = sqrtf(A + A);
switch (type) {
case LPF:
default:
b0 = (1.0f - cs) / 2.0f;
b1 = 1.0f - cs;
b2 = (1.0f - cs) / 2.0f;
a0 = 1.0f + alpha;
a1 = -2.0f * cs;
a2 = 1.0f - alpha;
break;
case HPF:
b0 = (1.0f + cs) / 2.0f;
b1 = -(1.0f + cs);
b2 = (1.0f + cs) / 2.0f;
a0 = 1.0f + alpha;
a1 = -2.0f * cs;
a2 = 1.0f - alpha;
break;
case BPF:
b0 = alpha;
b1 = 0;
b2 = -alpha;
a0 = 1.0f + alpha;
a1 = -2.0f * cs;
a2 = 1.0f - alpha;
break;
case NOTCH:
b0 = 1.0f;
b1 = -2.0f * cs;
b2 = 1.0f;
a0 = 1.0f + alpha;
a1 = -2.0f * cs;
a2 = 1.0f - alpha;
break;
case PEQ:
b0 = 1.0f + (alpha * A);
b1 = -2.0f * cs;
b2 = 1.0f - (alpha * A);
a0 = 1.0f + (alpha / A);
a1 = -2.0f * cs;
a2 = 1.0f - (alpha / A);
break;
case LSH:
b0 = A * ((A + 1.0f) - (A - 1.0f) * cs + beta * sn);
b1 = 2.0f * A * ((A - 1.0f) - (A + 1.0f) * cs);
b2 = A * ((A + 1.0f) - (A - 1.0f) * cs - beta * sn);
a0 = (A + 1.0f) + (A - 1.0f) * cs + beta * sn;
a1 = -2.0f * ((A - 1.0f) + (A + 1.0f) * cs);
a2 = (A + 1.0f) + (A - 1.0f) * cs - beta * sn;
break;
case HSH:
b0 = A * ((A + 1.0f) + (A - 1.0f) * cs + beta * sn);
b1 = -2.0f * A * ((A - 1.0f) + (A + 1.0f) * cs);
b2 = A * ((A + 1.0f) + (A - 1.0f) * cs - beta * sn);
a0 = (A + 1.0f) - (A - 1.0f) * cs + beta * sn;
a1 = 2.0f * ((A - 1.0f) - (A + 1.0f) * cs);
a2 = (A + 1.0f) - (A - 1.0f) * cs - beta * sn;
break;
}
a0 = 1.0f / a0;
state->f[0] = b0 * a0;
state->f[1] = b1 * a0;
state->f[2] = b2 * a0;
state->f[3] = a1 * a0;
state->f[4] = a2 * a0;
state->f[5] = state->f[6] = state->f[7] = state->f[8] = 0.0f;
}