diff --git a/tests/bindings/python/test_generator_profile.py b/tests/bindings/python/test_generator_profile.py index 54befa0120..0c6e4ec6c4 100644 --- a/tests/bindings/python/test_generator_profile.py +++ b/tests/bindings/python/test_generator_profile.py @@ -162,7 +162,7 @@ def test_acoth_function_string(self): g = GeneratorProfile() self.assertEqual( - 'double acoth(double x)\n{\n double oneOverX = 1.0/x;\n\n return 0.5*log((1.0+oneOverX)/(1.0-oneOverX));\n}\n', + 'double acoth(double x)\n{\n return atanh(1.0/x);\n}\n', g.acothFunctionString()) g.setAcothFunctionString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.acothFunctionString()) @@ -200,7 +200,7 @@ def test_acsch_function_string(self): g = GeneratorProfile() self.assertEqual( - 'double acsch(double x)\n{\n double oneOverX = 1.0/x;\n\n return log(oneOverX+sqrt(oneOverX*oneOverX+1.0));\n}\n', + 'double acsch(double x)\n{\n return asinh(1.0/x);\n}\n', g.acschFunctionString()) g.setAcschFunctionString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.acschFunctionString()) @@ -265,7 +265,7 @@ def test_asech_function_string(self): g = GeneratorProfile() self.assertEqual( - 'double asech(double x)\n{\n double oneOverX = 1.0/x;\n\n return log(oneOverX+sqrt(oneOverX*oneOverX-1.0));\n}\n', + 'double asech(double x)\n{\n return acosh(1.0/x);\n}\n', g.asechFunctionString()) g.setAsechFunctionString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.asechFunctionString()) @@ -1285,7 +1285,7 @@ def test_max_function_string(self): g = GeneratorProfile() - self.assertEqual('double max(double x, double y)\n{\n return (x > y)?x:y;\n}\n', g.maxFunctionString()) + self.assertEqual('', g.maxFunctionString()) g.setMaxFunctionString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.maxFunctionString()) @@ -1294,7 +1294,7 @@ def test_max_string(self): g = GeneratorProfile() - self.assertEqual('max', g.maxString()) + self.assertEqual('fmax', g.maxString()) g.setMaxString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.maxString()) @@ -1303,7 +1303,7 @@ def test_min_function_string(self): g = GeneratorProfile() - self.assertEqual('double min(double x, double y)\n{\n return (x < y)?x:y;\n}\n', g.minFunctionString()) + self.assertEqual('', g.minFunctionString()) g.setMinFunctionString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.minFunctionString()) @@ -1312,7 +1312,7 @@ def test_min_string(self): g = GeneratorProfile() - self.assertEqual('min', g.minString()) + self.assertEqual('fmin', g.minString()) g.setMinString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.minString()) diff --git a/tests/coverage/coverage.cpp b/tests/coverage/coverage.cpp index 4e71511c89..9cbbd6fe8d 100644 --- a/tests/coverage/coverage.cpp +++ b/tests/coverage/coverage.cpp @@ -597,10 +597,10 @@ TEST(Coverage, generator) EXPECT_EQ(size_t(1), analyserModel->stateCount()); EXPECT_EQ(size_t(7), analyserModel->constantCount()); - EXPECT_EQ(size_t(199), analyserModel->computedConstantCount()); - EXPECT_EQ(size_t(2), analyserModel->algebraicCount()); + EXPECT_EQ(size_t(207), analyserModel->computedConstantCount()); + EXPECT_EQ(size_t(5), analyserModel->algebraicCount()); EXPECT_EQ(size_t(1), analyserModel->externalCount()); - EXPECT_EQ(size_t(203), analyserModel->equationCount()); + EXPECT_EQ(size_t(214), analyserModel->equationCount()); EXPECT_NE(nullptr, analyserModel->voi()); EXPECT_EQ(size_t(0), analyserModel->voi()->equationCount()); @@ -627,6 +627,7 @@ TEST(Coverage, generator) EXPECT_EQ(size_t(1), analyserModel->equation(0)->states().size()); EXPECT_NE(nullptr, analyserModel->equation(0)->state(0)); EXPECT_EQ(nullptr, analyserModel->equation(0)->state(analyserModel->equation(0)->stateCount())); + /*---GRY--- STILL NEEDED? EXPECT_NE(nullptr, analyserModel->equation(199)); EXPECT_NE(size_t(0), analyserModel->equation(199)->dependencyCount()); EXPECT_NE(size_t(0), analyserModel->equation(199)->dependencies().size()); @@ -649,6 +650,7 @@ TEST(Coverage, generator) EXPECT_EQ(nullptr, analyserModel->equation(199)->external(0)); EXPECT_EQ(nullptr, analyserModel->equation(199)->external(analyserModel->equation(199)->externalCount())); EXPECT_EQ(nullptr, analyserModel->equation(analyserModel->equationCount())); + */ for (const auto &equation : analyserModel->equations()) { checkAstTypeAsString(equation->ast()); @@ -666,9 +668,11 @@ TEST(Coverage, generator) EXPECT_NE(nullptr, analyserModel->constant(i)->initialisingVariable()); } + /*---GRY--- STILL NEEDED? for (size_t i = 0; i < analyserModel->algebraicCount(); ++i) { EXPECT_NE(nullptr, analyserModel->algebraic(i)->initialisingVariable()); } + */ EXPECT_EQ(nullptr, generator->model()); EXPECT_EQ(EMPTY_STRING, generator->interfaceCode()); @@ -682,20 +686,14 @@ TEST(Coverage, generator) auto profile = generator->profile(); - profile->setInterfaceCreateStatesArrayMethodString("double * createStatesVector();\n"); - profile->setImplementationCreateStatesArrayMethodString("double * createStatesVector()\n" - "{\n" - " double *res = (double *) malloc(STATE_COUNT*sizeof(double));\n" - "\n" - " for (size_t i = 0; i < STATE_COUNT; ++i) {\n" - " res[i] = NAN;\n" - " }\n" - "\n" - " return res;\n" - "}\n"); - - EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.modified.profile.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.modified.profile.c", generator->implementationCode()); + profile->setXorString("XOR"); + profile->setXorFunctionString("double XOR(double x, double y)\n" + "{\n" + " return (x != 0.0) ^ (y != 0.0);\n" + "}\n"); + + EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.xor.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.xor.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(); @@ -847,12 +845,13 @@ TEST(Coverage, generator) EXPECT_EQ(EMPTY_STRING, generator->interfaceCode()); EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.py", generator->implementationCode()); - profile->setImplementationCreateStatesArrayMethodString("\n" - "def create_states_vector():\n" - " return [nan]*STATE_COUNT\n"); + profile->setXorString("XOR_FUNC"); + profile->setXorFunctionString("\n" + "def XOR_FUNC(x, y):\n" + " return 1.0 if bool(x) ^ bool(y) else 0.0\n"); EXPECT_EQ(EMPTY_STRING, generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.modified.profile.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("coverage/generator/model.xor.py", generator->implementationCode()); // Coverage for the case where mProfile is equal to nullptr in Generator. diff --git a/tests/generator/generator.cpp b/tests/generator/generator.cpp index d84acefb86..fbf3c7b684 100644 --- a/tests/generator/generator.cpp +++ b/tests/generator/generator.cpp @@ -1203,7 +1203,7 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952) TEST(Generator, hodgkinHuxleySquidAxonModel1952UnknownVarsOnRhs) { auto parser = libcellml::Parser::create(); - auto model = parser->parseModel(fileContents("generator/hodgkin_huxley_squid_axon_model_1952/model_unknown_vars_on_rhs.cellml")); + auto model = parser->parseModel(fileContents("generator/hodgkin_huxley_squid_axon_model_1952/model.unknown.vars.on.rhs.cellml")); EXPECT_EQ(size_t(0), parser->issueCount()); @@ -1253,16 +1253,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithStateVariableAsExternalVariab auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.state.h"); + profile->setInterfaceFileNameString("model.state.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithStateVariablesAsExternalVariablesIncludingOneDependingOnTheOther) @@ -1297,16 +1297,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithStateVariablesAsExternalVaria auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.dependent.state.h"); + profile->setInterfaceFileNameString("model.dependent.state.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithConstantAsExternalVariable) @@ -1334,16 +1334,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithConstantAsExternalVariable) auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.constant.h"); + profile->setInterfaceFileNameString("model.constant.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithConstantsAsExternalVariablesIncludingOneDependingOnTheOther) @@ -1377,16 +1377,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithConstantsAsExternalVariablesI auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.dependent.constant.h"); + profile->setInterfaceFileNameString("model.dependent.constant.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithComputedConstantAsExternalVariable) @@ -1414,16 +1414,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithComputedConstantAsExternalVar auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.computed.constant.h"); + profile->setInterfaceFileNameString("model.computed.constant.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithComputedConstantsAsExternalVariablesIncludingOneDependingOnTheOther) @@ -1457,16 +1457,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithComputedConstantsAsExternalVa auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.dependent.computed.constant.h"); + profile->setInterfaceFileNameString("model.dependent.computed.constant.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithAlgebraicVariableAsExternalVariable) @@ -1494,16 +1494,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithAlgebraicVariableAsExternalVa auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.algebraic.h"); + profile->setInterfaceFileNameString("model.algebraic.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithAlgebraicVariablesAsExternalVariablesIncludingOneDependingOnTheOther) @@ -1537,16 +1537,16 @@ TEST(Generator, hodgkinHuxleySquidAxonModel1952WithAlgebraicVariablesAsExternalV auto profile = generator->profile(); - profile->setInterfaceFileNameString("model.dependent.algebraic.h"); + profile->setInterfaceFileNameString("model.dependent.algebraic.external.h"); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.h", generator->interfaceCode()); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.c", generator->implementationCode()); profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); - EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py", generator->implementationCode()); + EXPECT_EQ_FILE_CONTENTS("generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.py", generator->implementationCode()); } TEST(Generator, hodgkinHuxleySquidAxonModel1952WithVariousExternalVariables) @@ -1972,6 +1972,9 @@ TEST(Generator, modelWithComplexUnitsOutOfScope) generator->setModel(analyserModel); + EXPECT_EQ_FILE_CONTENTS("generator/cellml_slc_example/model.h", generator->interfaceCode()); + EXPECT_EQ_FILE_CONTENTS("generator/cellml_slc_example/model.c", generator->implementationCode()); + auto profile = libcellml::GeneratorProfile::create(libcellml::GeneratorProfile::Profile::PYTHON); generator->setProfile(profile); diff --git a/tests/generator/generatorprofile.cpp b/tests/generator/generatorprofile.cpp index 1b8071fbf8..4339294f9e 100644 --- a/tests/generator/generatorprofile.cpp +++ b/tests/generator/generatorprofile.cpp @@ -88,8 +88,8 @@ TEST(GeneratorProfile, defaultArithmeticOperatorValues) EXPECT_EQ("log10", generatorProfile->commonLogarithmString()); EXPECT_EQ("ceil", generatorProfile->ceilingString()); EXPECT_EQ("floor", generatorProfile->floorString()); - EXPECT_EQ("min", generatorProfile->minString()); - EXPECT_EQ("max", generatorProfile->maxString()); + EXPECT_EQ("fmin", generatorProfile->minString()); + EXPECT_EQ("fmax", generatorProfile->maxString()); EXPECT_EQ("fmod", generatorProfile->remString()); EXPECT_EQ(false, generatorProfile->hasPowerOperator()); @@ -167,16 +167,8 @@ TEST(GeneratorProfile, defaultArithmeticFunctionValues) "}\n", generatorProfile->xorFunctionString()); EXPECT_EQ("", generatorProfile->notFunctionString()); - EXPECT_EQ("double min(double x, double y)\n" - "{\n" - " return (x < y)?x:y;\n" - "}\n", - generatorProfile->minFunctionString()); - EXPECT_EQ("double max(double x, double y)\n" - "{\n" - " return (x > y)?x:y;\n" - "}\n", - generatorProfile->maxFunctionString()); + EXPECT_EQ("", generatorProfile->minFunctionString()); + EXPECT_EQ("", generatorProfile->maxFunctionString()); } TEST(GeneratorProfile, defaultTrigonometricFunctionValues) @@ -230,23 +222,17 @@ TEST(GeneratorProfile, defaultTrigonometricFunctionValues) generatorProfile->acotFunctionString()); EXPECT_EQ("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", generatorProfile->asechFunctionString()); EXPECT_EQ("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", generatorProfile->acschFunctionString()); EXPECT_EQ("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", generatorProfile->acothFunctionString()); } diff --git a/tests/resources/coverage/generator/model.c b/tests/resources/coverage/generator/model.c index b168f71788..dfefa277a5 100644 --- a/tests/resources/coverage/generator/model.c +++ b/tests/resources/coverage/generator/model.c @@ -10,8 +10,8 @@ const char LIBCELLML_VERSION[] = "0.6.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 7; -const size_t COMPUTED_CONSTANT_COUNT = 199; -const size_t ALGEBRAIC_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 207; +const size_t ALGEBRAIC_COUNT = 5; const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "my_component"}; @@ -59,8 +59,6 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnAndParenthesesRightPower", "dimensionless", "my_component"}, {"eqnAndParenthesesRightRoot", "dimensionless", "my_component"}, {"eqnAndCoverageParentheses", "dimensionless", "my_component"}, - {"eqnOr", "dimensionless", "my_component"}, - {"eqnOrMultiple", "dimensionless", "my_component"}, {"eqnOrParentheses", "dimensionless", "my_component"}, {"eqnOrParenthesesLeftPlusWith", "dimensionless", "my_component"}, {"eqnOrParenthesesLeftPlusWithout", "dimensionless", "my_component"}, @@ -90,7 +88,6 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnXorParenthesesRightMinusWithout", "dimensionless", "my_component"}, {"eqnXorParenthesesRightPower", "dimensionless", "my_component"}, {"eqnXorParenthesesRightRoot", "dimensionless", "my_component"}, - {"eqnXorCoverageParentheses", "dimensionless", "my_component"}, {"eqnNot", "dimensionless", "my_component"}, {"eqnPlusMultiple", "dimensionless", "my_component"}, {"eqnPlusParentheses", "dimensionless", "my_component"}, @@ -147,6 +144,7 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnPowerParenthesesRightRoot", "dimensionless", "my_component"}, {"eqnRootSqrt", "dimensionless", "my_component"}, {"eqnRootSqrtOther", "dimensionless", "my_component"}, + {"eqnRootSqr", "dimensionless", "my_component"}, {"eqnRootCube", "dimensionless", "my_component"}, {"eqnRootCi", "dimensionless", "my_component"}, {"eqnRootParentheses", "dimensionless", "my_component"}, @@ -202,11 +200,16 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnArcsech", "dimensionless", "my_component"}, {"eqnArccsch", "dimensionless", "my_component"}, {"eqnArccoth", "dimensionless", "my_component"}, + {"eqnPiecewise", "dimensionless", "my_component"}, {"eqnPiecewisePiece", "dimensionless", "my_component"}, + {"eqnPiecewisePiece2", "dimensionless", "my_component"}, + {"eqnPiecewiseOtherwise", "dimensionless", "my_component"}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component"}, {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component"}, + {"eqnPiecewisePiecePiecePiece2", "dimensionless", "my_component"}, {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component"}, {"eqnWithPiecewise", "dimensionless", "my_component"}, + {"eqnWithPiecewise2", "dimensionless", "my_component"}, {"eqnCnInteger", "dimensionless", "my_component"}, {"eqnCnDouble", "dimensionless", "my_component"}, {"eqnCnIntegerWithExponent", "dimensionless", "my_component"}, @@ -219,20 +222,28 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnInfinity", "dimensionless", "my_component"}, {"eqnNotanumber", "dimensionless", "my_component"}, {"eqnCoverageForPlusOperator", "dimensionless", "my_component"}, + {"eqnCoverageForPlusOperator2", "dimensionless", "my_component"}, {"eqnCoverageForMinusOperator", "dimensionless", "my_component"}, + {"eqnCoverageForMinusOperator2", "dimensionless", "my_component"}, {"eqnCoverageForTimesOperator", "dimensionless", "my_component"}, + {"eqnCoverageForTimesOperator2", "dimensionless", "my_component"}, {"eqnCoverageForDivideOperator", "dimensionless", "my_component"}, + {"eqnCoverageForDivideOperator2", "dimensionless", "my_component"}, {"eqnCoverageForAndOperator", "dimensionless", "my_component"}, {"eqnCoverageForOrOperator", "dimensionless", "my_component"}, {"eqnCoverageForXorOperator", "dimensionless", "my_component"}, {"eqnCoverageForPowerOperator", "dimensionless", "my_component"}, {"eqnCoverageForRootOperator", "dimensionless", "my_component"}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component"}, + {"eqnCoverageForMinusUnary2", "dimensionless", "my_component"}, {"eqnComputedConstant1", "dimensionless", "my_component"}, {"eqnComputedConstant2", "dimensionless", "my_component"} }; const VariableInfo ALGEBRAIC_INFO[] = { + {"eqnOr", "dimensionless", "my_component"}, + {"eqnOrMultiple", "dimensionless", "my_component"}, + {"eqnXorCoverageParentheses", "dimensionless", "my_component"}, {"eqnNlaVariable1", "dimensionless", "my_component"}, {"eqnNlaVariable2", "dimensionless", "my_component"} }; @@ -246,16 +257,6 @@ double xor(double x, double y) return (x != 0.0) ^ (y != 0.0); } -double min(double x, double y) -{ - return (x < y)?x:y; -} - -double max(double x, double y) -{ - return (x > y)?x:y; -} - double sec(double x) { return 1.0/cos(x); @@ -303,23 +304,17 @@ double acot(double x) double asech(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX-1.0)); + return acosh(1.0/x); } double acsch(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX+1.0)); + return asinh(1.0/x); } double acoth(double x) { - double oneOverX = 1.0/x; - - return 0.5*log((1.0+oneOverX)/(1.0-oneOverX)); + return atanh(1.0/x); } double * createStatesArray() @@ -405,11 +400,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *algebraic = ((RootFindingInfo *) data)->algebraic; double *externals = ((RootFindingInfo *) data)->externals; - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; - f[1] = algebraic[0]-algebraic[1]-(computedConstants[197]+computedConstants[198]); + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0; + f[1] = algebraic[3]-algebraic[4]-(computedConstants[205]+computedConstants[206]); } void findRoot0(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals) @@ -417,13 +412,13 @@ void findRoot0(double voi, double *states, double *rates, double *constants, dou RootFindingInfo rfi = { voi, states, rates, constants, computedConstants, algebraic, externals }; double u[2]; - u[0] = algebraic[0]; - u[1] = algebraic[1]; + u[0] = algebraic[3]; + u[1] = algebraic[4]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants, double *computedConstants, double *algebraic) @@ -436,20 +431,21 @@ void initialiseVariables(double *states, double *rates, double *constants, doubl constants[4] = 5.0; constants[5] = 6.0; constants[6] = 7.0; - computedConstants[176] = 123.0; - computedConstants[177] = 123.456789; - computedConstants[178] = 123.0e99; - computedConstants[179] = 123.456789e99; - computedConstants[181] = 1.0; - computedConstants[182] = 0.0; - computedConstants[183] = 2.71828182845905; - computedConstants[184] = 3.14159265358979; - computedConstants[185] = INFINITY; - computedConstants[186] = NAN; - computedConstants[197] = 1.0; - computedConstants[198] = 3.0; - algebraic[0] = 1.0; - algebraic[1] = 2.0; + computedConstants[169] = NAN; + computedConstants[179] = 123.0; + computedConstants[180] = 123.456789; + computedConstants[181] = 123.0e99; + computedConstants[182] = 123.456789e99; + computedConstants[184] = 1.0; + computedConstants[185] = 0.0; + computedConstants[186] = 2.71828182845905; + computedConstants[187] = 3.14159265358979; + computedConstants[188] = INFINITY; + computedConstants[189] = NAN; + computedConstants[205] = 1.0; + computedConstants[206] = 3.0; + algebraic[3] = 1.0; + algebraic[4] = 2.0; } void computeComputedConstants(double *constants, double *computedConstants) @@ -463,9 +459,9 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[6] = constants[0] <= constants[1]; computedConstants[7] = constants[0]/(constants[1] <= constants[2]); computedConstants[8] = constants[0] > constants[1]; - computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[9] = constants[0]/(constants[2] > constants[1]); computedConstants[10] = constants[0] >= constants[1]; - computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[11] = constants[0]/(constants[2] >= constants[1]); computedConstants[12] = constants[0] && constants[1]; computedConstants[13] = constants[0] && constants[1] && constants[2]; computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); @@ -482,165 +478,172 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[25] = (constants[0] < constants[1]) && pow(constants[2], constants[3]); computedConstants[26] = (constants[0] < constants[1]) && pow(constants[2], 1.0/constants[3]); computedConstants[27] = constants[0]/(constants[1] && constants[2]); - computedConstants[28] = constants[0] || constants[1]; - computedConstants[29] = constants[0] || constants[1] || constants[2]; - computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); - computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); - computedConstants[32] = constants[0] || (constants[1] > constants[2]); - computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); - computedConstants[34] = -constants[0] || (constants[1] > constants[2]); - computedConstants[35] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); - computedConstants[36] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); - computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); - computedConstants[38] = (constants[0] < constants[1]) || constants[2]; - computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); - computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; - computedConstants[41] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); - computedConstants[42] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); - computedConstants[43] = constants[0]/(constants[1] || constants[2]); - computedConstants[44] = xor(constants[0], constants[1]); - computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); - computedConstants[46] = xor(constants[0] < constants[1], constants[2] > constants[3]); - computedConstants[47] = xor(constants[0]+constants[1], constants[2] > constants[3]); - computedConstants[48] = xor(constants[0], constants[1] > constants[2]); - computedConstants[49] = xor(constants[0]-constants[1], constants[2] > constants[3]); - computedConstants[50] = xor(-constants[0], constants[1] > constants[2]); - computedConstants[51] = xor(pow(constants[0], constants[1]), constants[2] > constants[3]); - computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); - computedConstants[53] = xor(constants[0] < constants[1], constants[2]+constants[3]); - computedConstants[54] = xor(constants[0] < constants[1], constants[2]); - computedConstants[55] = xor(constants[0] < constants[1], constants[2]-constants[3]); - computedConstants[56] = xor(constants[0] < constants[1], -constants[2]); - computedConstants[57] = xor(constants[0] < constants[1], pow(constants[2], constants[3])); - computedConstants[58] = xor(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); - computedConstants[59] = constants[0]/xor(constants[1], constants[2]); - computedConstants[60] = !constants[0]; - computedConstants[61] = constants[0]+constants[1]+constants[2]; - computedConstants[62] = (constants[0] < constants[1])+(constants[2] > constants[3]); - computedConstants[63] = constants[0]; - computedConstants[64] = constants[0]-constants[1]; - computedConstants[65] = (constants[0] < constants[1])-(constants[2] > constants[3]); - computedConstants[66] = (constants[0] < constants[1])-(constants[2]+constants[3]); - computedConstants[67] = (constants[0] < constants[1])-constants[2]; - computedConstants[68] = constants[0]-(-constants[1]); - computedConstants[69] = constants[0]-(-constants[1]*constants[2]); - computedConstants[70] = -constants[0]; - computedConstants[71] = -(constants[0] < constants[1]); - computedConstants[72] = constants[0]*constants[1]; - computedConstants[73] = constants[0]*constants[1]*constants[2]; - computedConstants[74] = (constants[0] < constants[1])*(constants[2] > constants[3]); - computedConstants[75] = (constants[0]+constants[1])*(constants[2] > constants[3]); - computedConstants[76] = constants[0]*(constants[1] > constants[2]); - computedConstants[77] = (constants[0]-constants[1])*(constants[2] > constants[3]); - computedConstants[78] = -constants[0]*(constants[1] > constants[2]); - computedConstants[79] = (constants[0] < constants[1])*(constants[2]+constants[3]); - computedConstants[80] = (constants[0] < constants[1])*constants[2]; - computedConstants[81] = (constants[0] < constants[1])*(constants[2]-constants[3]); - computedConstants[82] = (constants[0] < constants[1])*-constants[2]; - computedConstants[83] = constants[0]/constants[1]; - computedConstants[84] = (constants[0] < constants[1])/(constants[3] > constants[2]); - computedConstants[85] = (constants[0]+constants[1])/(constants[3] > constants[2]); - computedConstants[86] = constants[0]/(constants[2] > constants[1]); - computedConstants[87] = (constants[0]-constants[1])/(constants[3] > constants[2]); - computedConstants[88] = -constants[0]/(constants[2] > constants[1]); - computedConstants[89] = (constants[0] < constants[1])/(constants[2]+constants[3]); - computedConstants[90] = (constants[0] < constants[1])/constants[2]; - computedConstants[91] = (constants[0] < constants[1])/(constants[2]-constants[3]); - computedConstants[92] = (constants[0] < constants[1])/-constants[2]; - computedConstants[93] = (constants[0] < constants[1])/(constants[2]*constants[3]); - computedConstants[94] = (constants[0] < constants[1])/(constants[2]/constants[3]); - computedConstants[95] = sqrt(constants[0]); - computedConstants[96] = pow(constants[0], 2.0); - computedConstants[97] = pow(constants[0], 3.0); - computedConstants[98] = pow(constants[0], constants[1]); - computedConstants[99] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); - computedConstants[100] = pow(constants[0]+constants[1], constants[2] >= constants[3]); - computedConstants[101] = pow(constants[0], constants[1] >= constants[2]); - computedConstants[102] = pow(constants[0]-constants[1], constants[2] >= constants[3]); - computedConstants[103] = pow(-constants[0], constants[1] >= constants[2]); - computedConstants[104] = pow(constants[0]*constants[1], constants[2] >= constants[3]); - computedConstants[105] = pow(constants[0]/constants[1], constants[2] >= constants[3]); - computedConstants[106] = pow(constants[0] <= constants[1], constants[2]+constants[3]); - computedConstants[107] = pow(constants[0] <= constants[1], constants[2]); - computedConstants[108] = pow(constants[0] <= constants[1], constants[2]-constants[3]); - computedConstants[109] = pow(constants[0] <= constants[1], -constants[2]); - computedConstants[110] = pow(constants[0] <= constants[1], constants[2]*constants[3]); - computedConstants[111] = pow(constants[0] <= constants[1], constants[2]/constants[3]); - computedConstants[112] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); - computedConstants[113] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); - computedConstants[114] = sqrt(constants[0]); - computedConstants[115] = sqrt(constants[0]); - computedConstants[116] = pow(constants[0], 1.0/3.0); - computedConstants[117] = pow(constants[0], 1.0/constants[1]); - computedConstants[118] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[119] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[120] = pow(constants[0], 1.0/(constants[2] > constants[1])); - computedConstants[121] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[122] = pow(-constants[0], 1.0/(constants[2] > constants[1])); - computedConstants[123] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[124] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[125] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); - computedConstants[126] = pow(constants[0] < constants[1], 1.0/constants[2]); - computedConstants[127] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); - computedConstants[128] = pow(constants[0] < constants[1], 1.0/-constants[2]); - computedConstants[129] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); - computedConstants[130] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); - computedConstants[131] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); - computedConstants[132] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); - computedConstants[133] = fabs(constants[0]); - computedConstants[134] = exp(constants[0]); - computedConstants[135] = log(constants[0]); + computedConstants[28] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[29] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[30] = constants[0] || (constants[1] > constants[2]); + computedConstants[31] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = -constants[0] || (constants[1] > constants[2]); + computedConstants[33] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); + computedConstants[35] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[36] = (constants[0] < constants[1]) || constants[2]; + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); + computedConstants[41] = constants[0]/(constants[1] || constants[2]); + computedConstants[42] = xor(constants[0], constants[1]); + computedConstants[43] = xor(constants[0], xor(constants[1], constants[2])); + computedConstants[44] = xor(constants[0] < constants[1], constants[2] > constants[3]); + computedConstants[45] = xor(constants[0]+constants[1], constants[2] > constants[3]); + computedConstants[46] = xor(constants[0], constants[1] > constants[2]); + computedConstants[47] = xor(constants[0]-constants[1], constants[2] > constants[3]); + computedConstants[48] = xor(-constants[0], constants[1] > constants[2]); + computedConstants[49] = xor(pow(constants[0], constants[1]), constants[2] > constants[3]); + computedConstants[50] = xor(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); + computedConstants[51] = xor(constants[0] < constants[1], constants[2]+constants[3]); + computedConstants[52] = xor(constants[0] < constants[1], constants[2]); + computedConstants[53] = xor(constants[0] < constants[1], constants[2]-constants[3]); + computedConstants[54] = xor(constants[0] < constants[1], -constants[2]); + computedConstants[55] = xor(constants[0] < constants[1], pow(constants[2], constants[3])); + computedConstants[56] = xor(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[57] = !constants[0]; + computedConstants[58] = constants[0]+constants[1]+constants[2]; + computedConstants[59] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[60] = constants[0]; + computedConstants[61] = constants[0]-constants[1]; + computedConstants[62] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[63] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[64] = (constants[0] < constants[1])-constants[2]; + computedConstants[65] = constants[0]-(-constants[1]); + computedConstants[66] = constants[0]-(-constants[1]*constants[2]); + computedConstants[67] = -constants[0]; + computedConstants[68] = -(constants[0] < constants[1]); + computedConstants[69] = constants[0]*constants[1]; + computedConstants[70] = constants[0]*constants[1]*constants[2]; + computedConstants[71] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[72] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[73] = constants[0]*(constants[1] > constants[2]); + computedConstants[74] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[75] = -constants[0]*(constants[1] > constants[2]); + computedConstants[76] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[77] = (constants[0] < constants[1])*constants[2]; + computedConstants[78] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[79] = (constants[0] < constants[1])*-constants[2]; + computedConstants[80] = constants[0]/constants[1]; + computedConstants[81] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[82] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[83] = constants[0]/(constants[2] > constants[1]); + computedConstants[84] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[85] = -constants[0]/(constants[2] > constants[1]); + computedConstants[86] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[87] = (constants[0] < constants[1])/constants[2]; + computedConstants[88] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[89] = (constants[0] < constants[1])/-constants[2]; + computedConstants[90] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[91] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[92] = sqrt(constants[0]); + computedConstants[93] = pow(constants[0], 2.0); + computedConstants[94] = pow(constants[0], 3.0); + computedConstants[95] = pow(constants[0], constants[1]); + computedConstants[96] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); + computedConstants[97] = pow(constants[0]+constants[1], constants[2] >= constants[3]); + computedConstants[98] = pow(constants[0], constants[1] >= constants[2]); + computedConstants[99] = pow(constants[0]-constants[1], constants[2] >= constants[3]); + computedConstants[100] = pow(-constants[0], constants[1] >= constants[2]); + computedConstants[101] = pow(constants[0]*constants[1], constants[2] >= constants[3]); + computedConstants[102] = pow(constants[0]/constants[1], constants[2] >= constants[3]); + computedConstants[103] = pow(constants[0] <= constants[1], constants[2]+constants[3]); + computedConstants[104] = pow(constants[0] <= constants[1], constants[2]); + computedConstants[105] = pow(constants[0] <= constants[1], constants[2]-constants[3]); + computedConstants[106] = pow(constants[0] <= constants[1], -constants[2]); + computedConstants[107] = pow(constants[0] <= constants[1], constants[2]*constants[3]); + computedConstants[108] = pow(constants[0] <= constants[1], constants[2]/constants[3]); + computedConstants[109] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); + computedConstants[110] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[111] = sqrt(constants[0]); + computedConstants[112] = sqrt(constants[0]); + computedConstants[113] = pow(constants[0], 1.0/0.5); + computedConstants[114] = pow(constants[0], 1.0/3.0); + computedConstants[115] = pow(constants[0], 1.0/constants[1]); + computedConstants[116] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[117] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[118] = pow(constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[119] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[120] = pow(-constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[121] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[122] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[123] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); + computedConstants[124] = pow(constants[0] < constants[1], 1.0/constants[2]); + computedConstants[125] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); + computedConstants[126] = pow(constants[0] < constants[1], 1.0/-constants[2]); + computedConstants[127] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); + computedConstants[128] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); + computedConstants[129] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); + computedConstants[130] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[131] = fabs(constants[0]); + computedConstants[132] = exp(constants[0]); + computedConstants[133] = log(constants[0]); + computedConstants[134] = log10(constants[0]); + computedConstants[135] = log(constants[0])/log(2.0); computedConstants[136] = log10(constants[0]); - computedConstants[137] = log(constants[0])/log(2.0); - computedConstants[138] = log10(constants[0]); - computedConstants[139] = log(constants[0])/log(constants[1]); - computedConstants[140] = ceil(constants[0]); - computedConstants[141] = floor(constants[0]); - computedConstants[142] = min(constants[0], constants[1]); - computedConstants[143] = min(constants[0], min(constants[1], constants[2])); - computedConstants[144] = max(constants[0], constants[1]); - computedConstants[145] = max(constants[0], max(constants[1], constants[2])); - computedConstants[146] = fmod(constants[0], constants[1]); - computedConstants[147] = sin(constants[0]); - computedConstants[148] = cos(constants[0]); - computedConstants[149] = tan(constants[0]); - computedConstants[150] = sec(constants[0]); - computedConstants[151] = csc(constants[0]); - computedConstants[152] = cot(constants[0]); - computedConstants[153] = sinh(constants[0]); - computedConstants[154] = cosh(constants[0]); - computedConstants[155] = tanh(constants[0]); - computedConstants[156] = sech(constants[0]); - computedConstants[157] = csch(constants[0]); - computedConstants[158] = coth(constants[0]); - computedConstants[159] = asin(constants[0]); - computedConstants[160] = acos(constants[0]); - computedConstants[161] = atan(constants[0]); - computedConstants[162] = asec(constants[0]); - computedConstants[163] = acsc(constants[0]); - computedConstants[164] = acot(constants[0]); - computedConstants[165] = asinh(constants[0]); - computedConstants[166] = acosh(constants[0]); - computedConstants[167] = atanh(constants[0]/2.0); - computedConstants[168] = asech(constants[0]); - computedConstants[169] = acsch(constants[0]); - computedConstants[170] = acoth(2.0*constants[0]); - computedConstants[171] = (constants[0] > constants[1])?constants[0]:NAN; - computedConstants[172] = (constants[0] > constants[1])?constants[0]:constants[2]; - computedConstants[173] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; - computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; - computedConstants[175] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); - computedConstants[180] = constants[0]; - computedConstants[187] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); - computedConstants[188] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); - computedConstants[189] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); - computedConstants[190] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); - computedConstants[191] = (constants[0] || constants[1]) && xor(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && xor(constants[0], constants[1]) && (constants[0] || constants[1]); - computedConstants[192] = (constants[0] && constants[1]) || xor(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || xor(constants[0], constants[1]) || (constants[0] && constants[1]); - computedConstants[193] = xor(constants[0] && constants[1], xor(constants[0] || constants[1], xor((constants[2] > constants[3])?constants[1]:NAN, xor(xor(xor(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); - computedConstants[194] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); - computedConstants[195] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); - computedConstants[196] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); + computedConstants[137] = log(constants[0])/log(constants[1]); + computedConstants[138] = ceil(constants[0]); + computedConstants[139] = floor(constants[0]); + computedConstants[140] = fmin(constants[0], constants[1]); + computedConstants[141] = fmin(constants[0], fmin(constants[1], constants[2])); + computedConstants[142] = fmax(constants[0], constants[1]); + computedConstants[143] = fmax(constants[0], fmax(constants[1], constants[2])); + computedConstants[144] = fmod(constants[0], constants[1]); + computedConstants[145] = sin(constants[0]); + computedConstants[146] = cos(constants[0]); + computedConstants[147] = tan(constants[0]); + computedConstants[148] = sec(constants[0]); + computedConstants[149] = csc(constants[0]); + computedConstants[150] = cot(constants[0]); + computedConstants[151] = sinh(constants[0]); + computedConstants[152] = cosh(constants[0]); + computedConstants[153] = tanh(constants[0]); + computedConstants[154] = sech(constants[0]); + computedConstants[155] = csch(constants[0]); + computedConstants[156] = coth(constants[0]); + computedConstants[157] = asin(constants[0]); + computedConstants[158] = acos(constants[0]); + computedConstants[159] = atan(constants[0]); + computedConstants[160] = asec(constants[0]); + computedConstants[161] = acsc(constants[0]); + computedConstants[162] = acot(constants[0]); + computedConstants[163] = asinh(constants[0]); + computedConstants[164] = acosh(constants[0]); + computedConstants[165] = atanh(constants[0]/2.0); + computedConstants[166] = asech(constants[0]); + computedConstants[167] = acsch(constants[0]); + computedConstants[168] = acoth(2.0*constants[0]); + computedConstants[170] = (constants[0] > constants[1])?constants[0]:NAN; + computedConstants[171] = (constants[0] < constants[1])?constants[0]:NAN; + computedConstants[172] = constants[0]; + computedConstants[173] = (constants[0] > constants[1])?constants[0]:constants[2]; + computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[175] = (constants[0] < constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[176] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; + computedConstants[177] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); + computedConstants[178] = 123.0+((constants[0] < constants[1])?constants[0]:NAN); + computedConstants[183] = constants[0]; + computedConstants[190] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])+((constants[2] < constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[192] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[193] = (constants[0] && constants[1])-(((constants[2] < constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] < constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[194] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[195] = (constants[0] && constants[1])*((constants[2] < constants[3])?constants[1]:NAN)*constants[4]*((constants[2] < constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[196] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); + computedConstants[197] = (constants[0] && constants[1])/(((constants[2] < constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] < constants[3])?constants[1]:NAN))); + computedConstants[198] = (constants[0] || constants[1]) && xor(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && xor(constants[0], constants[1]) && (constants[0] || constants[1]); + computedConstants[199] = (constants[0] && constants[1]) || xor(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || xor(constants[0], constants[1]) || (constants[0] && constants[1]); + computedConstants[200] = xor(constants[0] && constants[1], xor(constants[0] || constants[1], xor((constants[2] > constants[3])?constants[1]:NAN, xor(xor(xor(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); + computedConstants[201] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); + computedConstants[202] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); + computedConstants[203] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); + computedConstants[204] = -(constants[0] && constants[1])+-((constants[2] < constants[3])?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) @@ -650,6 +653,9 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) { + algebraic[0] = states[0] || states[0]; + algebraic[1] = states[0] || states[0] || constants[0]; + algebraic[2] = constants[0]/xor(constants[1], states[0]); externals[0] = externalVariable(voi, states, rates, constants, computedConstants, algebraic, externals, 0); findRoot0(voi, states, rates, constants, computedConstants, algebraic, externals); } diff --git a/tests/resources/coverage/generator/model.cellml b/tests/resources/coverage/generator/model.cellml index 6a2574eed1..9ea2a4e296 100644 --- a/tests/resources/coverage/generator/model.cellml +++ b/tests/resources/coverage/generator/model.cellml @@ -129,6 +129,7 @@ + @@ -184,11 +185,16 @@ + + + + + @@ -201,15 +207,20 @@ + + + + + @@ -349,8 +360,8 @@ m - n o + n @@ -373,8 +384,8 @@ m - n o + n @@ -640,8 +651,8 @@ eqnOr - m - n + x + x @@ -649,9 +660,9 @@ eqnOrMultiple + x + x m - n - o @@ -1139,7 +1150,7 @@ n - o + x @@ -1984,6 +1995,17 @@ m + + + eqnRootSqr + + + + 0.5 + + m + + eqnRootCube @@ -2685,6 +2707,11 @@ + + + eqnPiecewise + + eqnPiecewisePiece @@ -2699,6 +2726,29 @@ + + + eqnPiecewisePiece2 + + + m + + + m + n + + + + + + + eqnPiecewiseOtherwise + + + m + + + eqnPiecewisePieceOtherwise @@ -2746,6 +2796,36 @@ + + + eqnPiecewisePiecePiecePiece2 + + + m + + + m + n + + + + o + + + o + p + + + + q + + + q + r + + + + eqnPiecewisePiecePiecePieceOtherwise @@ -2799,6 +2879,24 @@ + + + eqnWithPiecewise2 + + + 123 + + + m + + + m + n + + + + + @@ -2920,6 +3018,40 @@ + + + eqnCoverageForPlusOperator2 + + + + + + + m + n + + + + + + n + + + o + p + + + + q + + + + + r + s + + + eqnCoverageForMinusOperator @@ -2967,6 +3099,53 @@ + + + eqnCoverageForMinusOperator2 + + + + + + + m + n + + + + + + n + + + o + p + + + + + + q + + + n + + + o + p + + + + + + + + + r + s + + + eqnCoverageForTimesOperator @@ -3014,6 +3193,53 @@ + + + eqnCoverageForTimesOperator2 + + + + + + + m + n + + + + + + n + + + o + p + + + + + + q + + + n + + + o + p + + + + + + + + + r + s + + + eqnCoverageForDivideOperator @@ -3053,6 +3279,45 @@ + + + eqnCoverageForDivideOperator2 + + + + + m + n + + + + + + n + + + o + p + + + + + + q + + + n + + + o + p + + + + + + + eqnCoverageForAndOperator @@ -3372,6 +3637,34 @@ + + + eqnCoverageForMinusUnary2 + + + + + + + m + n + + + + + + + n + + + o + p + + + + + + diff --git a/tests/resources/coverage/generator/model.implementation.out b/tests/resources/coverage/generator/model.implementation.out index 2b2639f4b9..3ba38209d5 100644 --- a/tests/resources/coverage/generator/model.implementation.out +++ b/tests/resources/coverage/generator/model.implementation.out @@ -5,16 +5,6 @@ double xor(double x, double y) return (x != 0.0) ^ (y != 0.0); } -double min(double x, double y) -{ - return (x < y)?x:y; -} - -double max(double x, double y) -{ - return (x > y)?x:y; -} - double sec(double x) { return 1.0/cos(x); @@ -62,23 +52,17 @@ double acot(double x) double asech(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX-1.0)); + return acosh(1.0/x); } double acsch(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX+1.0)); + return asinh(1.0/x); } double acoth(double x) { - double oneOverX = 1.0/x; - - return 0.5*log((1.0+oneOverX)/(1.0-oneOverX)); + return atanh(1.0/x); } double * createStatesArray() @@ -164,11 +148,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *algebraic = ((RootFindingInfo *) data)->algebraic; double *externals = ((RootFindingInfo *) data)->externals; - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; - f[1] = algebraic[0]-algebraic[1]-(computedConstants[197]+computedConstants[198]); + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0; + f[1] = algebraic[3]-algebraic[4]-(computedConstants[205]+computedConstants[206]); } void findRoot0(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals) @@ -176,13 +160,13 @@ void findRoot0(double voi, double *states, double *rates, double *constants, dou RootFindingInfo rfi = { voi, states, rates, constants, computedConstants, algebraic, externals }; double u[2]; - u[0] = algebraic[0]; - u[1] = algebraic[1]; + u[0] = algebraic[3]; + u[1] = algebraic[4]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants, double *computedConstants, double *algebraic) @@ -195,20 +179,21 @@ void initialiseVariables(double *states, double *rates, double *constants, doubl constants[4] = 5.0; constants[5] = 6.0; constants[6] = 7.0; - computedConstants[176] = 123.0; - computedConstants[177] = 123.456789; - computedConstants[178] = 123.0e99; - computedConstants[179] = 123.456789e99; - computedConstants[181] = 1.0; - computedConstants[182] = 0.0; - computedConstants[183] = 2.71828182845905; - computedConstants[184] = 3.14159265358979; - computedConstants[185] = INFINITY; - computedConstants[186] = NAN; - computedConstants[197] = 1.0; - computedConstants[198] = 3.0; - algebraic[0] = 1.0; - algebraic[1] = 2.0; + computedConstants[169] = NAN; + computedConstants[179] = 123.0; + computedConstants[180] = 123.456789; + computedConstants[181] = 123.0e99; + computedConstants[182] = 123.456789e99; + computedConstants[184] = 1.0; + computedConstants[185] = 0.0; + computedConstants[186] = 2.71828182845905; + computedConstants[187] = 3.14159265358979; + computedConstants[188] = INFINITY; + computedConstants[189] = NAN; + computedConstants[205] = 1.0; + computedConstants[206] = 3.0; + algebraic[3] = 1.0; + algebraic[4] = 2.0; } void computeComputedConstants(double *constants, double *computedConstants) @@ -222,9 +207,9 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[6] = leq(constants[0], constants[1]); computedConstants[7] = constants[0]/leq(constants[1], constants[2]); computedConstants[8] = gt(constants[0], constants[1]); - computedConstants[9] = constants[0]/gt(constants[1], constants[2]); + computedConstants[9] = constants[0]/gt(constants[2], constants[1]); computedConstants[10] = geq(constants[0], constants[1]); - computedConstants[11] = constants[0]/geq(constants[1], constants[2]); + computedConstants[11] = constants[0]/geq(constants[2], constants[1]); computedConstants[12] = and(constants[0], constants[1]); computedConstants[13] = and(constants[0], and(constants[1], constants[2])); computedConstants[14] = and(lt(constants[0], constants[1]), gt(constants[2], constants[3])); @@ -241,165 +226,172 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[25] = and(lt(constants[0], constants[1]), pow(constants[2], constants[3])); computedConstants[26] = and(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); computedConstants[27] = constants[0]/and(constants[1], constants[2]); - computedConstants[28] = or(constants[0], constants[1]); - computedConstants[29] = or(constants[0], or(constants[1], constants[2])); - computedConstants[30] = or(lt(constants[0], constants[1]), gt(constants[2], constants[3])); - computedConstants[31] = or(constants[0]+constants[1], gt(constants[2], constants[3])); - computedConstants[32] = or(constants[0], gt(constants[1], constants[2])); - computedConstants[33] = or(constants[0]-constants[1], gt(constants[2], constants[3])); - computedConstants[34] = or(-constants[0], gt(constants[1], constants[2])); - computedConstants[35] = or(pow(constants[0], constants[1]), gt(constants[2], constants[3])); - computedConstants[36] = or(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); - computedConstants[37] = or(lt(constants[0], constants[1]), constants[2]+constants[3]); - computedConstants[38] = or(lt(constants[0], constants[1]), constants[2]); - computedConstants[39] = or(lt(constants[0], constants[1]), constants[2]-constants[3]); - computedConstants[40] = or(lt(constants[0], constants[1]), -constants[2]); - computedConstants[41] = or(lt(constants[0], constants[1]), pow(constants[2], constants[3])); - computedConstants[42] = or(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); - computedConstants[43] = constants[0]/or(constants[1], constants[2]); - computedConstants[44] = xor(constants[0], constants[1]); - computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); - computedConstants[46] = xor(lt(constants[0], constants[1]), gt(constants[2], constants[3])); - computedConstants[47] = xor(constants[0]+constants[1], gt(constants[2], constants[3])); - computedConstants[48] = xor(constants[0], gt(constants[1], constants[2])); - computedConstants[49] = xor(constants[0]-constants[1], gt(constants[2], constants[3])); - computedConstants[50] = xor(-constants[0], gt(constants[1], constants[2])); - computedConstants[51] = xor(pow(constants[0], constants[1]), gt(constants[2], constants[3])); - computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); - computedConstants[53] = xor(lt(constants[0], constants[1]), constants[2]+constants[3]); - computedConstants[54] = xor(lt(constants[0], constants[1]), constants[2]); - computedConstants[55] = xor(lt(constants[0], constants[1]), constants[2]-constants[3]); - computedConstants[56] = xor(lt(constants[0], constants[1]), -constants[2]); - computedConstants[57] = xor(lt(constants[0], constants[1]), pow(constants[2], constants[3])); - computedConstants[58] = xor(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); - computedConstants[59] = constants[0]/xor(constants[1], constants[2]); - computedConstants[60] = not(constants[0]); - computedConstants[61] = constants[0]+constants[1]+constants[2]; - computedConstants[62] = lt(constants[0], constants[1])+gt(constants[2], constants[3]); - computedConstants[63] = constants[0]; - computedConstants[64] = constants[0]-constants[1]; - computedConstants[65] = lt(constants[0], constants[1])-gt(constants[2], constants[3]); - computedConstants[66] = lt(constants[0], constants[1])-(constants[2]+constants[3]); - computedConstants[67] = lt(constants[0], constants[1])-constants[2]; - computedConstants[68] = constants[0]-(-constants[1]); - computedConstants[69] = constants[0]-(-constants[1]*constants[2]); - computedConstants[70] = -constants[0]; - computedConstants[71] = -lt(constants[0], constants[1]); - computedConstants[72] = constants[0]*constants[1]; - computedConstants[73] = constants[0]*constants[1]*constants[2]; - computedConstants[74] = lt(constants[0], constants[1])*gt(constants[2], constants[3]); - computedConstants[75] = (constants[0]+constants[1])*gt(constants[2], constants[3]); - computedConstants[76] = constants[0]*gt(constants[1], constants[2]); - computedConstants[77] = (constants[0]-constants[1])*gt(constants[2], constants[3]); - computedConstants[78] = -constants[0]*gt(constants[1], constants[2]); - computedConstants[79] = lt(constants[0], constants[1])*(constants[2]+constants[3]); - computedConstants[80] = lt(constants[0], constants[1])*constants[2]; - computedConstants[81] = lt(constants[0], constants[1])*(constants[2]-constants[3]); - computedConstants[82] = lt(constants[0], constants[1])*-constants[2]; - computedConstants[83] = constants[0]/constants[1]; - computedConstants[84] = lt(constants[0], constants[1])/gt(constants[3], constants[2]); - computedConstants[85] = (constants[0]+constants[1])/gt(constants[3], constants[2]); - computedConstants[86] = constants[0]/gt(constants[2], constants[1]); - computedConstants[87] = (constants[0]-constants[1])/gt(constants[3], constants[2]); - computedConstants[88] = -constants[0]/gt(constants[2], constants[1]); - computedConstants[89] = lt(constants[0], constants[1])/(constants[2]+constants[3]); - computedConstants[90] = lt(constants[0], constants[1])/constants[2]; - computedConstants[91] = lt(constants[0], constants[1])/(constants[2]-constants[3]); - computedConstants[92] = lt(constants[0], constants[1])/-constants[2]; - computedConstants[93] = lt(constants[0], constants[1])/(constants[2]*constants[3]); - computedConstants[94] = lt(constants[0], constants[1])/(constants[2]/constants[3]); - computedConstants[95] = sqrt(constants[0]); - computedConstants[96] = pow(constants[0], 2.0); - computedConstants[97] = pow(constants[0], 3.0); - computedConstants[98] = pow(constants[0], constants[1]); - computedConstants[99] = pow(leq(constants[0], constants[1]), geq(constants[2], constants[3])); - computedConstants[100] = pow(constants[0]+constants[1], geq(constants[2], constants[3])); - computedConstants[101] = pow(constants[0], geq(constants[1], constants[2])); - computedConstants[102] = pow(constants[0]-constants[1], geq(constants[2], constants[3])); - computedConstants[103] = pow(-constants[0], geq(constants[1], constants[2])); - computedConstants[104] = pow(constants[0]*constants[1], geq(constants[2], constants[3])); - computedConstants[105] = pow(constants[0]/constants[1], geq(constants[2], constants[3])); - computedConstants[106] = pow(leq(constants[0], constants[1]), constants[2]+constants[3]); - computedConstants[107] = pow(leq(constants[0], constants[1]), constants[2]); - computedConstants[108] = pow(leq(constants[0], constants[1]), constants[2]-constants[3]); - computedConstants[109] = pow(leq(constants[0], constants[1]), -constants[2]); - computedConstants[110] = pow(leq(constants[0], constants[1]), constants[2]*constants[3]); - computedConstants[111] = pow(leq(constants[0], constants[1]), constants[2]/constants[3]); - computedConstants[112] = pow(leq(constants[0], constants[1]), pow(constants[2], constants[3])); - computedConstants[113] = pow(leq(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); - computedConstants[114] = sqrt(constants[0]); - computedConstants[115] = sqrt(constants[0]); - computedConstants[116] = pow(constants[0], 1.0/3.0); - computedConstants[117] = pow(constants[0], 1.0/constants[1]); - computedConstants[118] = pow(lt(constants[0], constants[1]), 1.0/gt(constants[3], constants[2])); - computedConstants[119] = pow(constants[0]+constants[1], 1.0/gt(constants[3], constants[2])); - computedConstants[120] = pow(constants[0], 1.0/gt(constants[2], constants[1])); - computedConstants[121] = pow(constants[0]-constants[1], 1.0/gt(constants[3], constants[2])); - computedConstants[122] = pow(-constants[0], 1.0/gt(constants[2], constants[1])); - computedConstants[123] = pow(constants[0]*constants[1], 1.0/gt(constants[3], constants[2])); - computedConstants[124] = pow(constants[0]/constants[1], 1.0/gt(constants[3], constants[2])); - computedConstants[125] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]+constants[3])); - computedConstants[126] = pow(lt(constants[0], constants[1]), 1.0/constants[2]); - computedConstants[127] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]-constants[3])); - computedConstants[128] = pow(lt(constants[0], constants[1]), 1.0/-constants[2]); - computedConstants[129] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]*constants[3])); - computedConstants[130] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]/constants[3])); - computedConstants[131] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])); - computedConstants[132] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])); - computedConstants[133] = fabs(constants[0]); - computedConstants[134] = exp(constants[0]); - computedConstants[135] = log(constants[0]); + computedConstants[28] = or(lt(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[29] = or(constants[0]+constants[1], gt(constants[2], constants[3])); + computedConstants[30] = or(constants[0], gt(constants[1], constants[2])); + computedConstants[31] = or(constants[0]-constants[1], gt(constants[2], constants[3])); + computedConstants[32] = or(-constants[0], gt(constants[1], constants[2])); + computedConstants[33] = or(pow(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[34] = or(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); + computedConstants[35] = or(lt(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[36] = or(lt(constants[0], constants[1]), constants[2]); + computedConstants[37] = or(lt(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[38] = or(lt(constants[0], constants[1]), -constants[2]); + computedConstants[39] = or(lt(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[40] = or(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[41] = constants[0]/or(constants[1], constants[2]); + computedConstants[42] = xor(constants[0], constants[1]); + computedConstants[43] = xor(constants[0], xor(constants[1], constants[2])); + computedConstants[44] = xor(lt(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[45] = xor(constants[0]+constants[1], gt(constants[2], constants[3])); + computedConstants[46] = xor(constants[0], gt(constants[1], constants[2])); + computedConstants[47] = xor(constants[0]-constants[1], gt(constants[2], constants[3])); + computedConstants[48] = xor(-constants[0], gt(constants[1], constants[2])); + computedConstants[49] = xor(pow(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[50] = xor(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); + computedConstants[51] = xor(lt(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[52] = xor(lt(constants[0], constants[1]), constants[2]); + computedConstants[53] = xor(lt(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[54] = xor(lt(constants[0], constants[1]), -constants[2]); + computedConstants[55] = xor(lt(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[56] = xor(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[57] = not(constants[0]); + computedConstants[58] = constants[0]+constants[1]+constants[2]; + computedConstants[59] = lt(constants[0], constants[1])+gt(constants[2], constants[3]); + computedConstants[60] = constants[0]; + computedConstants[61] = constants[0]-constants[1]; + computedConstants[62] = lt(constants[0], constants[1])-gt(constants[2], constants[3]); + computedConstants[63] = lt(constants[0], constants[1])-(constants[2]+constants[3]); + computedConstants[64] = lt(constants[0], constants[1])-constants[2]; + computedConstants[65] = constants[0]-(-constants[1]); + computedConstants[66] = constants[0]-(-constants[1]*constants[2]); + computedConstants[67] = -constants[0]; + computedConstants[68] = -lt(constants[0], constants[1]); + computedConstants[69] = constants[0]*constants[1]; + computedConstants[70] = constants[0]*constants[1]*constants[2]; + computedConstants[71] = lt(constants[0], constants[1])*gt(constants[2], constants[3]); + computedConstants[72] = (constants[0]+constants[1])*gt(constants[2], constants[3]); + computedConstants[73] = constants[0]*gt(constants[1], constants[2]); + computedConstants[74] = (constants[0]-constants[1])*gt(constants[2], constants[3]); + computedConstants[75] = -constants[0]*gt(constants[1], constants[2]); + computedConstants[76] = lt(constants[0], constants[1])*(constants[2]+constants[3]); + computedConstants[77] = lt(constants[0], constants[1])*constants[2]; + computedConstants[78] = lt(constants[0], constants[1])*(constants[2]-constants[3]); + computedConstants[79] = lt(constants[0], constants[1])*-constants[2]; + computedConstants[80] = constants[0]/constants[1]; + computedConstants[81] = lt(constants[0], constants[1])/gt(constants[3], constants[2]); + computedConstants[82] = (constants[0]+constants[1])/gt(constants[3], constants[2]); + computedConstants[83] = constants[0]/gt(constants[2], constants[1]); + computedConstants[84] = (constants[0]-constants[1])/gt(constants[3], constants[2]); + computedConstants[85] = -constants[0]/gt(constants[2], constants[1]); + computedConstants[86] = lt(constants[0], constants[1])/(constants[2]+constants[3]); + computedConstants[87] = lt(constants[0], constants[1])/constants[2]; + computedConstants[88] = lt(constants[0], constants[1])/(constants[2]-constants[3]); + computedConstants[89] = lt(constants[0], constants[1])/-constants[2]; + computedConstants[90] = lt(constants[0], constants[1])/(constants[2]*constants[3]); + computedConstants[91] = lt(constants[0], constants[1])/(constants[2]/constants[3]); + computedConstants[92] = sqrt(constants[0]); + computedConstants[93] = pow(constants[0], 2.0); + computedConstants[94] = pow(constants[0], 3.0); + computedConstants[95] = pow(constants[0], constants[1]); + computedConstants[96] = pow(leq(constants[0], constants[1]), geq(constants[2], constants[3])); + computedConstants[97] = pow(constants[0]+constants[1], geq(constants[2], constants[3])); + computedConstants[98] = pow(constants[0], geq(constants[1], constants[2])); + computedConstants[99] = pow(constants[0]-constants[1], geq(constants[2], constants[3])); + computedConstants[100] = pow(-constants[0], geq(constants[1], constants[2])); + computedConstants[101] = pow(constants[0]*constants[1], geq(constants[2], constants[3])); + computedConstants[102] = pow(constants[0]/constants[1], geq(constants[2], constants[3])); + computedConstants[103] = pow(leq(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[104] = pow(leq(constants[0], constants[1]), constants[2]); + computedConstants[105] = pow(leq(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[106] = pow(leq(constants[0], constants[1]), -constants[2]); + computedConstants[107] = pow(leq(constants[0], constants[1]), constants[2]*constants[3]); + computedConstants[108] = pow(leq(constants[0], constants[1]), constants[2]/constants[3]); + computedConstants[109] = pow(leq(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[110] = pow(leq(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[111] = sqrt(constants[0]); + computedConstants[112] = sqrt(constants[0]); + computedConstants[113] = pow(constants[0], 1.0/0.5); + computedConstants[114] = pow(constants[0], 1.0/3.0); + computedConstants[115] = pow(constants[0], 1.0/constants[1]); + computedConstants[116] = pow(lt(constants[0], constants[1]), 1.0/gt(constants[3], constants[2])); + computedConstants[117] = pow(constants[0]+constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[118] = pow(constants[0], 1.0/gt(constants[2], constants[1])); + computedConstants[119] = pow(constants[0]-constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[120] = pow(-constants[0], 1.0/gt(constants[2], constants[1])); + computedConstants[121] = pow(constants[0]*constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[122] = pow(constants[0]/constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[123] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]+constants[3])); + computedConstants[124] = pow(lt(constants[0], constants[1]), 1.0/constants[2]); + computedConstants[125] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]-constants[3])); + computedConstants[126] = pow(lt(constants[0], constants[1]), 1.0/-constants[2]); + computedConstants[127] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]*constants[3])); + computedConstants[128] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]/constants[3])); + computedConstants[129] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])); + computedConstants[130] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[131] = fabs(constants[0]); + computedConstants[132] = exp(constants[0]); + computedConstants[133] = log(constants[0]); + computedConstants[134] = log10(constants[0]); + computedConstants[135] = log(constants[0])/log(2.0); computedConstants[136] = log10(constants[0]); - computedConstants[137] = log(constants[0])/log(2.0); - computedConstants[138] = log10(constants[0]); - computedConstants[139] = log(constants[0])/log(constants[1]); - computedConstants[140] = ceil(constants[0]); - computedConstants[141] = floor(constants[0]); - computedConstants[142] = min(constants[0], constants[1]); - computedConstants[143] = min(constants[0], min(constants[1], constants[2])); - computedConstants[144] = max(constants[0], constants[1]); - computedConstants[145] = max(constants[0], max(constants[1], constants[2])); - computedConstants[146] = fmod(constants[0], constants[1]); - computedConstants[147] = sin(constants[0]); - computedConstants[148] = cos(constants[0]); - computedConstants[149] = tan(constants[0]); - computedConstants[150] = sec(constants[0]); - computedConstants[151] = csc(constants[0]); - computedConstants[152] = cot(constants[0]); - computedConstants[153] = sinh(constants[0]); - computedConstants[154] = cosh(constants[0]); - computedConstants[155] = tanh(constants[0]); - computedConstants[156] = sech(constants[0]); - computedConstants[157] = csch(constants[0]); - computedConstants[158] = coth(constants[0]); - computedConstants[159] = asin(constants[0]); - computedConstants[160] = acos(constants[0]); - computedConstants[161] = atan(constants[0]); - computedConstants[162] = asec(constants[0]); - computedConstants[163] = acsc(constants[0]); - computedConstants[164] = acot(constants[0]); - computedConstants[165] = asinh(constants[0]); - computedConstants[166] = acosh(constants[0]); - computedConstants[167] = atanh(constants[0]/2.0); - computedConstants[168] = asech(constants[0]); - computedConstants[169] = acsch(constants[0]); - computedConstants[170] = acoth(2.0*constants[0]); - computedConstants[171] = (gt(constants[0], constants[1]))?constants[0]:NAN; - computedConstants[172] = (gt(constants[0], constants[1]))?constants[0]:constants[2]; - computedConstants[173] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:NAN; - computedConstants[174] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:constants[6]; - computedConstants[175] = 123.0+((gt(constants[0], constants[1]))?constants[0]:NAN); - computedConstants[180] = constants[0]; - computedConstants[187] = and(constants[0], constants[1])+((gt(constants[2], constants[3]))?constants[1]:NAN)+constants[4]+and(constants[5], constants[6]); - computedConstants[188] = and(constants[0], constants[1])-(((gt(constants[2], constants[3]))?constants[1]:NAN)-(constants[4]-((gt(constants[2], constants[3]))?constants[1]:NAN)))-and(constants[5], constants[6]); - computedConstants[189] = and(constants[0], constants[1])*((gt(constants[2], constants[3]))?constants[1]:NAN)*constants[4]*((gt(constants[2], constants[3]))?constants[1]:NAN)*and(constants[5], constants[6]); - computedConstants[190] = and(constants[0], constants[1])/(((gt(constants[2], constants[3]))?constants[1]:NAN)/(constants[4]/((gt(constants[2], constants[3]))?constants[1]:NAN))); - computedConstants[191] = and(or(constants[0], constants[1]), and(xor(constants[0], constants[1]), and((gt(constants[2], constants[3]))?constants[1]:NAN, and(and(and(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), or(constants[0], constants[1]))))); - computedConstants[192] = or(and(constants[0], constants[1]), or(xor(constants[0], constants[1]), or((gt(constants[2], constants[3]))?constants[1]:NAN, or(or(or(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), and(constants[0], constants[1]))))); - computedConstants[193] = xor(and(constants[0], constants[1]), xor(or(constants[0], constants[1]), xor((gt(constants[2], constants[3]))?constants[1]:NAN, xor(xor(xor(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), or(constants[0], constants[1])), and(constants[0], constants[1]))))); - computedConstants[194] = pow(and(constants[0], constants[1]), pow((gt(constants[2], constants[3]))?constants[1]:NAN, pow(pow(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), and(constants[0], constants[1])))); - computedConstants[195] = pow(pow(pow(and(constants[0], constants[1]), 1.0/pow((gt(constants[2], constants[3]))?constants[1]:NAN, 1.0/constants[4])), 1.0/((gt(constants[2], constants[3]))?constants[1]:NAN)), 1.0/and(constants[0], constants[1])); - computedConstants[196] = -and(constants[0], constants[1])+-((gt(constants[2], constants[3]))?constants[1]:NAN); + computedConstants[137] = log(constants[0])/log(constants[1]); + computedConstants[138] = ceil(constants[0]); + computedConstants[139] = floor(constants[0]); + computedConstants[140] = fmin(constants[0], constants[1]); + computedConstants[141] = fmin(constants[0], fmin(constants[1], constants[2])); + computedConstants[142] = fmax(constants[0], constants[1]); + computedConstants[143] = fmax(constants[0], fmax(constants[1], constants[2])); + computedConstants[144] = fmod(constants[0], constants[1]); + computedConstants[145] = sin(constants[0]); + computedConstants[146] = cos(constants[0]); + computedConstants[147] = tan(constants[0]); + computedConstants[148] = sec(constants[0]); + computedConstants[149] = csc(constants[0]); + computedConstants[150] = cot(constants[0]); + computedConstants[151] = sinh(constants[0]); + computedConstants[152] = cosh(constants[0]); + computedConstants[153] = tanh(constants[0]); + computedConstants[154] = sech(constants[0]); + computedConstants[155] = csch(constants[0]); + computedConstants[156] = coth(constants[0]); + computedConstants[157] = asin(constants[0]); + computedConstants[158] = acos(constants[0]); + computedConstants[159] = atan(constants[0]); + computedConstants[160] = asec(constants[0]); + computedConstants[161] = acsc(constants[0]); + computedConstants[162] = acot(constants[0]); + computedConstants[163] = asinh(constants[0]); + computedConstants[164] = acosh(constants[0]); + computedConstants[165] = atanh(constants[0]/2.0); + computedConstants[166] = asech(constants[0]); + computedConstants[167] = acsch(constants[0]); + computedConstants[168] = acoth(2.0*constants[0]); + computedConstants[170] = (gt(constants[0], constants[1]))?constants[0]:NAN; + computedConstants[171] = (lt(constants[0], constants[1]))?constants[0]:NAN; + computedConstants[172] = constants[0]; + computedConstants[173] = (gt(constants[0], constants[1]))?constants[0]:constants[2]; + computedConstants[174] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:NAN; + computedConstants[175] = (lt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:NAN; + computedConstants[176] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:constants[6]; + computedConstants[177] = 123.0+((gt(constants[0], constants[1]))?constants[0]:NAN); + computedConstants[178] = 123.0+((lt(constants[0], constants[1]))?constants[0]:NAN); + computedConstants[183] = constants[0]; + computedConstants[190] = and(constants[0], constants[1])+((gt(constants[2], constants[3]))?constants[1]:NAN)+constants[4]+and(constants[5], constants[6]); + computedConstants[191] = and(constants[0], constants[1])+((lt(constants[2], constants[3]))?constants[1]:NAN)+constants[4]+and(constants[5], constants[6]); + computedConstants[192] = and(constants[0], constants[1])-(((gt(constants[2], constants[3]))?constants[1]:NAN)-(constants[4]-((gt(constants[2], constants[3]))?constants[1]:NAN)))-and(constants[5], constants[6]); + computedConstants[193] = and(constants[0], constants[1])-(((lt(constants[2], constants[3]))?constants[1]:NAN)-(constants[4]-((lt(constants[2], constants[3]))?constants[1]:NAN)))-and(constants[5], constants[6]); + computedConstants[194] = and(constants[0], constants[1])*((gt(constants[2], constants[3]))?constants[1]:NAN)*constants[4]*((gt(constants[2], constants[3]))?constants[1]:NAN)*and(constants[5], constants[6]); + computedConstants[195] = and(constants[0], constants[1])*((lt(constants[2], constants[3]))?constants[1]:NAN)*constants[4]*((lt(constants[2], constants[3]))?constants[1]:NAN)*and(constants[5], constants[6]); + computedConstants[196] = and(constants[0], constants[1])/(((gt(constants[2], constants[3]))?constants[1]:NAN)/(constants[4]/((gt(constants[2], constants[3]))?constants[1]:NAN))); + computedConstants[197] = and(constants[0], constants[1])/(((lt(constants[2], constants[3]))?constants[1]:NAN)/(constants[4]/((lt(constants[2], constants[3]))?constants[1]:NAN))); + computedConstants[198] = and(or(constants[0], constants[1]), and(xor(constants[0], constants[1]), and((gt(constants[2], constants[3]))?constants[1]:NAN, and(and(and(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), or(constants[0], constants[1]))))); + computedConstants[199] = or(and(constants[0], constants[1]), or(xor(constants[0], constants[1]), or((gt(constants[2], constants[3]))?constants[1]:NAN, or(or(or(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), and(constants[0], constants[1]))))); + computedConstants[200] = xor(and(constants[0], constants[1]), xor(or(constants[0], constants[1]), xor((gt(constants[2], constants[3]))?constants[1]:NAN, xor(xor(xor(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), or(constants[0], constants[1])), and(constants[0], constants[1]))))); + computedConstants[201] = pow(and(constants[0], constants[1]), pow((gt(constants[2], constants[3]))?constants[1]:NAN, pow(pow(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), and(constants[0], constants[1])))); + computedConstants[202] = pow(pow(pow(and(constants[0], constants[1]), 1.0/pow((gt(constants[2], constants[3]))?constants[1]:NAN, 1.0/constants[4])), 1.0/((gt(constants[2], constants[3]))?constants[1]:NAN)), 1.0/and(constants[0], constants[1])); + computedConstants[203] = -and(constants[0], constants[1])+-((gt(constants[2], constants[3]))?constants[1]:NAN); + computedConstants[204] = -and(constants[0], constants[1])+-((lt(constants[2], constants[3]))?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) @@ -409,6 +401,9 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) { + algebraic[0] = or(states[0], states[0]); + algebraic[1] = or(states[0], or(states[0], constants[0])); + algebraic[2] = constants[0]/xor(constants[1], states[0]); externals[0] = externalVariable(voi, states, rates, constants, computedConstants, algebraic, externals, 0); findRoot0(voi, states, rates, constants, computedConstants, algebraic, externals); } diff --git a/tests/resources/coverage/generator/model.out b/tests/resources/coverage/generator/model.out index 84c6417ef6..326fdee8d4 100644 --- a/tests/resources/coverage/generator/model.out +++ b/tests/resources/coverage/generator/model.out @@ -2,16 +2,6 @@ #include "customheaderfile.h" -double min(double x, double y) -{ - return (x < y)?x:y; -} - -double max(double x, double y) -{ - return (x > y)?x:y; -} - double sec(double x) { return 1.0/cos(x); @@ -59,23 +49,17 @@ double acot(double x) double asech(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX-1.0)); + return acosh(1.0/x); } double acsch(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX+1.0)); + return asinh(1.0/x); } double acoth(double x) { - double oneOverX = 1.0/x; - - return 0.5*log((1.0+oneOverX)/(1.0-oneOverX)); + return atanh(1.0/x); } typedef struct { @@ -101,11 +85,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *algebraic = ((RootFindingInfo *) data)->algebraic; double *externals = ((RootFindingInfo *) data)->externals; - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; - f[1] = algebraic[0]-algebraic[1]-(computedConstants[197]+computedConstants[198]); + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0; + f[1] = algebraic[3]-algebraic[4]-(computedConstants[205]+computedConstants[206]); } void findRoot0(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals) @@ -113,13 +97,13 @@ void findRoot0(double voi, double *states, double *rates, double *constants, dou RootFindingInfo rfi = { voi, states, rates, constants, computedConstants, algebraic, externals }; double u[2]; - u[0] = algebraic[0]; - u[1] = algebraic[1]; + u[0] = algebraic[3]; + u[1] = algebraic[4]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; } void computeComputedConstants(double *constants, double *computedConstants) @@ -133,9 +117,9 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[6] = constants[0] <= constants[1]; computedConstants[7] = constants[0]/(constants[1] <= constants[2]); computedConstants[8] = constants[0] > constants[1]; - computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[9] = constants[0]/(constants[2] > constants[1]); computedConstants[10] = constants[0] >= constants[1]; - computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[11] = constants[0]/(constants[2] >= constants[1]); computedConstants[12] = constants[0] && constants[1]; computedConstants[13] = constants[0] && constants[1] && constants[2]; computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); @@ -152,165 +136,172 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[25] = (constants[0] < constants[1]) && (constants[2]^^constants[3]); computedConstants[26] = (constants[0] < constants[1]) && (constants[2]^^(1.0/constants[3])); computedConstants[27] = constants[0]/(constants[1] && constants[2]); - computedConstants[28] = constants[0] || constants[1]; - computedConstants[29] = constants[0] || constants[1] || constants[2]; - computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); - computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); - computedConstants[32] = constants[0] || (constants[1] > constants[2]); - computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); - computedConstants[34] = -constants[0] || (constants[1] > constants[2]); - computedConstants[35] = (constants[0]^^constants[1]) || (constants[2] > constants[3]); - computedConstants[36] = (constants[0]^^(1.0/constants[1])) || (constants[2] > constants[3]); - computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); - computedConstants[38] = (constants[0] < constants[1]) || constants[2]; - computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); - computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; - computedConstants[41] = (constants[0] < constants[1]) || (constants[2]^^constants[3]); - computedConstants[42] = (constants[0] < constants[1]) || (constants[2]^^(1.0/constants[3])); - computedConstants[43] = constants[0]/(constants[1] || constants[2]); - computedConstants[44] = constants[0]^constants[1]; - computedConstants[45] = constants[0]^constants[1]^constants[2]; - computedConstants[46] = (constants[0] < constants[1])^(constants[2] > constants[3]); - computedConstants[47] = (constants[0]+constants[1])^(constants[2] > constants[3]); - computedConstants[48] = constants[0]^(constants[1] > constants[2]); - computedConstants[49] = (constants[0]-constants[1])^(constants[2] > constants[3]); - computedConstants[50] = -constants[0]^(constants[1] > constants[2]); - computedConstants[51] = (constants[0]^^constants[1])^(constants[2] > constants[3]); - computedConstants[52] = (constants[0]^^(1.0/constants[1]))^(constants[2] > constants[3]); - computedConstants[53] = (constants[0] < constants[1])^(constants[2]+constants[3]); - computedConstants[54] = (constants[0] < constants[1])^constants[2]; - computedConstants[55] = (constants[0] < constants[1])^(constants[2]-constants[3]); - computedConstants[56] = (constants[0] < constants[1])^-constants[2]; - computedConstants[57] = (constants[0] < constants[1])^(constants[2]^^constants[3]); - computedConstants[58] = (constants[0] < constants[1])^(constants[2]^^(1.0/constants[3])); - computedConstants[59] = constants[0]/(constants[1]^constants[2]); - computedConstants[60] = !constants[0]; - computedConstants[61] = constants[0]+constants[1]+constants[2]; - computedConstants[62] = (constants[0] < constants[1])+(constants[2] > constants[3]); - computedConstants[63] = constants[0]; - computedConstants[64] = constants[0]-constants[1]; - computedConstants[65] = (constants[0] < constants[1])-(constants[2] > constants[3]); - computedConstants[66] = (constants[0] < constants[1])-(constants[2]+constants[3]); - computedConstants[67] = (constants[0] < constants[1])-constants[2]; - computedConstants[68] = constants[0]-(-constants[1]); - computedConstants[69] = constants[0]-(-constants[1]*constants[2]); - computedConstants[70] = -constants[0]; - computedConstants[71] = -(constants[0] < constants[1]); - computedConstants[72] = constants[0]*constants[1]; - computedConstants[73] = constants[0]*constants[1]*constants[2]; - computedConstants[74] = (constants[0] < constants[1])*(constants[2] > constants[3]); - computedConstants[75] = (constants[0]+constants[1])*(constants[2] > constants[3]); - computedConstants[76] = constants[0]*(constants[1] > constants[2]); - computedConstants[77] = (constants[0]-constants[1])*(constants[2] > constants[3]); - computedConstants[78] = -constants[0]*(constants[1] > constants[2]); - computedConstants[79] = (constants[0] < constants[1])*(constants[2]+constants[3]); - computedConstants[80] = (constants[0] < constants[1])*constants[2]; - computedConstants[81] = (constants[0] < constants[1])*(constants[2]-constants[3]); - computedConstants[82] = (constants[0] < constants[1])*-constants[2]; - computedConstants[83] = constants[0]/constants[1]; - computedConstants[84] = (constants[0] < constants[1])/(constants[3] > constants[2]); - computedConstants[85] = (constants[0]+constants[1])/(constants[3] > constants[2]); - computedConstants[86] = constants[0]/(constants[2] > constants[1]); - computedConstants[87] = (constants[0]-constants[1])/(constants[3] > constants[2]); - computedConstants[88] = -constants[0]/(constants[2] > constants[1]); - computedConstants[89] = (constants[0] < constants[1])/(constants[2]+constants[3]); - computedConstants[90] = (constants[0] < constants[1])/constants[2]; - computedConstants[91] = (constants[0] < constants[1])/(constants[2]-constants[3]); - computedConstants[92] = (constants[0] < constants[1])/-constants[2]; - computedConstants[93] = (constants[0] < constants[1])/(constants[2]*constants[3]); - computedConstants[94] = (constants[0] < constants[1])/(constants[2]/constants[3]); - computedConstants[95] = sqrt(constants[0]); - computedConstants[96] = sqr(constants[0]); - computedConstants[97] = constants[0]^^3.0; - computedConstants[98] = constants[0]^^constants[1]; - computedConstants[99] = (constants[0] <= constants[1])^^(constants[2] >= constants[3]); - computedConstants[100] = (constants[0]+constants[1])^^(constants[2] >= constants[3]); - computedConstants[101] = constants[0]^^(constants[1] >= constants[2]); - computedConstants[102] = (constants[0]-constants[1])^^(constants[2] >= constants[3]); - computedConstants[103] = (-constants[0])^^(constants[1] >= constants[2]); - computedConstants[104] = (constants[0]*constants[1])^^(constants[2] >= constants[3]); - computedConstants[105] = (constants[0]/constants[1])^^(constants[2] >= constants[3]); - computedConstants[106] = (constants[0] <= constants[1])^^(constants[2]+constants[3]); - computedConstants[107] = (constants[0] <= constants[1])^^constants[2]; - computedConstants[108] = (constants[0] <= constants[1])^^constants[2]-constants[3]; - computedConstants[109] = (constants[0] <= constants[1])^^-constants[2]; - computedConstants[110] = (constants[0] <= constants[1])^^(constants[2]*constants[3]); - computedConstants[111] = (constants[0] <= constants[1])^^(constants[2]/constants[3]); - computedConstants[112] = (constants[0] <= constants[1])^^(constants[2]^^constants[3]); - computedConstants[113] = (constants[0] <= constants[1])^^(constants[2]^^(1.0/constants[3])); - computedConstants[114] = sqrt(constants[0]); - computedConstants[115] = sqrt(constants[0]); - computedConstants[116] = constants[0]^^(1.0/3.0); - computedConstants[117] = constants[0]^^(1.0/constants[1]); - computedConstants[118] = (constants[0] < constants[1])^^(1.0/(constants[3] > constants[2])); - computedConstants[119] = (constants[0]+constants[1])^^(1.0/(constants[3] > constants[2])); - computedConstants[120] = constants[0]^^(1.0/(constants[2] > constants[1])); - computedConstants[121] = (constants[0]-constants[1])^^(1.0/(constants[3] > constants[2])); - computedConstants[122] = (-constants[0])^^(1.0/(constants[2] > constants[1])); - computedConstants[123] = (constants[0]*constants[1])^^(1.0/(constants[3] > constants[2])); - computedConstants[124] = (constants[0]/constants[1])^^(1.0/(constants[3] > constants[2])); - computedConstants[125] = (constants[0] < constants[1])^^(1.0/(constants[2]+constants[3])); - computedConstants[126] = (constants[0] < constants[1])^^(1.0/constants[2]); - computedConstants[127] = (constants[0] < constants[1])^^(1.0/(constants[2]-constants[3])); - computedConstants[128] = (constants[0] < constants[1])^^(1.0/(-constants[2])); - computedConstants[129] = (constants[0] < constants[1])^^(1.0/(constants[2]*constants[3])); - computedConstants[130] = (constants[0] < constants[1])^^(1.0/(constants[2]/constants[3])); - computedConstants[131] = (constants[0] < constants[1])^^(1.0/(constants[2]^^constants[3])); - computedConstants[132] = (constants[0] < constants[1])^^(1.0/(constants[2]^^(1.0/constants[3]))); - computedConstants[133] = fabs(constants[0]); - computedConstants[134] = exp(constants[0]); - computedConstants[135] = log(constants[0]); + computedConstants[28] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[29] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[30] = constants[0] || (constants[1] > constants[2]); + computedConstants[31] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = -constants[0] || (constants[1] > constants[2]); + computedConstants[33] = (constants[0]^^constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = (constants[0]^^(1.0/constants[1])) || (constants[2] > constants[3]); + computedConstants[35] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[36] = (constants[0] < constants[1]) || constants[2]; + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || (constants[2]^^constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || (constants[2]^^(1.0/constants[3])); + computedConstants[41] = constants[0]/(constants[1] || constants[2]); + computedConstants[42] = constants[0]^constants[1]; + computedConstants[43] = constants[0]^constants[1]^constants[2]; + computedConstants[44] = (constants[0] < constants[1])^(constants[2] > constants[3]); + computedConstants[45] = (constants[0]+constants[1])^(constants[2] > constants[3]); + computedConstants[46] = constants[0]^(constants[1] > constants[2]); + computedConstants[47] = (constants[0]-constants[1])^(constants[2] > constants[3]); + computedConstants[48] = -constants[0]^(constants[1] > constants[2]); + computedConstants[49] = (constants[0]^^constants[1])^(constants[2] > constants[3]); + computedConstants[50] = (constants[0]^^(1.0/constants[1]))^(constants[2] > constants[3]); + computedConstants[51] = (constants[0] < constants[1])^(constants[2]+constants[3]); + computedConstants[52] = (constants[0] < constants[1])^constants[2]; + computedConstants[53] = (constants[0] < constants[1])^(constants[2]-constants[3]); + computedConstants[54] = (constants[0] < constants[1])^-constants[2]; + computedConstants[55] = (constants[0] < constants[1])^(constants[2]^^constants[3]); + computedConstants[56] = (constants[0] < constants[1])^(constants[2]^^(1.0/constants[3])); + computedConstants[57] = !constants[0]; + computedConstants[58] = constants[0]+constants[1]+constants[2]; + computedConstants[59] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[60] = constants[0]; + computedConstants[61] = constants[0]-constants[1]; + computedConstants[62] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[63] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[64] = (constants[0] < constants[1])-constants[2]; + computedConstants[65] = constants[0]-(-constants[1]); + computedConstants[66] = constants[0]-(-constants[1]*constants[2]); + computedConstants[67] = -constants[0]; + computedConstants[68] = -(constants[0] < constants[1]); + computedConstants[69] = constants[0]*constants[1]; + computedConstants[70] = constants[0]*constants[1]*constants[2]; + computedConstants[71] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[72] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[73] = constants[0]*(constants[1] > constants[2]); + computedConstants[74] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[75] = -constants[0]*(constants[1] > constants[2]); + computedConstants[76] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[77] = (constants[0] < constants[1])*constants[2]; + computedConstants[78] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[79] = (constants[0] < constants[1])*-constants[2]; + computedConstants[80] = constants[0]/constants[1]; + computedConstants[81] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[82] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[83] = constants[0]/(constants[2] > constants[1]); + computedConstants[84] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[85] = -constants[0]/(constants[2] > constants[1]); + computedConstants[86] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[87] = (constants[0] < constants[1])/constants[2]; + computedConstants[88] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[89] = (constants[0] < constants[1])/-constants[2]; + computedConstants[90] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[91] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[92] = sqrt(constants[0]); + computedConstants[93] = sqr(constants[0]); + computedConstants[94] = constants[0]^^3.0; + computedConstants[95] = constants[0]^^constants[1]; + computedConstants[96] = (constants[0] <= constants[1])^^(constants[2] >= constants[3]); + computedConstants[97] = (constants[0]+constants[1])^^(constants[2] >= constants[3]); + computedConstants[98] = constants[0]^^(constants[1] >= constants[2]); + computedConstants[99] = (constants[0]-constants[1])^^(constants[2] >= constants[3]); + computedConstants[100] = (-constants[0])^^(constants[1] >= constants[2]); + computedConstants[101] = (constants[0]*constants[1])^^(constants[2] >= constants[3]); + computedConstants[102] = (constants[0]/constants[1])^^(constants[2] >= constants[3]); + computedConstants[103] = (constants[0] <= constants[1])^^(constants[2]+constants[3]); + computedConstants[104] = (constants[0] <= constants[1])^^constants[2]; + computedConstants[105] = (constants[0] <= constants[1])^^constants[2]-constants[3]; + computedConstants[106] = (constants[0] <= constants[1])^^-constants[2]; + computedConstants[107] = (constants[0] <= constants[1])^^(constants[2]*constants[3]); + computedConstants[108] = (constants[0] <= constants[1])^^(constants[2]/constants[3]); + computedConstants[109] = (constants[0] <= constants[1])^^(constants[2]^^constants[3]); + computedConstants[110] = (constants[0] <= constants[1])^^(constants[2]^^(1.0/constants[3])); + computedConstants[111] = sqrt(constants[0]); + computedConstants[112] = sqrt(constants[0]); + computedConstants[113] = sqr(constants[0]); + computedConstants[114] = constants[0]^^(1.0/3.0); + computedConstants[115] = constants[0]^^(1.0/constants[1]); + computedConstants[116] = (constants[0] < constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[117] = (constants[0]+constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[118] = constants[0]^^(1.0/(constants[2] > constants[1])); + computedConstants[119] = (constants[0]-constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[120] = (-constants[0])^^(1.0/(constants[2] > constants[1])); + computedConstants[121] = (constants[0]*constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[122] = (constants[0]/constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[123] = (constants[0] < constants[1])^^(1.0/(constants[2]+constants[3])); + computedConstants[124] = (constants[0] < constants[1])^^(1.0/constants[2]); + computedConstants[125] = (constants[0] < constants[1])^^(1.0/(constants[2]-constants[3])); + computedConstants[126] = (constants[0] < constants[1])^^(1.0/(-constants[2])); + computedConstants[127] = (constants[0] < constants[1])^^(1.0/(constants[2]*constants[3])); + computedConstants[128] = (constants[0] < constants[1])^^(1.0/(constants[2]/constants[3])); + computedConstants[129] = (constants[0] < constants[1])^^(1.0/(constants[2]^^constants[3])); + computedConstants[130] = (constants[0] < constants[1])^^(1.0/(constants[2]^^(1.0/constants[3]))); + computedConstants[131] = fabs(constants[0]); + computedConstants[132] = exp(constants[0]); + computedConstants[133] = log(constants[0]); + computedConstants[134] = log10(constants[0]); + computedConstants[135] = log(constants[0])/log(2.0); computedConstants[136] = log10(constants[0]); - computedConstants[137] = log(constants[0])/log(2.0); - computedConstants[138] = log10(constants[0]); - computedConstants[139] = log(constants[0])/log(constants[1]); - computedConstants[140] = ceil(constants[0]); - computedConstants[141] = floor(constants[0]); - computedConstants[142] = min(constants[0], constants[1]); - computedConstants[143] = min(constants[0], min(constants[1], constants[2])); - computedConstants[144] = max(constants[0], constants[1]); - computedConstants[145] = max(constants[0], max(constants[1], constants[2])); - computedConstants[146] = fmod(constants[0], constants[1]); - computedConstants[147] = sin(constants[0]); - computedConstants[148] = cos(constants[0]); - computedConstants[149] = tan(constants[0]); - computedConstants[150] = sec(constants[0]); - computedConstants[151] = csc(constants[0]); - computedConstants[152] = cot(constants[0]); - computedConstants[153] = sinh(constants[0]); - computedConstants[154] = cosh(constants[0]); - computedConstants[155] = tanh(constants[0]); - computedConstants[156] = sech(constants[0]); - computedConstants[157] = csch(constants[0]); - computedConstants[158] = coth(constants[0]); - computedConstants[159] = asin(constants[0]); - computedConstants[160] = acos(constants[0]); - computedConstants[161] = atan(constants[0]); - computedConstants[162] = asec(constants[0]); - computedConstants[163] = acsc(constants[0]); - computedConstants[164] = acot(constants[0]); - computedConstants[165] = asinh(constants[0]); - computedConstants[166] = acosh(constants[0]); - computedConstants[167] = atanh(constants[0]/2.0); - computedConstants[168] = asech(constants[0]); - computedConstants[169] = acsch(constants[0]); - computedConstants[170] = acoth(2.0*constants[0]); - computedConstants[171] = piecewise(constants[0] > constants[1], constants[0], NAN); - computedConstants[172] = piecewise(constants[0] > constants[1], constants[0], constants[2]); - computedConstants[173] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], NAN))); - computedConstants[174] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], constants[6]))); - computedConstants[175] = 123.0+piecewise(constants[0] > constants[1], constants[0], NAN); - computedConstants[180] = constants[0]; - computedConstants[187] = (constants[0] && constants[1])+piecewise(constants[2] > constants[3], constants[1], NAN)+constants[4]+(constants[5] && constants[6]); - computedConstants[188] = (constants[0] && constants[1])-(piecewise(constants[2] > constants[3], constants[1], NAN)-(constants[4]-piecewise(constants[2] > constants[3], constants[1], NAN)))-(constants[5] && constants[6]); - computedConstants[189] = (constants[0] && constants[1])*piecewise(constants[2] > constants[3], constants[1], NAN)*constants[4]*piecewise(constants[2] > constants[3], constants[1], NAN)*(constants[5] && constants[6]); - computedConstants[190] = (constants[0] && constants[1])/(piecewise(constants[2] > constants[3], constants[1], NAN)/(constants[4]/piecewise(constants[2] > constants[3], constants[1], NAN))); - computedConstants[191] = (constants[0] || constants[1]) && (constants[0]^constants[1]) && piecewise(constants[2] > constants[3], constants[1], NAN) && constants[4] && piecewise(constants[2] > constants[3], constants[1], NAN) && (constants[0]^constants[1]) && (constants[0] || constants[1]); - computedConstants[192] = (constants[0] && constants[1]) || (constants[0]^constants[1]) || piecewise(constants[2] > constants[3], constants[1], NAN) || constants[4] || piecewise(constants[2] > constants[3], constants[1], NAN) || (constants[0]^constants[1]) || (constants[0] && constants[1]); - computedConstants[193] = (constants[0] && constants[1])^(constants[0] || constants[1])^piecewise(constants[2] > constants[3], constants[1], NAN)^constants[4]^piecewise(constants[2] > constants[3], constants[1], NAN)^(constants[0] || constants[1])^(constants[0] && constants[1]); - computedConstants[194] = (constants[0] && constants[1])^^(piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[4]^^piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[0] && constants[1]))); - computedConstants[195] = (constants[0] && constants[1])^^(1.0/(piecewise(constants[2] > constants[3], constants[1], NAN)^^(1.0/constants[4])))^^(1.0/piecewise(constants[2] > constants[3], constants[1], NAN))^^(1.0/(constants[0] && constants[1])); - computedConstants[196] = -(constants[0] && constants[1])+-piecewise(constants[2] > constants[3], constants[1], NAN); + computedConstants[137] = log(constants[0])/log(constants[1]); + computedConstants[138] = ceil(constants[0]); + computedConstants[139] = floor(constants[0]); + computedConstants[140] = fmin(constants[0], constants[1]); + computedConstants[141] = fmin(constants[0], fmin(constants[1], constants[2])); + computedConstants[142] = fmax(constants[0], constants[1]); + computedConstants[143] = fmax(constants[0], fmax(constants[1], constants[2])); + computedConstants[144] = fmod(constants[0], constants[1]); + computedConstants[145] = sin(constants[0]); + computedConstants[146] = cos(constants[0]); + computedConstants[147] = tan(constants[0]); + computedConstants[148] = sec(constants[0]); + computedConstants[149] = csc(constants[0]); + computedConstants[150] = cot(constants[0]); + computedConstants[151] = sinh(constants[0]); + computedConstants[152] = cosh(constants[0]); + computedConstants[153] = tanh(constants[0]); + computedConstants[154] = sech(constants[0]); + computedConstants[155] = csch(constants[0]); + computedConstants[156] = coth(constants[0]); + computedConstants[157] = asin(constants[0]); + computedConstants[158] = acos(constants[0]); + computedConstants[159] = atan(constants[0]); + computedConstants[160] = asec(constants[0]); + computedConstants[161] = acsc(constants[0]); + computedConstants[162] = acot(constants[0]); + computedConstants[163] = asinh(constants[0]); + computedConstants[164] = acosh(constants[0]); + computedConstants[165] = atanh(constants[0]/2.0); + computedConstants[166] = asech(constants[0]); + computedConstants[167] = acsch(constants[0]); + computedConstants[168] = acoth(2.0*constants[0]); + computedConstants[170] = piecewise(constants[0] > constants[1], constants[0], NAN); + computedConstants[171] = piecewise(constants[0] < constants[1], constants[0], NAN); + computedConstants[172] = constants[0]; + computedConstants[173] = piecewise(constants[0] > constants[1], constants[0], constants[2]); + computedConstants[174] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], NAN))); + computedConstants[175] = piecewise(constants[0] < constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], NAN))); + computedConstants[176] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], constants[6]))); + computedConstants[177] = 123.0+piecewise(constants[0] > constants[1], constants[0], NAN); + computedConstants[178] = 123.0+piecewise(constants[0] < constants[1], constants[0], NAN); + computedConstants[183] = constants[0]; + computedConstants[190] = (constants[0] && constants[1])+piecewise(constants[2] > constants[3], constants[1], NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])+piecewise(constants[2] < constants[3], constants[1], NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[192] = (constants[0] && constants[1])-(piecewise(constants[2] > constants[3], constants[1], NAN)-(constants[4]-piecewise(constants[2] > constants[3], constants[1], NAN)))-(constants[5] && constants[6]); + computedConstants[193] = (constants[0] && constants[1])-(piecewise(constants[2] < constants[3], constants[1], NAN)-(constants[4]-piecewise(constants[2] < constants[3], constants[1], NAN)))-(constants[5] && constants[6]); + computedConstants[194] = (constants[0] && constants[1])*piecewise(constants[2] > constants[3], constants[1], NAN)*constants[4]*piecewise(constants[2] > constants[3], constants[1], NAN)*(constants[5] && constants[6]); + computedConstants[195] = (constants[0] && constants[1])*piecewise(constants[2] < constants[3], constants[1], NAN)*constants[4]*piecewise(constants[2] < constants[3], constants[1], NAN)*(constants[5] && constants[6]); + computedConstants[196] = (constants[0] && constants[1])/(piecewise(constants[2] > constants[3], constants[1], NAN)/(constants[4]/piecewise(constants[2] > constants[3], constants[1], NAN))); + computedConstants[197] = (constants[0] && constants[1])/(piecewise(constants[2] < constants[3], constants[1], NAN)/(constants[4]/piecewise(constants[2] < constants[3], constants[1], NAN))); + computedConstants[198] = (constants[0] || constants[1]) && (constants[0]^constants[1]) && piecewise(constants[2] > constants[3], constants[1], NAN) && constants[4] && piecewise(constants[2] > constants[3], constants[1], NAN) && (constants[0]^constants[1]) && (constants[0] || constants[1]); + computedConstants[199] = (constants[0] && constants[1]) || (constants[0]^constants[1]) || piecewise(constants[2] > constants[3], constants[1], NAN) || constants[4] || piecewise(constants[2] > constants[3], constants[1], NAN) || (constants[0]^constants[1]) || (constants[0] && constants[1]); + computedConstants[200] = (constants[0] && constants[1])^(constants[0] || constants[1])^piecewise(constants[2] > constants[3], constants[1], NAN)^constants[4]^piecewise(constants[2] > constants[3], constants[1], NAN)^(constants[0] || constants[1])^(constants[0] && constants[1]); + computedConstants[201] = (constants[0] && constants[1])^^(piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[4]^^piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[0] && constants[1]))); + computedConstants[202] = (constants[0] && constants[1])^^(1.0/(piecewise(constants[2] > constants[3], constants[1], NAN)^^(1.0/constants[4])))^^(1.0/piecewise(constants[2] > constants[3], constants[1], NAN))^^(1.0/(constants[0] && constants[1])); + computedConstants[203] = -(constants[0] && constants[1])+-piecewise(constants[2] > constants[3], constants[1], NAN); + computedConstants[204] = -(constants[0] && constants[1])+-piecewise(constants[2] < constants[3], constants[1], NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) diff --git a/tests/resources/coverage/generator/model.py b/tests/resources/coverage/generator/model.py index d8a33ebfb8..acff4123de 100644 --- a/tests/resources/coverage/generator/model.py +++ b/tests/resources/coverage/generator/model.py @@ -9,8 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 7 -COMPUTED_CONSTANT_COUNT = 199 -ALGEBRAIC_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 207 +ALGEBRAIC_COUNT = 5 EXTERNAL_COUNT = 1 VOI_INFO = {"name": "t", "units": "second", "component": "my_component"} @@ -58,8 +58,6 @@ {"name": "eqnAndParenthesesRightPower", "units": "dimensionless", "component": "my_component"}, {"name": "eqnAndParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnAndCoverageParentheses", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnOr", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnOrMultiple", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component"}, @@ -89,7 +87,6 @@ {"name": "eqnXorParenthesesRightMinusWithout", "units": "dimensionless", "component": "my_component"}, {"name": "eqnXorParenthesesRightPower", "units": "dimensionless", "component": "my_component"}, {"name": "eqnXorParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnXorCoverageParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPlusMultiple", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPlusParentheses", "units": "dimensionless", "component": "my_component"}, @@ -146,6 +143,7 @@ {"name": "eqnPowerParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootSqrt", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootSqrtOther", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnRootSqr", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootCube", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootCi", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootParentheses", "units": "dimensionless", "component": "my_component"}, @@ -201,11 +199,16 @@ {"name": "eqnArcsech", "units": "dimensionless", "component": "my_component"}, {"name": "eqnArccsch", "units": "dimensionless", "component": "my_component"}, {"name": "eqnArccoth", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewisePiece2", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewiseOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewisePiecePiecePiece2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnWithPiecewise2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnIntegerWithExponent", "units": "dimensionless", "component": "my_component"}, @@ -218,20 +221,28 @@ {"name": "eqnInfinity", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNotanumber", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForPlusOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForPlusOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForMinusOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForMinusOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForTimesOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForTimesOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForDivideOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForDivideOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForAndOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForOrOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForXorOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForMinusUnary2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component"}, {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component"} ] ALGEBRAIC_INFO = [ + {"name": "eqnOr", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnOrMultiple", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnXorCoverageParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component"} ] @@ -326,21 +337,15 @@ def acot(x): def asech(x): - one_over_x = 1.0/x - - return log(one_over_x+sqrt(one_over_x*one_over_x-1.0)) + return acosh(1.0/x) def acsch(x): - one_over_x = 1.0/x - - return log(one_over_x+sqrt(one_over_x*one_over_x+1.0)) + return asinh(1.0/x) def acoth(x): - one_over_x = 1.0/x - - return 0.5*log((1.0+one_over_x)/(1.0-one_over_x)) + return atanh(1.0/x) def create_states_array(): @@ -375,23 +380,23 @@ def objective_function_0(u, f, data): algebraic = data[5] externals = data[6] - algebraic[0] = u[0] - algebraic[1] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0 - f[1] = algebraic[0]-algebraic[1]-(computed_constants[197]+computed_constants[198]) + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0 + f[1] = algebraic[3]-algebraic[4]-(computed_constants[205]+computed_constants[206]) def find_root_0(voi, states, rates, constants, computed_constants, algebraic, externals): u = [nan]*2 - u[0] = algebraic[0] - u[1] = algebraic[1] + u[0] = algebraic[3] + u[1] = algebraic[4] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, constants, computed_constants, algebraic, externals]) - algebraic[0] = u[0] - algebraic[1] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] def initialise_variables(states, rates, constants, computed_constants, algebraic): @@ -403,20 +408,21 @@ def initialise_variables(states, rates, constants, computed_constants, algebraic constants[4] = 5.0 constants[5] = 6.0 constants[6] = 7.0 - computed_constants[176] = 123.0 - computed_constants[177] = 123.456789 - computed_constants[178] = 123.0e99 - computed_constants[179] = 123.456789e99 - computed_constants[181] = 1.0 - computed_constants[182] = 0.0 - computed_constants[183] = 2.71828182845905 - computed_constants[184] = 3.14159265358979 - computed_constants[185] = inf - computed_constants[186] = nan - computed_constants[197] = 1.0 - computed_constants[198] = 3.0 - algebraic[0] = 1.0 - algebraic[1] = 2.0 + computed_constants[169] = nan + computed_constants[179] = 123.0 + computed_constants[180] = 123.456789 + computed_constants[181] = 123.0e99 + computed_constants[182] = 123.456789e99 + computed_constants[184] = 1.0 + computed_constants[185] = 0.0 + computed_constants[186] = 2.71828182845905 + computed_constants[187] = 3.14159265358979 + computed_constants[188] = inf + computed_constants[189] = nan + computed_constants[205] = 1.0 + computed_constants[206] = 3.0 + algebraic[3] = 1.0 + algebraic[4] = 2.0 def compute_computed_constants(constants, computed_constants): @@ -429,9 +435,9 @@ def compute_computed_constants(constants, computed_constants): computed_constants[6] = leq_func(constants[0], constants[1]) computed_constants[7] = constants[0]/leq_func(constants[1], constants[2]) computed_constants[8] = gt_func(constants[0], constants[1]) - computed_constants[9] = constants[0]/gt_func(constants[1], constants[2]) + computed_constants[9] = constants[0]/gt_func(constants[2], constants[1]) computed_constants[10] = geq_func(constants[0], constants[1]) - computed_constants[11] = constants[0]/geq_func(constants[1], constants[2]) + computed_constants[11] = constants[0]/geq_func(constants[2], constants[1]) computed_constants[12] = and_func(constants[0], constants[1]) computed_constants[13] = and_func(constants[0], and_func(constants[1], constants[2])) computed_constants[14] = and_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) @@ -448,165 +454,172 @@ def compute_computed_constants(constants, computed_constants): computed_constants[25] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) computed_constants[26] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) computed_constants[27] = constants[0]/and_func(constants[1], constants[2]) - computed_constants[28] = or_func(constants[0], constants[1]) - computed_constants[29] = or_func(constants[0], or_func(constants[1], constants[2])) - computed_constants[30] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[31] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) - computed_constants[32] = or_func(constants[0], gt_func(constants[1], constants[2])) - computed_constants[33] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) - computed_constants[34] = or_func(-constants[0], gt_func(constants[1], constants[2])) - computed_constants[35] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[36] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) - computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[38] = or_func(lt_func(constants[0], constants[1]), constants[2]) - computed_constants[39] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[40] = or_func(lt_func(constants[0], constants[1]), -constants[2]) - computed_constants[41] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[42] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[43] = constants[0]/or_func(constants[1], constants[2]) - computed_constants[44] = xor_func(constants[0], constants[1]) - computed_constants[45] = xor_func(constants[0], xor_func(constants[1], constants[2])) - computed_constants[46] = xor_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[47] = xor_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) - computed_constants[48] = xor_func(constants[0], gt_func(constants[1], constants[2])) - computed_constants[49] = xor_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) - computed_constants[50] = xor_func(-constants[0], gt_func(constants[1], constants[2])) - computed_constants[51] = xor_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[52] = xor_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) - computed_constants[53] = xor_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[54] = xor_func(lt_func(constants[0], constants[1]), constants[2]) - computed_constants[55] = xor_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[56] = xor_func(lt_func(constants[0], constants[1]), -constants[2]) - computed_constants[57] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[58] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[59] = constants[0]/xor_func(constants[1], constants[2]) - computed_constants[60] = not_func(constants[0]) - computed_constants[61] = constants[0]+constants[1]+constants[2] - computed_constants[62] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) - computed_constants[63] = constants[0] - computed_constants[64] = constants[0]-constants[1] - computed_constants[65] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) - computed_constants[66] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) - computed_constants[67] = lt_func(constants[0], constants[1])-constants[2] - computed_constants[68] = constants[0]-(-constants[1]) - computed_constants[69] = constants[0]-(-constants[1]*constants[2]) - computed_constants[70] = -constants[0] - computed_constants[71] = -lt_func(constants[0], constants[1]) - computed_constants[72] = constants[0]*constants[1] - computed_constants[73] = constants[0]*constants[1]*constants[2] - computed_constants[74] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) - computed_constants[75] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) - computed_constants[76] = constants[0]*gt_func(constants[1], constants[2]) - computed_constants[77] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) - computed_constants[78] = -constants[0]*gt_func(constants[1], constants[2]) - computed_constants[79] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) - computed_constants[80] = lt_func(constants[0], constants[1])*constants[2] - computed_constants[81] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) - computed_constants[82] = lt_func(constants[0], constants[1])*-constants[2] - computed_constants[83] = constants[0]/constants[1] - computed_constants[84] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) - computed_constants[85] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) - computed_constants[86] = constants[0]/gt_func(constants[2], constants[1]) - computed_constants[87] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) - computed_constants[88] = -constants[0]/gt_func(constants[2], constants[1]) - computed_constants[89] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) - computed_constants[90] = lt_func(constants[0], constants[1])/constants[2] - computed_constants[91] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) - computed_constants[92] = lt_func(constants[0], constants[1])/-constants[2] - computed_constants[93] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) - computed_constants[94] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) - computed_constants[95] = sqrt(constants[0]) - computed_constants[96] = pow(constants[0], 2.0) - computed_constants[97] = pow(constants[0], 3.0) - computed_constants[98] = pow(constants[0], constants[1]) - computed_constants[99] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) - computed_constants[100] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) - computed_constants[101] = pow(constants[0], geq_func(constants[1], constants[2])) - computed_constants[102] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) - computed_constants[103] = pow(-constants[0], geq_func(constants[1], constants[2])) - computed_constants[104] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) - computed_constants[105] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) - computed_constants[106] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]) - computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[109] = pow(leq_func(constants[0], constants[1]), -constants[2]) - computed_constants[110] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) - computed_constants[111] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) - computed_constants[112] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[113] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[114] = sqrt(constants[0]) - computed_constants[115] = sqrt(constants[0]) - computed_constants[116] = pow(constants[0], 1.0/3.0) - computed_constants[117] = pow(constants[0], 1.0/constants[1]) - computed_constants[118] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) - computed_constants[119] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[120] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) - computed_constants[121] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[122] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) - computed_constants[123] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[124] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[125] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) - computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) - computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) - computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) - computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) - computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) - computed_constants[131] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) - computed_constants[132] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) - computed_constants[133] = fabs(constants[0]) - computed_constants[134] = exp(constants[0]) - computed_constants[135] = log(constants[0]) + computed_constants[28] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[29] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[30] = or_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[31] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[32] = or_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[33] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[34] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[35] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[36] = or_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[38] = or_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[39] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[40] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[41] = constants[0]/or_func(constants[1], constants[2]) + computed_constants[42] = xor_func(constants[0], constants[1]) + computed_constants[43] = xor_func(constants[0], xor_func(constants[1], constants[2])) + computed_constants[44] = xor_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[45] = xor_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[46] = xor_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[47] = xor_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[48] = xor_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[49] = xor_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[50] = xor_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[51] = xor_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[52] = xor_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[53] = xor_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[54] = xor_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[55] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[56] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[57] = not_func(constants[0]) + computed_constants[58] = constants[0]+constants[1]+constants[2] + computed_constants[59] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) + computed_constants[60] = constants[0] + computed_constants[61] = constants[0]-constants[1] + computed_constants[62] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) + computed_constants[63] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) + computed_constants[64] = lt_func(constants[0], constants[1])-constants[2] + computed_constants[65] = constants[0]-(-constants[1]) + computed_constants[66] = constants[0]-(-constants[1]*constants[2]) + computed_constants[67] = -constants[0] + computed_constants[68] = -lt_func(constants[0], constants[1]) + computed_constants[69] = constants[0]*constants[1] + computed_constants[70] = constants[0]*constants[1]*constants[2] + computed_constants[71] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) + computed_constants[72] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) + computed_constants[73] = constants[0]*gt_func(constants[1], constants[2]) + computed_constants[74] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) + computed_constants[75] = -constants[0]*gt_func(constants[1], constants[2]) + computed_constants[76] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) + computed_constants[77] = lt_func(constants[0], constants[1])*constants[2] + computed_constants[78] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) + computed_constants[79] = lt_func(constants[0], constants[1])*-constants[2] + computed_constants[80] = constants[0]/constants[1] + computed_constants[81] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) + computed_constants[82] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) + computed_constants[83] = constants[0]/gt_func(constants[2], constants[1]) + computed_constants[84] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) + computed_constants[85] = -constants[0]/gt_func(constants[2], constants[1]) + computed_constants[86] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) + computed_constants[87] = lt_func(constants[0], constants[1])/constants[2] + computed_constants[88] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) + computed_constants[89] = lt_func(constants[0], constants[1])/-constants[2] + computed_constants[90] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) + computed_constants[91] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) + computed_constants[92] = sqrt(constants[0]) + computed_constants[93] = pow(constants[0], 2.0) + computed_constants[94] = pow(constants[0], 3.0) + computed_constants[95] = pow(constants[0], constants[1]) + computed_constants[96] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) + computed_constants[97] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) + computed_constants[98] = pow(constants[0], geq_func(constants[1], constants[2])) + computed_constants[99] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) + computed_constants[100] = pow(-constants[0], geq_func(constants[1], constants[2])) + computed_constants[101] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) + computed_constants[102] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) + computed_constants[103] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[104] = pow(leq_func(constants[0], constants[1]), constants[2]) + computed_constants[105] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[106] = pow(leq_func(constants[0], constants[1]), -constants[2]) + computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) + computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) + computed_constants[109] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[110] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[111] = sqrt(constants[0]) + computed_constants[112] = sqrt(constants[0]) + computed_constants[113] = pow(constants[0], 1.0/0.5) + computed_constants[114] = pow(constants[0], 1.0/3.0) + computed_constants[115] = pow(constants[0], 1.0/constants[1]) + computed_constants[116] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) + computed_constants[117] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[118] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[119] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[120] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[121] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[122] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[123] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) + computed_constants[124] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) + computed_constants[125] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) + computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) + computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) + computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) + computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) + computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) + computed_constants[131] = fabs(constants[0]) + computed_constants[132] = exp(constants[0]) + computed_constants[133] = log(constants[0]) + computed_constants[134] = log10(constants[0]) + computed_constants[135] = log(constants[0])/log(2.0) computed_constants[136] = log10(constants[0]) - computed_constants[137] = log(constants[0])/log(2.0) - computed_constants[138] = log10(constants[0]) - computed_constants[139] = log(constants[0])/log(constants[1]) - computed_constants[140] = ceil(constants[0]) - computed_constants[141] = floor(constants[0]) - computed_constants[142] = min(constants[0], constants[1]) - computed_constants[143] = min(constants[0], min(constants[1], constants[2])) - computed_constants[144] = max(constants[0], constants[1]) - computed_constants[145] = max(constants[0], max(constants[1], constants[2])) - computed_constants[146] = fmod(constants[0], constants[1]) - computed_constants[147] = sin(constants[0]) - computed_constants[148] = cos(constants[0]) - computed_constants[149] = tan(constants[0]) - computed_constants[150] = sec(constants[0]) - computed_constants[151] = csc(constants[0]) - computed_constants[152] = cot(constants[0]) - computed_constants[153] = sinh(constants[0]) - computed_constants[154] = cosh(constants[0]) - computed_constants[155] = tanh(constants[0]) - computed_constants[156] = sech(constants[0]) - computed_constants[157] = csch(constants[0]) - computed_constants[158] = coth(constants[0]) - computed_constants[159] = asin(constants[0]) - computed_constants[160] = acos(constants[0]) - computed_constants[161] = atan(constants[0]) - computed_constants[162] = asec(constants[0]) - computed_constants[163] = acsc(constants[0]) - computed_constants[164] = acot(constants[0]) - computed_constants[165] = asinh(constants[0]) - computed_constants[166] = acosh(constants[0]) - computed_constants[167] = atanh(constants[0]/2.0) - computed_constants[168] = asech(constants[0]) - computed_constants[169] = acsch(constants[0]) - computed_constants[170] = acoth(2.0*constants[0]) - computed_constants[171] = constants[0] if gt_func(constants[0], constants[1]) else nan - computed_constants[172] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] - computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan - computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] - computed_constants[175] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) - computed_constants[180] = constants[0] - computed_constants[187] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) - computed_constants[188] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) - computed_constants[189] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) - computed_constants[190] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) - computed_constants[191] = and_func(or_func(constants[0], constants[1]), and_func(xor_func(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), or_func(constants[0], constants[1]))))) - computed_constants[192] = or_func(and_func(constants[0], constants[1]), or_func(xor_func(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) - computed_constants[193] = xor_func(and_func(constants[0], constants[1]), xor_func(or_func(constants[0], constants[1]), xor_func(constants[1] if gt_func(constants[2], constants[3]) else nan, xor_func(xor_func(xor_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) - computed_constants[194] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) - computed_constants[195] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) - computed_constants[196] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) + computed_constants[137] = log(constants[0])/log(constants[1]) + computed_constants[138] = ceil(constants[0]) + computed_constants[139] = floor(constants[0]) + computed_constants[140] = min(constants[0], constants[1]) + computed_constants[141] = min(constants[0], min(constants[1], constants[2])) + computed_constants[142] = max(constants[0], constants[1]) + computed_constants[143] = max(constants[0], max(constants[1], constants[2])) + computed_constants[144] = fmod(constants[0], constants[1]) + computed_constants[145] = sin(constants[0]) + computed_constants[146] = cos(constants[0]) + computed_constants[147] = tan(constants[0]) + computed_constants[148] = sec(constants[0]) + computed_constants[149] = csc(constants[0]) + computed_constants[150] = cot(constants[0]) + computed_constants[151] = sinh(constants[0]) + computed_constants[152] = cosh(constants[0]) + computed_constants[153] = tanh(constants[0]) + computed_constants[154] = sech(constants[0]) + computed_constants[155] = csch(constants[0]) + computed_constants[156] = coth(constants[0]) + computed_constants[157] = asin(constants[0]) + computed_constants[158] = acos(constants[0]) + computed_constants[159] = atan(constants[0]) + computed_constants[160] = asec(constants[0]) + computed_constants[161] = acsc(constants[0]) + computed_constants[162] = acot(constants[0]) + computed_constants[163] = asinh(constants[0]) + computed_constants[164] = acosh(constants[0]) + computed_constants[165] = atanh(constants[0]/2.0) + computed_constants[166] = asech(constants[0]) + computed_constants[167] = acsch(constants[0]) + computed_constants[168] = acoth(2.0*constants[0]) + computed_constants[170] = constants[0] if gt_func(constants[0], constants[1]) else nan + computed_constants[171] = constants[0] if lt_func(constants[0], constants[1]) else nan + computed_constants[172] = constants[0] + computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] + computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[175] = constants[0] if lt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[176] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] + computed_constants[177] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) + computed_constants[178] = 123.0+(constants[0] if lt_func(constants[0], constants[1]) else nan) + computed_constants[183] = constants[0] + computed_constants[190] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[191] = and_func(constants[0], constants[1])+(constants[1] if lt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[192] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[193] = and_func(constants[0], constants[1])-((constants[1] if lt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if lt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[194] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[195] = and_func(constants[0], constants[1])*(constants[1] if lt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if lt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[196] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) + computed_constants[197] = and_func(constants[0], constants[1])/((constants[1] if lt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if lt_func(constants[2], constants[3]) else nan))) + computed_constants[198] = and_func(or_func(constants[0], constants[1]), and_func(xor_func(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), or_func(constants[0], constants[1]))))) + computed_constants[199] = or_func(and_func(constants[0], constants[1]), or_func(xor_func(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[200] = xor_func(and_func(constants[0], constants[1]), xor_func(or_func(constants[0], constants[1]), xor_func(constants[1] if gt_func(constants[2], constants[3]) else nan, xor_func(xor_func(xor_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[201] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) + computed_constants[202] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) + computed_constants[203] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) + computed_constants[204] = -and_func(constants[0], constants[1])+-(constants[1] if lt_func(constants[2], constants[3]) else nan) def compute_rates(voi, states, rates, constants, computed_constants, algebraic, externals, external_variable): @@ -614,5 +627,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, externals, external_variable): + algebraic[0] = or_func(states[0], states[0]) + algebraic[1] = or_func(states[0], or_func(states[0], constants[0])) + algebraic[2] = constants[0]/xor_func(constants[1], states[0]) externals[0] = external_variable(voi, states, rates, constants, computed_constants, algebraic, externals, 0) find_root_0(voi, states, rates, constants, computed_constants, algebraic, externals) diff --git a/tests/resources/coverage/generator/model.modified.profile.c b/tests/resources/coverage/generator/model.xor.c similarity index 65% rename from tests/resources/coverage/generator/model.modified.profile.c rename to tests/resources/coverage/generator/model.xor.c index 6bbe6f4075..9861b1a292 100644 --- a/tests/resources/coverage/generator/model.modified.profile.c +++ b/tests/resources/coverage/generator/model.xor.c @@ -10,8 +10,8 @@ const char LIBCELLML_VERSION[] = "0.6.0"; const size_t STATE_COUNT = 1; const size_t CONSTANT_COUNT = 7; -const size_t COMPUTED_CONSTANT_COUNT = 199; -const size_t ALGEBRAIC_COUNT = 2; +const size_t COMPUTED_CONSTANT_COUNT = 207; +const size_t ALGEBRAIC_COUNT = 5; const size_t EXTERNAL_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "my_component"}; @@ -59,8 +59,6 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnAndParenthesesRightPower", "dimensionless", "my_component"}, {"eqnAndParenthesesRightRoot", "dimensionless", "my_component"}, {"eqnAndCoverageParentheses", "dimensionless", "my_component"}, - {"eqnOr", "dimensionless", "my_component"}, - {"eqnOrMultiple", "dimensionless", "my_component"}, {"eqnOrParentheses", "dimensionless", "my_component"}, {"eqnOrParenthesesLeftPlusWith", "dimensionless", "my_component"}, {"eqnOrParenthesesLeftPlusWithout", "dimensionless", "my_component"}, @@ -90,7 +88,6 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnXorParenthesesRightMinusWithout", "dimensionless", "my_component"}, {"eqnXorParenthesesRightPower", "dimensionless", "my_component"}, {"eqnXorParenthesesRightRoot", "dimensionless", "my_component"}, - {"eqnXorCoverageParentheses", "dimensionless", "my_component"}, {"eqnNot", "dimensionless", "my_component"}, {"eqnPlusMultiple", "dimensionless", "my_component"}, {"eqnPlusParentheses", "dimensionless", "my_component"}, @@ -147,6 +144,7 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnPowerParenthesesRightRoot", "dimensionless", "my_component"}, {"eqnRootSqrt", "dimensionless", "my_component"}, {"eqnRootSqrtOther", "dimensionless", "my_component"}, + {"eqnRootSqr", "dimensionless", "my_component"}, {"eqnRootCube", "dimensionless", "my_component"}, {"eqnRootCi", "dimensionless", "my_component"}, {"eqnRootParentheses", "dimensionless", "my_component"}, @@ -202,11 +200,16 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnArcsech", "dimensionless", "my_component"}, {"eqnArccsch", "dimensionless", "my_component"}, {"eqnArccoth", "dimensionless", "my_component"}, + {"eqnPiecewise", "dimensionless", "my_component"}, {"eqnPiecewisePiece", "dimensionless", "my_component"}, + {"eqnPiecewisePiece2", "dimensionless", "my_component"}, + {"eqnPiecewiseOtherwise", "dimensionless", "my_component"}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component"}, {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component"}, + {"eqnPiecewisePiecePiecePiece2", "dimensionless", "my_component"}, {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component"}, {"eqnWithPiecewise", "dimensionless", "my_component"}, + {"eqnWithPiecewise2", "dimensionless", "my_component"}, {"eqnCnInteger", "dimensionless", "my_component"}, {"eqnCnDouble", "dimensionless", "my_component"}, {"eqnCnIntegerWithExponent", "dimensionless", "my_component"}, @@ -219,20 +222,28 @@ const VariableInfo COMPUTED_CONSTANT_INFO[] = { {"eqnInfinity", "dimensionless", "my_component"}, {"eqnNotanumber", "dimensionless", "my_component"}, {"eqnCoverageForPlusOperator", "dimensionless", "my_component"}, + {"eqnCoverageForPlusOperator2", "dimensionless", "my_component"}, {"eqnCoverageForMinusOperator", "dimensionless", "my_component"}, + {"eqnCoverageForMinusOperator2", "dimensionless", "my_component"}, {"eqnCoverageForTimesOperator", "dimensionless", "my_component"}, + {"eqnCoverageForTimesOperator2", "dimensionless", "my_component"}, {"eqnCoverageForDivideOperator", "dimensionless", "my_component"}, + {"eqnCoverageForDivideOperator2", "dimensionless", "my_component"}, {"eqnCoverageForAndOperator", "dimensionless", "my_component"}, {"eqnCoverageForOrOperator", "dimensionless", "my_component"}, {"eqnCoverageForXorOperator", "dimensionless", "my_component"}, {"eqnCoverageForPowerOperator", "dimensionless", "my_component"}, {"eqnCoverageForRootOperator", "dimensionless", "my_component"}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component"}, + {"eqnCoverageForMinusUnary2", "dimensionless", "my_component"}, {"eqnComputedConstant1", "dimensionless", "my_component"}, {"eqnComputedConstant2", "dimensionless", "my_component"} }; const VariableInfo ALGEBRAIC_INFO[] = { + {"eqnOr", "dimensionless", "my_component"}, + {"eqnOrMultiple", "dimensionless", "my_component"}, + {"eqnXorCoverageParentheses", "dimensionless", "my_component"}, {"eqnNlaVariable1", "dimensionless", "my_component"}, {"eqnNlaVariable2", "dimensionless", "my_component"} }; @@ -241,21 +252,11 @@ const VariableInfo EXTERNAL_INFO[] = { {"eqnPlus", "dimensionless", "my_component"} }; -double xor(double x, double y) +double XOR(double x, double y) { return (x != 0.0) ^ (y != 0.0); } -double min(double x, double y) -{ - return (x < y)?x:y; -} - -double max(double x, double y) -{ - return (x > y)?x:y; -} - double sec(double x) { return 1.0/cos(x); @@ -303,26 +304,20 @@ double acot(double x) double asech(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX-1.0)); + return acosh(1.0/x); } double acsch(double x) { - double oneOverX = 1.0/x; - - return log(oneOverX+sqrt(oneOverX*oneOverX+1.0)); + return asinh(1.0/x); } double acoth(double x) { - double oneOverX = 1.0/x; - - return 0.5*log((1.0+oneOverX)/(1.0-oneOverX)); + return atanh(1.0/x); } -double * createStatesVector() +double * createStatesArray() { double *res = (double *) malloc(STATE_COUNT*sizeof(double)); @@ -405,11 +400,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *algebraic = ((RootFindingInfo *) data)->algebraic; double *externals = ((RootFindingInfo *) data)->externals; - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; - f[1] = algebraic[0]-algebraic[1]-(computedConstants[197]+computedConstants[198]); + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0; + f[1] = algebraic[3]-algebraic[4]-(computedConstants[205]+computedConstants[206]); } void findRoot0(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals) @@ -417,13 +412,13 @@ void findRoot0(double voi, double *states, double *rates, double *constants, dou RootFindingInfo rfi = { voi, states, rates, constants, computedConstants, algebraic, externals }; double u[2]; - u[0] = algebraic[0]; - u[1] = algebraic[1]; + u[0] = algebraic[3]; + u[1] = algebraic[4]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[0] = u[0]; - algebraic[1] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants, double *computedConstants, double *algebraic) @@ -436,20 +431,21 @@ void initialiseVariables(double *states, double *rates, double *constants, doubl constants[4] = 5.0; constants[5] = 6.0; constants[6] = 7.0; - computedConstants[176] = 123.0; - computedConstants[177] = 123.456789; - computedConstants[178] = 123.0e99; - computedConstants[179] = 123.456789e99; - computedConstants[181] = 1.0; - computedConstants[182] = 0.0; - computedConstants[183] = 2.71828182845905; - computedConstants[184] = 3.14159265358979; - computedConstants[185] = INFINITY; - computedConstants[186] = NAN; - computedConstants[197] = 1.0; - computedConstants[198] = 3.0; - algebraic[0] = 1.0; - algebraic[1] = 2.0; + computedConstants[169] = NAN; + computedConstants[179] = 123.0; + computedConstants[180] = 123.456789; + computedConstants[181] = 123.0e99; + computedConstants[182] = 123.456789e99; + computedConstants[184] = 1.0; + computedConstants[185] = 0.0; + computedConstants[186] = 2.71828182845905; + computedConstants[187] = 3.14159265358979; + computedConstants[188] = INFINITY; + computedConstants[189] = NAN; + computedConstants[205] = 1.0; + computedConstants[206] = 3.0; + algebraic[3] = 1.0; + algebraic[4] = 2.0; } void computeComputedConstants(double *constants, double *computedConstants) @@ -463,9 +459,9 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[6] = constants[0] <= constants[1]; computedConstants[7] = constants[0]/(constants[1] <= constants[2]); computedConstants[8] = constants[0] > constants[1]; - computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[9] = constants[0]/(constants[2] > constants[1]); computedConstants[10] = constants[0] >= constants[1]; - computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[11] = constants[0]/(constants[2] >= constants[1]); computedConstants[12] = constants[0] && constants[1]; computedConstants[13] = constants[0] && constants[1] && constants[2]; computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); @@ -482,165 +478,172 @@ void computeComputedConstants(double *constants, double *computedConstants) computedConstants[25] = (constants[0] < constants[1]) && pow(constants[2], constants[3]); computedConstants[26] = (constants[0] < constants[1]) && pow(constants[2], 1.0/constants[3]); computedConstants[27] = constants[0]/(constants[1] && constants[2]); - computedConstants[28] = constants[0] || constants[1]; - computedConstants[29] = constants[0] || constants[1] || constants[2]; - computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); - computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); - computedConstants[32] = constants[0] || (constants[1] > constants[2]); - computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); - computedConstants[34] = -constants[0] || (constants[1] > constants[2]); - computedConstants[35] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); - computedConstants[36] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); - computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); - computedConstants[38] = (constants[0] < constants[1]) || constants[2]; - computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); - computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; - computedConstants[41] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); - computedConstants[42] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); - computedConstants[43] = constants[0]/(constants[1] || constants[2]); - computedConstants[44] = xor(constants[0], constants[1]); - computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); - computedConstants[46] = xor(constants[0] < constants[1], constants[2] > constants[3]); - computedConstants[47] = xor(constants[0]+constants[1], constants[2] > constants[3]); - computedConstants[48] = xor(constants[0], constants[1] > constants[2]); - computedConstants[49] = xor(constants[0]-constants[1], constants[2] > constants[3]); - computedConstants[50] = xor(-constants[0], constants[1] > constants[2]); - computedConstants[51] = xor(pow(constants[0], constants[1]), constants[2] > constants[3]); - computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); - computedConstants[53] = xor(constants[0] < constants[1], constants[2]+constants[3]); - computedConstants[54] = xor(constants[0] < constants[1], constants[2]); - computedConstants[55] = xor(constants[0] < constants[1], constants[2]-constants[3]); - computedConstants[56] = xor(constants[0] < constants[1], -constants[2]); - computedConstants[57] = xor(constants[0] < constants[1], pow(constants[2], constants[3])); - computedConstants[58] = xor(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); - computedConstants[59] = constants[0]/xor(constants[1], constants[2]); - computedConstants[60] = !constants[0]; - computedConstants[61] = constants[0]+constants[1]+constants[2]; - computedConstants[62] = (constants[0] < constants[1])+(constants[2] > constants[3]); - computedConstants[63] = constants[0]; - computedConstants[64] = constants[0]-constants[1]; - computedConstants[65] = (constants[0] < constants[1])-(constants[2] > constants[3]); - computedConstants[66] = (constants[0] < constants[1])-(constants[2]+constants[3]); - computedConstants[67] = (constants[0] < constants[1])-constants[2]; - computedConstants[68] = constants[0]-(-constants[1]); - computedConstants[69] = constants[0]-(-constants[1]*constants[2]); - computedConstants[70] = -constants[0]; - computedConstants[71] = -(constants[0] < constants[1]); - computedConstants[72] = constants[0]*constants[1]; - computedConstants[73] = constants[0]*constants[1]*constants[2]; - computedConstants[74] = (constants[0] < constants[1])*(constants[2] > constants[3]); - computedConstants[75] = (constants[0]+constants[1])*(constants[2] > constants[3]); - computedConstants[76] = constants[0]*(constants[1] > constants[2]); - computedConstants[77] = (constants[0]-constants[1])*(constants[2] > constants[3]); - computedConstants[78] = -constants[0]*(constants[1] > constants[2]); - computedConstants[79] = (constants[0] < constants[1])*(constants[2]+constants[3]); - computedConstants[80] = (constants[0] < constants[1])*constants[2]; - computedConstants[81] = (constants[0] < constants[1])*(constants[2]-constants[3]); - computedConstants[82] = (constants[0] < constants[1])*-constants[2]; - computedConstants[83] = constants[0]/constants[1]; - computedConstants[84] = (constants[0] < constants[1])/(constants[3] > constants[2]); - computedConstants[85] = (constants[0]+constants[1])/(constants[3] > constants[2]); - computedConstants[86] = constants[0]/(constants[2] > constants[1]); - computedConstants[87] = (constants[0]-constants[1])/(constants[3] > constants[2]); - computedConstants[88] = -constants[0]/(constants[2] > constants[1]); - computedConstants[89] = (constants[0] < constants[1])/(constants[2]+constants[3]); - computedConstants[90] = (constants[0] < constants[1])/constants[2]; - computedConstants[91] = (constants[0] < constants[1])/(constants[2]-constants[3]); - computedConstants[92] = (constants[0] < constants[1])/-constants[2]; - computedConstants[93] = (constants[0] < constants[1])/(constants[2]*constants[3]); - computedConstants[94] = (constants[0] < constants[1])/(constants[2]/constants[3]); - computedConstants[95] = sqrt(constants[0]); - computedConstants[96] = pow(constants[0], 2.0); - computedConstants[97] = pow(constants[0], 3.0); - computedConstants[98] = pow(constants[0], constants[1]); - computedConstants[99] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); - computedConstants[100] = pow(constants[0]+constants[1], constants[2] >= constants[3]); - computedConstants[101] = pow(constants[0], constants[1] >= constants[2]); - computedConstants[102] = pow(constants[0]-constants[1], constants[2] >= constants[3]); - computedConstants[103] = pow(-constants[0], constants[1] >= constants[2]); - computedConstants[104] = pow(constants[0]*constants[1], constants[2] >= constants[3]); - computedConstants[105] = pow(constants[0]/constants[1], constants[2] >= constants[3]); - computedConstants[106] = pow(constants[0] <= constants[1], constants[2]+constants[3]); - computedConstants[107] = pow(constants[0] <= constants[1], constants[2]); - computedConstants[108] = pow(constants[0] <= constants[1], constants[2]-constants[3]); - computedConstants[109] = pow(constants[0] <= constants[1], -constants[2]); - computedConstants[110] = pow(constants[0] <= constants[1], constants[2]*constants[3]); - computedConstants[111] = pow(constants[0] <= constants[1], constants[2]/constants[3]); - computedConstants[112] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); - computedConstants[113] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); - computedConstants[114] = sqrt(constants[0]); - computedConstants[115] = sqrt(constants[0]); - computedConstants[116] = pow(constants[0], 1.0/3.0); - computedConstants[117] = pow(constants[0], 1.0/constants[1]); - computedConstants[118] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[119] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[120] = pow(constants[0], 1.0/(constants[2] > constants[1])); - computedConstants[121] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[122] = pow(-constants[0], 1.0/(constants[2] > constants[1])); - computedConstants[123] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[124] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); - computedConstants[125] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); - computedConstants[126] = pow(constants[0] < constants[1], 1.0/constants[2]); - computedConstants[127] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); - computedConstants[128] = pow(constants[0] < constants[1], 1.0/-constants[2]); - computedConstants[129] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); - computedConstants[130] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); - computedConstants[131] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); - computedConstants[132] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); - computedConstants[133] = fabs(constants[0]); - computedConstants[134] = exp(constants[0]); - computedConstants[135] = log(constants[0]); + computedConstants[28] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[29] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[30] = constants[0] || (constants[1] > constants[2]); + computedConstants[31] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = -constants[0] || (constants[1] > constants[2]); + computedConstants[33] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); + computedConstants[35] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[36] = (constants[0] < constants[1]) || constants[2]; + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); + computedConstants[41] = constants[0]/(constants[1] || constants[2]); + computedConstants[42] = XOR(constants[0], constants[1]); + computedConstants[43] = XOR(constants[0], XOR(constants[1], constants[2])); + computedConstants[44] = XOR(constants[0] < constants[1], constants[2] > constants[3]); + computedConstants[45] = XOR(constants[0]+constants[1], constants[2] > constants[3]); + computedConstants[46] = XOR(constants[0], constants[1] > constants[2]); + computedConstants[47] = XOR(constants[0]-constants[1], constants[2] > constants[3]); + computedConstants[48] = XOR(-constants[0], constants[1] > constants[2]); + computedConstants[49] = XOR(pow(constants[0], constants[1]), constants[2] > constants[3]); + computedConstants[50] = XOR(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); + computedConstants[51] = XOR(constants[0] < constants[1], constants[2]+constants[3]); + computedConstants[52] = XOR(constants[0] < constants[1], constants[2]); + computedConstants[53] = XOR(constants[0] < constants[1], constants[2]-constants[3]); + computedConstants[54] = XOR(constants[0] < constants[1], -constants[2]); + computedConstants[55] = XOR(constants[0] < constants[1], pow(constants[2], constants[3])); + computedConstants[56] = XOR(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[57] = !constants[0]; + computedConstants[58] = constants[0]+constants[1]+constants[2]; + computedConstants[59] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[60] = constants[0]; + computedConstants[61] = constants[0]-constants[1]; + computedConstants[62] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[63] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[64] = (constants[0] < constants[1])-constants[2]; + computedConstants[65] = constants[0]-(-constants[1]); + computedConstants[66] = constants[0]-(-constants[1]*constants[2]); + computedConstants[67] = -constants[0]; + computedConstants[68] = -(constants[0] < constants[1]); + computedConstants[69] = constants[0]*constants[1]; + computedConstants[70] = constants[0]*constants[1]*constants[2]; + computedConstants[71] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[72] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[73] = constants[0]*(constants[1] > constants[2]); + computedConstants[74] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[75] = -constants[0]*(constants[1] > constants[2]); + computedConstants[76] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[77] = (constants[0] < constants[1])*constants[2]; + computedConstants[78] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[79] = (constants[0] < constants[1])*-constants[2]; + computedConstants[80] = constants[0]/constants[1]; + computedConstants[81] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[82] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[83] = constants[0]/(constants[2] > constants[1]); + computedConstants[84] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[85] = -constants[0]/(constants[2] > constants[1]); + computedConstants[86] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[87] = (constants[0] < constants[1])/constants[2]; + computedConstants[88] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[89] = (constants[0] < constants[1])/-constants[2]; + computedConstants[90] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[91] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[92] = sqrt(constants[0]); + computedConstants[93] = pow(constants[0], 2.0); + computedConstants[94] = pow(constants[0], 3.0); + computedConstants[95] = pow(constants[0], constants[1]); + computedConstants[96] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); + computedConstants[97] = pow(constants[0]+constants[1], constants[2] >= constants[3]); + computedConstants[98] = pow(constants[0], constants[1] >= constants[2]); + computedConstants[99] = pow(constants[0]-constants[1], constants[2] >= constants[3]); + computedConstants[100] = pow(-constants[0], constants[1] >= constants[2]); + computedConstants[101] = pow(constants[0]*constants[1], constants[2] >= constants[3]); + computedConstants[102] = pow(constants[0]/constants[1], constants[2] >= constants[3]); + computedConstants[103] = pow(constants[0] <= constants[1], constants[2]+constants[3]); + computedConstants[104] = pow(constants[0] <= constants[1], constants[2]); + computedConstants[105] = pow(constants[0] <= constants[1], constants[2]-constants[3]); + computedConstants[106] = pow(constants[0] <= constants[1], -constants[2]); + computedConstants[107] = pow(constants[0] <= constants[1], constants[2]*constants[3]); + computedConstants[108] = pow(constants[0] <= constants[1], constants[2]/constants[3]); + computedConstants[109] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); + computedConstants[110] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[111] = sqrt(constants[0]); + computedConstants[112] = sqrt(constants[0]); + computedConstants[113] = pow(constants[0], 1.0/0.5); + computedConstants[114] = pow(constants[0], 1.0/3.0); + computedConstants[115] = pow(constants[0], 1.0/constants[1]); + computedConstants[116] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[117] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[118] = pow(constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[119] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[120] = pow(-constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[121] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[122] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[123] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); + computedConstants[124] = pow(constants[0] < constants[1], 1.0/constants[2]); + computedConstants[125] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); + computedConstants[126] = pow(constants[0] < constants[1], 1.0/-constants[2]); + computedConstants[127] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); + computedConstants[128] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); + computedConstants[129] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); + computedConstants[130] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[131] = fabs(constants[0]); + computedConstants[132] = exp(constants[0]); + computedConstants[133] = log(constants[0]); + computedConstants[134] = log10(constants[0]); + computedConstants[135] = log(constants[0])/log(2.0); computedConstants[136] = log10(constants[0]); - computedConstants[137] = log(constants[0])/log(2.0); - computedConstants[138] = log10(constants[0]); - computedConstants[139] = log(constants[0])/log(constants[1]); - computedConstants[140] = ceil(constants[0]); - computedConstants[141] = floor(constants[0]); - computedConstants[142] = min(constants[0], constants[1]); - computedConstants[143] = min(constants[0], min(constants[1], constants[2])); - computedConstants[144] = max(constants[0], constants[1]); - computedConstants[145] = max(constants[0], max(constants[1], constants[2])); - computedConstants[146] = fmod(constants[0], constants[1]); - computedConstants[147] = sin(constants[0]); - computedConstants[148] = cos(constants[0]); - computedConstants[149] = tan(constants[0]); - computedConstants[150] = sec(constants[0]); - computedConstants[151] = csc(constants[0]); - computedConstants[152] = cot(constants[0]); - computedConstants[153] = sinh(constants[0]); - computedConstants[154] = cosh(constants[0]); - computedConstants[155] = tanh(constants[0]); - computedConstants[156] = sech(constants[0]); - computedConstants[157] = csch(constants[0]); - computedConstants[158] = coth(constants[0]); - computedConstants[159] = asin(constants[0]); - computedConstants[160] = acos(constants[0]); - computedConstants[161] = atan(constants[0]); - computedConstants[162] = asec(constants[0]); - computedConstants[163] = acsc(constants[0]); - computedConstants[164] = acot(constants[0]); - computedConstants[165] = asinh(constants[0]); - computedConstants[166] = acosh(constants[0]); - computedConstants[167] = atanh(constants[0]/2.0); - computedConstants[168] = asech(constants[0]); - computedConstants[169] = acsch(constants[0]); - computedConstants[170] = acoth(2.0*constants[0]); - computedConstants[171] = (constants[0] > constants[1])?constants[0]:NAN; - computedConstants[172] = (constants[0] > constants[1])?constants[0]:constants[2]; - computedConstants[173] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; - computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; - computedConstants[175] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); - computedConstants[180] = constants[0]; - computedConstants[187] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); - computedConstants[188] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); - computedConstants[189] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); - computedConstants[190] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); - computedConstants[191] = (constants[0] || constants[1]) && xor(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && xor(constants[0], constants[1]) && (constants[0] || constants[1]); - computedConstants[192] = (constants[0] && constants[1]) || xor(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || xor(constants[0], constants[1]) || (constants[0] && constants[1]); - computedConstants[193] = xor(constants[0] && constants[1], xor(constants[0] || constants[1], xor((constants[2] > constants[3])?constants[1]:NAN, xor(xor(xor(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); - computedConstants[194] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); - computedConstants[195] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); - computedConstants[196] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); + computedConstants[137] = log(constants[0])/log(constants[1]); + computedConstants[138] = ceil(constants[0]); + computedConstants[139] = floor(constants[0]); + computedConstants[140] = fmin(constants[0], constants[1]); + computedConstants[141] = fmin(constants[0], fmin(constants[1], constants[2])); + computedConstants[142] = fmax(constants[0], constants[1]); + computedConstants[143] = fmax(constants[0], fmax(constants[1], constants[2])); + computedConstants[144] = fmod(constants[0], constants[1]); + computedConstants[145] = sin(constants[0]); + computedConstants[146] = cos(constants[0]); + computedConstants[147] = tan(constants[0]); + computedConstants[148] = sec(constants[0]); + computedConstants[149] = csc(constants[0]); + computedConstants[150] = cot(constants[0]); + computedConstants[151] = sinh(constants[0]); + computedConstants[152] = cosh(constants[0]); + computedConstants[153] = tanh(constants[0]); + computedConstants[154] = sech(constants[0]); + computedConstants[155] = csch(constants[0]); + computedConstants[156] = coth(constants[0]); + computedConstants[157] = asin(constants[0]); + computedConstants[158] = acos(constants[0]); + computedConstants[159] = atan(constants[0]); + computedConstants[160] = asec(constants[0]); + computedConstants[161] = acsc(constants[0]); + computedConstants[162] = acot(constants[0]); + computedConstants[163] = asinh(constants[0]); + computedConstants[164] = acosh(constants[0]); + computedConstants[165] = atanh(constants[0]/2.0); + computedConstants[166] = asech(constants[0]); + computedConstants[167] = acsch(constants[0]); + computedConstants[168] = acoth(2.0*constants[0]); + computedConstants[170] = (constants[0] > constants[1])?constants[0]:NAN; + computedConstants[171] = (constants[0] < constants[1])?constants[0]:NAN; + computedConstants[172] = constants[0]; + computedConstants[173] = (constants[0] > constants[1])?constants[0]:constants[2]; + computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[175] = (constants[0] < constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[176] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; + computedConstants[177] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); + computedConstants[178] = 123.0+((constants[0] < constants[1])?constants[0]:NAN); + computedConstants[183] = constants[0]; + computedConstants[190] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])+((constants[2] < constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[192] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[193] = (constants[0] && constants[1])-(((constants[2] < constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] < constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[194] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[195] = (constants[0] && constants[1])*((constants[2] < constants[3])?constants[1]:NAN)*constants[4]*((constants[2] < constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[196] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); + computedConstants[197] = (constants[0] && constants[1])/(((constants[2] < constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] < constants[3])?constants[1]:NAN))); + computedConstants[198] = (constants[0] || constants[1]) && XOR(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && XOR(constants[0], constants[1]) && (constants[0] || constants[1]); + computedConstants[199] = (constants[0] && constants[1]) || XOR(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || XOR(constants[0], constants[1]) || (constants[0] && constants[1]); + computedConstants[200] = XOR(constants[0] && constants[1], XOR(constants[0] || constants[1], XOR((constants[2] > constants[3])?constants[1]:NAN, XOR(XOR(XOR(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); + computedConstants[201] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); + computedConstants[202] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); + computedConstants[203] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); + computedConstants[204] = -(constants[0] && constants[1])+-((constants[2] < constants[3])?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) @@ -650,6 +653,9 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, double *externals, ExternalVariable externalVariable) { + algebraic[0] = states[0] || states[0]; + algebraic[1] = states[0] || states[0] || constants[0]; + algebraic[2] = constants[0]/XOR(constants[1], states[0]); externals[0] = externalVariable(voi, states, rates, constants, computedConstants, algebraic, externals, 0); findRoot0(voi, states, rates, constants, computedConstants, algebraic, externals); } diff --git a/tests/resources/coverage/generator/model.modified.profile.h b/tests/resources/coverage/generator/model.xor.h similarity index 98% rename from tests/resources/coverage/generator/model.modified.profile.h rename to tests/resources/coverage/generator/model.xor.h index 882fbaead8..93d1cdae9d 100644 --- a/tests/resources/coverage/generator/model.modified.profile.h +++ b/tests/resources/coverage/generator/model.xor.h @@ -26,7 +26,7 @@ extern const VariableInfo COMPUTED_CONSTANT_INFO[]; extern const VariableInfo ALGEBRAIC_INFO[]; extern const VariableInfo EXTERNAL_INFO[]; -double * createStatesVector(); +double * createStatesArray(); double * createConstantsArray(); double * createComputedConstantsArray(); double * createAlgebraicArray(); diff --git a/tests/resources/coverage/generator/model.modified.profile.py b/tests/resources/coverage/generator/model.xor.py similarity index 71% rename from tests/resources/coverage/generator/model.modified.profile.py rename to tests/resources/coverage/generator/model.xor.py index 8462eba392..8fc5da945f 100644 --- a/tests/resources/coverage/generator/model.modified.profile.py +++ b/tests/resources/coverage/generator/model.xor.py @@ -9,8 +9,8 @@ STATE_COUNT = 1 CONSTANT_COUNT = 7 -COMPUTED_CONSTANT_COUNT = 199 -ALGEBRAIC_COUNT = 2 +COMPUTED_CONSTANT_COUNT = 207 +ALGEBRAIC_COUNT = 5 EXTERNAL_COUNT = 1 VOI_INFO = {"name": "t", "units": "second", "component": "my_component"} @@ -58,8 +58,6 @@ {"name": "eqnAndParenthesesRightPower", "units": "dimensionless", "component": "my_component"}, {"name": "eqnAndParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnAndCoverageParentheses", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnOr", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnOrMultiple", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component"}, {"name": "eqnOrParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component"}, @@ -89,7 +87,6 @@ {"name": "eqnXorParenthesesRightMinusWithout", "units": "dimensionless", "component": "my_component"}, {"name": "eqnXorParenthesesRightPower", "units": "dimensionless", "component": "my_component"}, {"name": "eqnXorParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, - {"name": "eqnXorCoverageParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPlusMultiple", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPlusParentheses", "units": "dimensionless", "component": "my_component"}, @@ -146,6 +143,7 @@ {"name": "eqnPowerParenthesesRightRoot", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootSqrt", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootSqrtOther", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnRootSqr", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootCube", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootCi", "units": "dimensionless", "component": "my_component"}, {"name": "eqnRootParentheses", "units": "dimensionless", "component": "my_component"}, @@ -201,11 +199,16 @@ {"name": "eqnArcsech", "units": "dimensionless", "component": "my_component"}, {"name": "eqnArccsch", "units": "dimensionless", "component": "my_component"}, {"name": "eqnArccoth", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewisePiece2", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewiseOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnPiecewisePiecePiecePiece2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component"}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnWithPiecewise2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCnIntegerWithExponent", "units": "dimensionless", "component": "my_component"}, @@ -218,20 +221,28 @@ {"name": "eqnInfinity", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNotanumber", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForPlusOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForPlusOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForMinusOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForMinusOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForTimesOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForTimesOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForDivideOperator", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForDivideOperator2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForAndOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForOrOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForXorOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component"}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnCoverageForMinusUnary2", "units": "dimensionless", "component": "my_component"}, {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component"}, {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component"} ] ALGEBRAIC_INFO = [ + {"name": "eqnOr", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnOrMultiple", "units": "dimensionless", "component": "my_component"}, + {"name": "eqnXorCoverageParentheses", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component"}, {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component"} ] @@ -273,7 +284,7 @@ def or_func(x, y): return 1.0 if bool(x) | bool(y) else 0.0 -def xor_func(x, y): +def XOR_FUNC(x, y): return 1.0 if bool(x) ^ bool(y) else 0.0 @@ -326,24 +337,18 @@ def acot(x): def asech(x): - one_over_x = 1.0/x - - return log(one_over_x+sqrt(one_over_x*one_over_x-1.0)) + return acosh(1.0/x) def acsch(x): - one_over_x = 1.0/x - - return log(one_over_x+sqrt(one_over_x*one_over_x+1.0)) + return asinh(1.0/x) def acoth(x): - one_over_x = 1.0/x - - return 0.5*log((1.0+one_over_x)/(1.0-one_over_x)) + return atanh(1.0/x) -def create_states_vector(): +def create_states_array(): return [nan]*STATE_COUNT @@ -375,23 +380,23 @@ def objective_function_0(u, f, data): algebraic = data[5] externals = data[6] - algebraic[0] = u[0] - algebraic[1] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] - f[0] = algebraic[0]+algebraic[1]+states[0]-0.0 - f[1] = algebraic[0]-algebraic[1]-(computed_constants[197]+computed_constants[198]) + f[0] = algebraic[3]+algebraic[4]+states[0]-0.0 + f[1] = algebraic[3]-algebraic[4]-(computed_constants[205]+computed_constants[206]) def find_root_0(voi, states, rates, constants, computed_constants, algebraic, externals): u = [nan]*2 - u[0] = algebraic[0] - u[1] = algebraic[1] + u[0] = algebraic[3] + u[1] = algebraic[4] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, constants, computed_constants, algebraic, externals]) - algebraic[0] = u[0] - algebraic[1] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] def initialise_variables(states, rates, constants, computed_constants, algebraic): @@ -403,20 +408,21 @@ def initialise_variables(states, rates, constants, computed_constants, algebraic constants[4] = 5.0 constants[5] = 6.0 constants[6] = 7.0 - computed_constants[176] = 123.0 - computed_constants[177] = 123.456789 - computed_constants[178] = 123.0e99 - computed_constants[179] = 123.456789e99 - computed_constants[181] = 1.0 - computed_constants[182] = 0.0 - computed_constants[183] = 2.71828182845905 - computed_constants[184] = 3.14159265358979 - computed_constants[185] = inf - computed_constants[186] = nan - computed_constants[197] = 1.0 - computed_constants[198] = 3.0 - algebraic[0] = 1.0 - algebraic[1] = 2.0 + computed_constants[169] = nan + computed_constants[179] = 123.0 + computed_constants[180] = 123.456789 + computed_constants[181] = 123.0e99 + computed_constants[182] = 123.456789e99 + computed_constants[184] = 1.0 + computed_constants[185] = 0.0 + computed_constants[186] = 2.71828182845905 + computed_constants[187] = 3.14159265358979 + computed_constants[188] = inf + computed_constants[189] = nan + computed_constants[205] = 1.0 + computed_constants[206] = 3.0 + algebraic[3] = 1.0 + algebraic[4] = 2.0 def compute_computed_constants(constants, computed_constants): @@ -429,9 +435,9 @@ def compute_computed_constants(constants, computed_constants): computed_constants[6] = leq_func(constants[0], constants[1]) computed_constants[7] = constants[0]/leq_func(constants[1], constants[2]) computed_constants[8] = gt_func(constants[0], constants[1]) - computed_constants[9] = constants[0]/gt_func(constants[1], constants[2]) + computed_constants[9] = constants[0]/gt_func(constants[2], constants[1]) computed_constants[10] = geq_func(constants[0], constants[1]) - computed_constants[11] = constants[0]/geq_func(constants[1], constants[2]) + computed_constants[11] = constants[0]/geq_func(constants[2], constants[1]) computed_constants[12] = and_func(constants[0], constants[1]) computed_constants[13] = and_func(constants[0], and_func(constants[1], constants[2])) computed_constants[14] = and_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) @@ -448,165 +454,172 @@ def compute_computed_constants(constants, computed_constants): computed_constants[25] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) computed_constants[26] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) computed_constants[27] = constants[0]/and_func(constants[1], constants[2]) - computed_constants[28] = or_func(constants[0], constants[1]) - computed_constants[29] = or_func(constants[0], or_func(constants[1], constants[2])) - computed_constants[30] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[31] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) - computed_constants[32] = or_func(constants[0], gt_func(constants[1], constants[2])) - computed_constants[33] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) - computed_constants[34] = or_func(-constants[0], gt_func(constants[1], constants[2])) - computed_constants[35] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[36] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) - computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[38] = or_func(lt_func(constants[0], constants[1]), constants[2]) - computed_constants[39] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[40] = or_func(lt_func(constants[0], constants[1]), -constants[2]) - computed_constants[41] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[42] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[43] = constants[0]/or_func(constants[1], constants[2]) - computed_constants[44] = xor_func(constants[0], constants[1]) - computed_constants[45] = xor_func(constants[0], xor_func(constants[1], constants[2])) - computed_constants[46] = xor_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[47] = xor_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) - computed_constants[48] = xor_func(constants[0], gt_func(constants[1], constants[2])) - computed_constants[49] = xor_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) - computed_constants[50] = xor_func(-constants[0], gt_func(constants[1], constants[2])) - computed_constants[51] = xor_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) - computed_constants[52] = xor_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) - computed_constants[53] = xor_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[54] = xor_func(lt_func(constants[0], constants[1]), constants[2]) - computed_constants[55] = xor_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[56] = xor_func(lt_func(constants[0], constants[1]), -constants[2]) - computed_constants[57] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[58] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[59] = constants[0]/xor_func(constants[1], constants[2]) - computed_constants[60] = not_func(constants[0]) - computed_constants[61] = constants[0]+constants[1]+constants[2] - computed_constants[62] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) - computed_constants[63] = constants[0] - computed_constants[64] = constants[0]-constants[1] - computed_constants[65] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) - computed_constants[66] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) - computed_constants[67] = lt_func(constants[0], constants[1])-constants[2] - computed_constants[68] = constants[0]-(-constants[1]) - computed_constants[69] = constants[0]-(-constants[1]*constants[2]) - computed_constants[70] = -constants[0] - computed_constants[71] = -lt_func(constants[0], constants[1]) - computed_constants[72] = constants[0]*constants[1] - computed_constants[73] = constants[0]*constants[1]*constants[2] - computed_constants[74] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) - computed_constants[75] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) - computed_constants[76] = constants[0]*gt_func(constants[1], constants[2]) - computed_constants[77] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) - computed_constants[78] = -constants[0]*gt_func(constants[1], constants[2]) - computed_constants[79] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) - computed_constants[80] = lt_func(constants[0], constants[1])*constants[2] - computed_constants[81] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) - computed_constants[82] = lt_func(constants[0], constants[1])*-constants[2] - computed_constants[83] = constants[0]/constants[1] - computed_constants[84] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) - computed_constants[85] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) - computed_constants[86] = constants[0]/gt_func(constants[2], constants[1]) - computed_constants[87] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) - computed_constants[88] = -constants[0]/gt_func(constants[2], constants[1]) - computed_constants[89] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) - computed_constants[90] = lt_func(constants[0], constants[1])/constants[2] - computed_constants[91] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) - computed_constants[92] = lt_func(constants[0], constants[1])/-constants[2] - computed_constants[93] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) - computed_constants[94] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) - computed_constants[95] = sqrt(constants[0]) - computed_constants[96] = pow(constants[0], 2.0) - computed_constants[97] = pow(constants[0], 3.0) - computed_constants[98] = pow(constants[0], constants[1]) - computed_constants[99] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) - computed_constants[100] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) - computed_constants[101] = pow(constants[0], geq_func(constants[1], constants[2])) - computed_constants[102] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) - computed_constants[103] = pow(-constants[0], geq_func(constants[1], constants[2])) - computed_constants[104] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) - computed_constants[105] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) - computed_constants[106] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) - computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]) - computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) - computed_constants[109] = pow(leq_func(constants[0], constants[1]), -constants[2]) - computed_constants[110] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) - computed_constants[111] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) - computed_constants[112] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) - computed_constants[113] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) - computed_constants[114] = sqrt(constants[0]) - computed_constants[115] = sqrt(constants[0]) - computed_constants[116] = pow(constants[0], 1.0/3.0) - computed_constants[117] = pow(constants[0], 1.0/constants[1]) - computed_constants[118] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) - computed_constants[119] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[120] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) - computed_constants[121] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[122] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) - computed_constants[123] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[124] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) - computed_constants[125] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) - computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) - computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) - computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) - computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) - computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) - computed_constants[131] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) - computed_constants[132] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) - computed_constants[133] = fabs(constants[0]) - computed_constants[134] = exp(constants[0]) - computed_constants[135] = log(constants[0]) + computed_constants[28] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[29] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[30] = or_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[31] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[32] = or_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[33] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[34] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[35] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[36] = or_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[38] = or_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[39] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[40] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[41] = constants[0]/or_func(constants[1], constants[2]) + computed_constants[42] = XOR_FUNC(constants[0], constants[1]) + computed_constants[43] = XOR_FUNC(constants[0], XOR_FUNC(constants[1], constants[2])) + computed_constants[44] = XOR_FUNC(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[45] = XOR_FUNC(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[46] = XOR_FUNC(constants[0], gt_func(constants[1], constants[2])) + computed_constants[47] = XOR_FUNC(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[48] = XOR_FUNC(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[49] = XOR_FUNC(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[50] = XOR_FUNC(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[51] = XOR_FUNC(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[52] = XOR_FUNC(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[53] = XOR_FUNC(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[54] = XOR_FUNC(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[55] = XOR_FUNC(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[56] = XOR_FUNC(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[57] = not_func(constants[0]) + computed_constants[58] = constants[0]+constants[1]+constants[2] + computed_constants[59] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) + computed_constants[60] = constants[0] + computed_constants[61] = constants[0]-constants[1] + computed_constants[62] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) + computed_constants[63] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) + computed_constants[64] = lt_func(constants[0], constants[1])-constants[2] + computed_constants[65] = constants[0]-(-constants[1]) + computed_constants[66] = constants[0]-(-constants[1]*constants[2]) + computed_constants[67] = -constants[0] + computed_constants[68] = -lt_func(constants[0], constants[1]) + computed_constants[69] = constants[0]*constants[1] + computed_constants[70] = constants[0]*constants[1]*constants[2] + computed_constants[71] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) + computed_constants[72] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) + computed_constants[73] = constants[0]*gt_func(constants[1], constants[2]) + computed_constants[74] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) + computed_constants[75] = -constants[0]*gt_func(constants[1], constants[2]) + computed_constants[76] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) + computed_constants[77] = lt_func(constants[0], constants[1])*constants[2] + computed_constants[78] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) + computed_constants[79] = lt_func(constants[0], constants[1])*-constants[2] + computed_constants[80] = constants[0]/constants[1] + computed_constants[81] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) + computed_constants[82] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) + computed_constants[83] = constants[0]/gt_func(constants[2], constants[1]) + computed_constants[84] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) + computed_constants[85] = -constants[0]/gt_func(constants[2], constants[1]) + computed_constants[86] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) + computed_constants[87] = lt_func(constants[0], constants[1])/constants[2] + computed_constants[88] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) + computed_constants[89] = lt_func(constants[0], constants[1])/-constants[2] + computed_constants[90] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) + computed_constants[91] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) + computed_constants[92] = sqrt(constants[0]) + computed_constants[93] = pow(constants[0], 2.0) + computed_constants[94] = pow(constants[0], 3.0) + computed_constants[95] = pow(constants[0], constants[1]) + computed_constants[96] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) + computed_constants[97] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) + computed_constants[98] = pow(constants[0], geq_func(constants[1], constants[2])) + computed_constants[99] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) + computed_constants[100] = pow(-constants[0], geq_func(constants[1], constants[2])) + computed_constants[101] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) + computed_constants[102] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) + computed_constants[103] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[104] = pow(leq_func(constants[0], constants[1]), constants[2]) + computed_constants[105] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[106] = pow(leq_func(constants[0], constants[1]), -constants[2]) + computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) + computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) + computed_constants[109] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[110] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[111] = sqrt(constants[0]) + computed_constants[112] = sqrt(constants[0]) + computed_constants[113] = pow(constants[0], 1.0/0.5) + computed_constants[114] = pow(constants[0], 1.0/3.0) + computed_constants[115] = pow(constants[0], 1.0/constants[1]) + computed_constants[116] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) + computed_constants[117] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[118] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[119] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[120] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[121] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[122] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[123] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) + computed_constants[124] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) + computed_constants[125] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) + computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) + computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) + computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) + computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) + computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) + computed_constants[131] = fabs(constants[0]) + computed_constants[132] = exp(constants[0]) + computed_constants[133] = log(constants[0]) + computed_constants[134] = log10(constants[0]) + computed_constants[135] = log(constants[0])/log(2.0) computed_constants[136] = log10(constants[0]) - computed_constants[137] = log(constants[0])/log(2.0) - computed_constants[138] = log10(constants[0]) - computed_constants[139] = log(constants[0])/log(constants[1]) - computed_constants[140] = ceil(constants[0]) - computed_constants[141] = floor(constants[0]) - computed_constants[142] = min(constants[0], constants[1]) - computed_constants[143] = min(constants[0], min(constants[1], constants[2])) - computed_constants[144] = max(constants[0], constants[1]) - computed_constants[145] = max(constants[0], max(constants[1], constants[2])) - computed_constants[146] = fmod(constants[0], constants[1]) - computed_constants[147] = sin(constants[0]) - computed_constants[148] = cos(constants[0]) - computed_constants[149] = tan(constants[0]) - computed_constants[150] = sec(constants[0]) - computed_constants[151] = csc(constants[0]) - computed_constants[152] = cot(constants[0]) - computed_constants[153] = sinh(constants[0]) - computed_constants[154] = cosh(constants[0]) - computed_constants[155] = tanh(constants[0]) - computed_constants[156] = sech(constants[0]) - computed_constants[157] = csch(constants[0]) - computed_constants[158] = coth(constants[0]) - computed_constants[159] = asin(constants[0]) - computed_constants[160] = acos(constants[0]) - computed_constants[161] = atan(constants[0]) - computed_constants[162] = asec(constants[0]) - computed_constants[163] = acsc(constants[0]) - computed_constants[164] = acot(constants[0]) - computed_constants[165] = asinh(constants[0]) - computed_constants[166] = acosh(constants[0]) - computed_constants[167] = atanh(constants[0]/2.0) - computed_constants[168] = asech(constants[0]) - computed_constants[169] = acsch(constants[0]) - computed_constants[170] = acoth(2.0*constants[0]) - computed_constants[171] = constants[0] if gt_func(constants[0], constants[1]) else nan - computed_constants[172] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] - computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan - computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] - computed_constants[175] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) - computed_constants[180] = constants[0] - computed_constants[187] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) - computed_constants[188] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) - computed_constants[189] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) - computed_constants[190] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) - computed_constants[191] = and_func(or_func(constants[0], constants[1]), and_func(xor_func(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), or_func(constants[0], constants[1]))))) - computed_constants[192] = or_func(and_func(constants[0], constants[1]), or_func(xor_func(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) - computed_constants[193] = xor_func(and_func(constants[0], constants[1]), xor_func(or_func(constants[0], constants[1]), xor_func(constants[1] if gt_func(constants[2], constants[3]) else nan, xor_func(xor_func(xor_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) - computed_constants[194] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) - computed_constants[195] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) - computed_constants[196] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) + computed_constants[137] = log(constants[0])/log(constants[1]) + computed_constants[138] = ceil(constants[0]) + computed_constants[139] = floor(constants[0]) + computed_constants[140] = min(constants[0], constants[1]) + computed_constants[141] = min(constants[0], min(constants[1], constants[2])) + computed_constants[142] = max(constants[0], constants[1]) + computed_constants[143] = max(constants[0], max(constants[1], constants[2])) + computed_constants[144] = fmod(constants[0], constants[1]) + computed_constants[145] = sin(constants[0]) + computed_constants[146] = cos(constants[0]) + computed_constants[147] = tan(constants[0]) + computed_constants[148] = sec(constants[0]) + computed_constants[149] = csc(constants[0]) + computed_constants[150] = cot(constants[0]) + computed_constants[151] = sinh(constants[0]) + computed_constants[152] = cosh(constants[0]) + computed_constants[153] = tanh(constants[0]) + computed_constants[154] = sech(constants[0]) + computed_constants[155] = csch(constants[0]) + computed_constants[156] = coth(constants[0]) + computed_constants[157] = asin(constants[0]) + computed_constants[158] = acos(constants[0]) + computed_constants[159] = atan(constants[0]) + computed_constants[160] = asec(constants[0]) + computed_constants[161] = acsc(constants[0]) + computed_constants[162] = acot(constants[0]) + computed_constants[163] = asinh(constants[0]) + computed_constants[164] = acosh(constants[0]) + computed_constants[165] = atanh(constants[0]/2.0) + computed_constants[166] = asech(constants[0]) + computed_constants[167] = acsch(constants[0]) + computed_constants[168] = acoth(2.0*constants[0]) + computed_constants[170] = constants[0] if gt_func(constants[0], constants[1]) else nan + computed_constants[171] = constants[0] if lt_func(constants[0], constants[1]) else nan + computed_constants[172] = constants[0] + computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] + computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[175] = constants[0] if lt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[176] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] + computed_constants[177] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) + computed_constants[178] = 123.0+(constants[0] if lt_func(constants[0], constants[1]) else nan) + computed_constants[183] = constants[0] + computed_constants[190] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[191] = and_func(constants[0], constants[1])+(constants[1] if lt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[192] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[193] = and_func(constants[0], constants[1])-((constants[1] if lt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if lt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[194] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[195] = and_func(constants[0], constants[1])*(constants[1] if lt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if lt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[196] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) + computed_constants[197] = and_func(constants[0], constants[1])/((constants[1] if lt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if lt_func(constants[2], constants[3]) else nan))) + computed_constants[198] = and_func(or_func(constants[0], constants[1]), and_func(XOR_FUNC(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), XOR_FUNC(constants[0], constants[1])), or_func(constants[0], constants[1]))))) + computed_constants[199] = or_func(and_func(constants[0], constants[1]), or_func(XOR_FUNC(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), XOR_FUNC(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[200] = XOR_FUNC(and_func(constants[0], constants[1]), XOR_FUNC(or_func(constants[0], constants[1]), XOR_FUNC(constants[1] if gt_func(constants[2], constants[3]) else nan, XOR_FUNC(XOR_FUNC(XOR_FUNC(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[201] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) + computed_constants[202] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) + computed_constants[203] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) + computed_constants[204] = -and_func(constants[0], constants[1])+-(constants[1] if lt_func(constants[2], constants[3]) else nan) def compute_rates(voi, states, rates, constants, computed_constants, algebraic, externals, external_variable): @@ -614,5 +627,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, externals, external_variable): + algebraic[0] = or_func(states[0], states[0]) + algebraic[1] = or_func(states[0], or_func(states[0], constants[0])) + algebraic[2] = constants[0]/XOR_FUNC(constants[1], states[0]) externals[0] = external_variable(voi, states, rates, constants, computed_constants, algebraic, externals, 0) find_root_0(voi, states, rates, constants, computed_constants, algebraic, externals) diff --git a/tests/resources/generator/cellml_slc_example/model.c b/tests/resources/generator/cellml_slc_example/model.c new file mode 100644 index 0000000000..1436a03f37 --- /dev/null +++ b/tests/resources/generator/cellml_slc_example/model.c @@ -0,0 +1,92 @@ +/* The content of this file was generated using the C profile of libCellML 0.6.0. */ + +#include "model.h" + +#include +#include + +const char VERSION[] = "0.6.0"; +const char LIBCELLML_VERSION[] = "0.6.0"; + +const size_t CONSTANT_COUNT = 9; +const size_t COMPUTED_CONSTANT_COUNT = 1; +const size_t ALGEBRAIC_COUNT = 0; + +const VariableInfo CONSTANT_INFO[] = { + {"E", "fmol", "SLC_template3_ss"}, + {"P_0", "per_fmol_sec4", "SLC_template3_ss"}, + {"q_Ao", "fmol", "SLC_template3_ss"}, + {"P_1", "per_fmol_sec4", "SLC_template3_ss"}, + {"q_Ai", "fmol", "SLC_template3_ss"}, + {"P_2", "per_fmol_sec3", "SLC_template3_ss"}, + {"P_5", "per_sec3", "SLC_template3_ss"}, + {"P_4", "per_fmol2_sec3", "SLC_template3_ss"}, + {"P_3", "per_fmol_sec3", "SLC_template3_ss"} +}; + +const VariableInfo COMPUTED_CONSTANT_INFO[] = { + {"v", "fmol_per_sec", "SLC_template3_ss"} +}; + +const VariableInfo ALGEBRAIC_INFO[] = { +}; + +double * createConstantsArray() +{ + double *res = (double *) malloc(CONSTANT_COUNT*sizeof(double)); + + for (size_t i = 0; i < CONSTANT_COUNT; ++i) { + res[i] = NAN; + } + + return res; +} + +double * createComputedConstantsArray() +{ + double *res = (double *) malloc(COMPUTED_CONSTANT_COUNT*sizeof(double)); + + for (size_t i = 0; i < COMPUTED_CONSTANT_COUNT; ++i) { + res[i] = NAN; + } + + return res; +} + +double * createAlgebraicArray() +{ + double *res = (double *) malloc(ALGEBRAIC_COUNT*sizeof(double)); + + for (size_t i = 0; i < ALGEBRAIC_COUNT; ++i) { + res[i] = NAN; + } + + return res; +} + +void deleteArray(double *array) +{ + free(array); +} + +void initialiseVariables(double *constants, double *computedConstants, double *algebraic) +{ + constants[0] = 1.1; + constants[1] = 21262500.0; + constants[2] = 150.0; + constants[3] = 3402000.0; + constants[4] = 2.0; + constants[5] = 2902500.0; + constants[6] = 810000.0; + constants[7] = 247140.0; + constants[8] = 2902500.0; +} + +void computeComputedConstants(double *constants, double *computedConstants) +{ + computedConstants[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+constants[8]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]); +} + +void computeVariables(double *constants, double *computedConstants, double *algebraic) +{ +} diff --git a/tests/resources/generator/cellml_slc_example/model.h b/tests/resources/generator/cellml_slc_example/model.h new file mode 100644 index 0000000000..661f80fa6f --- /dev/null +++ b/tests/resources/generator/cellml_slc_example/model.h @@ -0,0 +1,32 @@ +/* The content of this file was generated using the C profile of libCellML 0.6.0. */ + +#pragma once + +#include + +extern const char VERSION[]; +extern const char LIBCELLML_VERSION[]; + +extern const size_t CONSTANT_COUNT; +extern const size_t COMPUTED_CONSTANT_COUNT; +extern const size_t ALGEBRAIC_COUNT; + +typedef struct { + char name[5]; + char units[15]; + char component[17]; +} VariableInfo; + +extern const VariableInfo CONSTANT_INFO[]; +extern const VariableInfo COMPUTED_CONSTANT_INFO[]; +extern const VariableInfo ALGEBRAIC_INFO[]; + +double * createConstantsArray(); +double * createComputedConstantsArray(); +double * createAlgebraicArray(); + +void deleteArray(double *array); + +void initialiseVariables(double *constants, double *computedConstants, double *algebraic); +void computeComputedConstants(double *constants, double *computedConstants); +void computeVariables(double *constants, double *computedConstants, double *algebraic); diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.c index a7c7bbde73..0ff0c4489f 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.algebraic.h" +#include "model.algebraic.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.c index 3c6887b968..5862270578 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.computed.constant.h" +#include "model.computed.constant.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.c index 12ff7e8eef..62631ccd62 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.constant.h" +#include "model.constant.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.c index 7cd82fc2f7..e357c309c0 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.dependent.algebraic.h" +#include "model.dependent.algebraic.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.c index 50c6630bd3..2948224f4d 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.dependent.computed.constant.h" +#include "model.dependent.computed.constant.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.c index 7ee290663e..55adde719b 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.dependent.constant.h" +#include "model.dependent.constant.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.c index 56be82f194..b9bca59ba5 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.dependent.state.h" +#include "model.dependent.state.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.c similarity index 99% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.c index 3acf0bc178..0e3ca00d59 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.c @@ -1,6 +1,6 @@ /* The content of this file was generated using the C profile of libCellML 0.6.0. */ -#include "model.state.h" +#include "model.state.external.h" #include #include diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.h b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.h similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.h rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.h diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.py similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.external.py diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model_unknown_vars_on_rhs.cellml b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.unknown.vars.on.rhs.cellml similarity index 100% rename from tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model_unknown_vars_on_rhs.cellml rename to tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.unknown.vars.on.rhs.cellml