From eee1a84562238e35ab0877ed538b0c4cb868d21a Mon Sep 17 00:00:00 2001
From: JK <klein@tcs.inf.tu-dresden.de>
Date: Mon, 6 Feb 2017 18:09:30 +0100
Subject: [PATCH] fix, BinaryNumericalFunctionExpression: simplify for pow(a,b)
 in double context should not cast result to integer [with Linda Leuschner]

Small test case:

dtmc
const double x = 1E-2;
const double y = pow(1-x, 10);
module M1
  s: [0..2] init 0;
  [] s = 0 -> y:(s'=1) + (1-y):(s'=2);
endmodule

should satisfy Pmax>0 [F (s = 1)].
---
 .../storage/expressions/BinaryNumericalFunctionExpression.cpp   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp b/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp
index 1c0a7908e..5524ca52d 100644
--- a/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp
+++ b/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp
@@ -99,7 +99,7 @@ namespace storm {
                         case OperatorType::Times: newValue = firstOperandEvaluation * secondOperandEvaluation; break;
                         case OperatorType::Min: newValue = std::min(firstOperandEvaluation, secondOperandEvaluation); break;
                         case OperatorType::Max: newValue = std::max(firstOperandEvaluation, secondOperandEvaluation); break;
-                        case OperatorType::Power: newValue = static_cast<int_fast64_t>(std::pow(firstOperandEvaluation, secondOperandEvaluation)); break;
+                        case OperatorType::Power: newValue = std::pow(firstOperandEvaluation, secondOperandEvaluation); break;
                         case OperatorType::Divide: STORM_LOG_THROW(false, storm::exceptions::InvalidStateException, "Unable to simplify division."); break;
                     }
                     return std::shared_ptr<BaseExpression>(new RationalLiteralExpression(this->getManager(), newValue));