get rid of boost::math::log1p() and use rtl::math::log1p()

... which in turn uses the compiler's std::log1p()

Change-Id: I8878cc31dd4b0c16b04f15822cfbe665e4156109
This commit is contained in:
Eike Rathke
2017-02-13 18:22:28 +01:00
parent 3ee77072ff
commit 1a1dbff33d
2 changed files with 5 additions and 7 deletions

View File

@@ -27,7 +27,6 @@
#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
#include <sal/macros.h>
#include <boost/math/special_functions/log1p.hpp>
#include "attrib.hxx"
#include "sc.hrc"
@@ -1855,7 +1854,7 @@ void ScInterpreter::ScPDuration()
double nFuture = GetDouble();
double nPresent = GetDouble();
double nInterest = GetDouble();
PushDouble(log(nFuture / nPresent) / boost::math::log1p(nInterest));
PushDouble(log(nFuture / nPresent) / rtl::math::log1p(nInterest));
}
}
@@ -1972,9 +1971,9 @@ void ScInterpreter::ScNper()
PushDouble(-(nBw + nZw)/nRmz);
else if (bPayInAdvance)
PushDouble(log(-(nInterest*nZw-nRmz*(1.0+nInterest))/(nInterest*nBw+nRmz*(1.0+nInterest)))
/boost::math::log1p(nInterest));
/ rtl::math::log1p(nInterest));
else
PushDouble(log(-(nInterest*nZw-nRmz)/(nInterest*nBw+nRmz))/boost::math::log1p(nInterest));
PushDouble(log(-(nInterest*nZw-nRmz)/(nInterest*nBw+nRmz)) / rtl::math::log1p(nInterest));
}
bool ScInterpreter::RateIteration( double fNper, double fPayment, double fPv,

View File

@@ -34,7 +34,6 @@
#include <math.h>
#include <vector>
#include <algorithm>
#include <boost/math/special_functions/log1p.hpp>
#include <comphelper/random.hxx>
using ::std::vector;
@@ -588,7 +587,7 @@ double ScInterpreter::GetGamma(double fZ)
if (fZ >= -0.5) // shift to x>=1, might overflow
{
double fLogTest = lcl_GetLogGammaHelper(fZ+2) - boost::math::log1p(fZ) - log( fabs(fZ));
double fLogTest = lcl_GetLogGammaHelper(fZ+2) - rtl::math::log1p(fZ) - log( fabs(fZ));
if (fLogTest >= fLogDblMax)
{
SetError( FormulaError::IllegalFPOperation);
@@ -621,7 +620,7 @@ double ScInterpreter::GetLogGamma(double fZ)
return log(lcl_GetGammaHelper(fZ));
if (fZ >= 0.5)
return log( lcl_GetGammaHelper(fZ+1) / fZ);
return lcl_GetLogGammaHelper(fZ+2) - boost::math::log1p(fZ) - log(fZ);
return lcl_GetLogGammaHelper(fZ+2) - rtl::math::log1p(fZ) - log(fZ);
}
double ScInterpreter::GetFDist(double x, double fF1, double fF2)