diff --git a/src/generatorprofile.cpp b/src/generatorprofile.cpp index 2d1a11d2f..87843836f 100644 --- a/src/generatorprofile.cpp +++ b/src/generatorprofile.cpp @@ -79,8 +79,8 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mCommonLogarithmString = "log10"; mCeilingString = "ceil"; mFloorString = "floor"; - mMinString = "min"; - mMaxString = "max"; + mMinString = "fmin"; + mMaxString = "fmax"; mRemString = "fmod"; mHasPowerOperator = false; @@ -123,7 +123,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mTrueString = "1.0"; mFalseString = "0.0"; - mEString = convertToString(exp(1.0)); + mEString = convertToString(M_E); mPiString = convertToString(M_PI); mInfString = "INFINITY"; mNanString = "NAN"; @@ -143,14 +143,8 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi " return (x != 0.0) ^ (y != 0.0);\n" "}\n"; mNotFunctionString = ""; - mMinFunctionString = "double min(double x, double y)\n" - "{\n" - " return (x < y)?x:y;\n" - "}\n"; - mMaxFunctionString = "double max(double x, double y)\n" - "{\n" - " return (x > y)?x:y;\n" - "}\n"; + mMinFunctionString = ""; + mMaxFunctionString = ""; // Trigonometric functions. @@ -192,21 +186,15 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi "}\n"; mAsechFunctionString = "double asech(double x)\n" "{\n" - " double oneOverX = 1.0/x;\n" - "\n" - " return log(oneOverX+sqrt(oneOverX*oneOverX-1.0));\n" + " return acosh(1.0/x);\n" "}\n"; mAcschFunctionString = "double acsch(double x)\n" "{\n" - " double oneOverX = 1.0/x;\n" - "\n" - " return log(oneOverX+sqrt(oneOverX*oneOverX+1.0));\n" + " return asinh(1.0/x);\n" "}\n"; mAcothFunctionString = "double acoth(double x)\n" "{\n" - " double oneOverX = 1.0/x;\n" - "\n" - " return 0.5*log((1.0+oneOverX)/(1.0-oneOverX));\n" + " return atanh(1.0/x);\n" "}\n"; // Miscellaneous. @@ -636,7 +624,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mTrueString = "1.0"; mFalseString = "0.0"; - mEString = convertToString(exp(1.0)); + mEString = convertToString(M_E); mPiString = convertToString(M_PI); mInfString = "inf"; mNanString = "nan"; @@ -711,19 +699,13 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi " return atan(1.0/x)\n"; mAsechFunctionString = "\n" "def asech(x):\n" - " one_over_x = 1.0/x\n" - "\n" - " return log(one_over_x+sqrt(one_over_x*one_over_x-1.0))\n"; + " return acosh(1.0/x)\n"; mAcschFunctionString = "\n" "def acsch(x):\n" - " one_over_x = 1.0/x\n" - "\n" - " return log(one_over_x+sqrt(one_over_x*one_over_x+1.0))\n"; + " return asinh(1.0/x)\n"; mAcothFunctionString = "\n" "def acoth(x):\n" - " one_over_x = 1.0/x\n" - "\n" - " return 0.5*log((1.0+one_over_x)/(1.0-one_over_x))\n"; + " return atanh(1.0/x)\n"; // Miscellaneous. diff --git a/src/generatorprofilesha1values.h b/src/generatorprofilesha1values.h index 1bb721da2..6e870864e 100644 --- a/src/generatorprofilesha1values.h +++ b/src/generatorprofilesha1values.h @@ -24,7 +24,7 @@ namespace libcellml { * The content of this file is generated, do not edit this file directly. * See docs/dev_utilities.rst for further information. */ -static const char C_GENERATOR_PROFILE_SHA1[] = "f0d3add475025d2d4b805747828dbaf2f1345b2f"; -static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "35838d23a1b89fe47293f75e2684ba6d230cf4a8"; +static const char C_GENERATOR_PROFILE_SHA1[] = "e0be7345a3da30625ef6f2316ea4280323703566"; +static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "dece9fc3241b5a84a4e1ab67972501af0e550b35"; } // namespace libcellml