From 901105f9e4e2395383e736cdb695ceeaf0468341 Mon Sep 17 00:00:00 2001 From: Jip Spel Date: Fri, 5 Oct 2018 13:44:21 +0200 Subject: [PATCH] Only divide by denominator when function is not constant --- .../storage/expressions/RationalFunctionToExpression.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storm/storage/expressions/RationalFunctionToExpression.cpp b/src/storm/storage/expressions/RationalFunctionToExpression.cpp index 8929a58db..81abc8f36 100644 --- a/src/storm/storage/expressions/RationalFunctionToExpression.cpp +++ b/src/storm/storage/expressions/RationalFunctionToExpression.cpp @@ -37,7 +37,6 @@ namespace storm { STORM_LOG_DEBUG("Expecting the denominator to be constant"); } - storm::expressions::Expression denominatorVal = manager->rational(storm::utility::convertNumber(denominator.constantPart())); storm::expressions::Expression result; if (function.isConstant()) { result = manager->rational(storm::utility::convertNumber(function.constantPart())); @@ -56,8 +55,10 @@ namespace storm { result = result + nominatorPartExpr; } } + storm::expressions::Expression denominatorVal = manager->rational(storm::utility::convertNumber(denominator.constantPart())); + result = result / denominatorVal; } - result = result / denominatorVal; + return result; }