ROOT  6.06/09
Reference Guide
Macros | Enumerations | Functions | Variables
math.cpp File Reference
#include "unittest.h"
#include <iostream>
#include "vectormemoryhelper.h"
#include "const.h"
#include <cmath>
#include <algorithm>
#include <Vc/common/macros.h>
#include "ulp.h"
+ Include dependency graph for math.cpp:

Go to the source code of this file.

Macros

#define FillHelperMemory(code)
 
#define ATAN_COMPARE   COMPARE
 

Enumerations

enum  Function {
  Sincos, Atan, Asin, Acos,
  Log, Log2, Log10
}
 
enum  { NDenormals = 64 }
 

Functions

template<typename T , Function F>
static const char * filename ()
 
template<>
const char * filename< float, Sincos > ()
 
template<>
const char * filename< double, Sincos > ()
 
template<>
const char * filename< float, Atan > ()
 
template<>
const char * filename< double, Atan > ()
 
template<>
const char * filename< float, Asin > ()
 
template<>
const char * filename< double, Asin > ()
 
template<>
const char * filename< float, Log > ()
 
template<>
const char * filename< double, Log > ()
 
template<>
const char * filename< float, Log2 > ()
 
template<>
const char * filename< double, Log2 > ()
 
template<>
const char * filename< float, Log10 > ()
 
template<>
const char * filename< double, Log10 > ()
 
template<typename T >
static Array< SincosReference< T > > sincosReference ()
 
template<typename T , Function Fun>
static Array< Reference< T > > referenceData ()
 
template<typename V >
apply_v (VC_ALIGNED_PARAMETER(V) x, typename V::EntryType(func)(typename V::EntryType))
 
template<typename Vec >
void testAbs ()
 
static float my_trunc (float x)
 
static double my_trunc (double x)
 
template<typename V >
void testTrunc ()
 
template<typename V >
void testFloor ()
 
template<typename V >
void testCeil ()
 
template<typename V >
void testExp ()
 
template<typename V >
void testLog ()
 
static float my_log2 (float x)
 
static double my_log2 (double x)
 
template<typename V >
void testLog2 ()
 
template<typename V >
void testLog10 ()
 
template<typename Vec >
void testMax ()
 
template<typename V >
void testSqrt ()
 
template<typename V >
void testRSqrt ()
 
template<typename V >
void testSincos ()
 
template<typename V >
void testSin ()
 
template<typename V >
void testCos ()
 
template<typename V >
void testAsin ()
 
template<typename V >
void testAtan ()
 
template<typename V >
void testAtan2 ()
 
template<typename Vec >
void testReciprocal ()
 
template<typename V >
void isNegative ()
 
template<typename Vec >
void testInf ()
 
template<typename Vec >
void testNaN ()
 
template<typename Vec >
void testRound ()
 
template<typename Vec >
void testReduceMin ()
 
template<typename Vec >
void testReduceMax ()
 
template<typename Vec >
void testReduceProduct ()
 
template<typename Vec >
void testReduceSum ()
 
template<typename V >
void testExponent ()
 
template<typename V >
void testFrexp ()
 
template<typename V >
void testLdexp ()
 
template<typename V >
void testUlpDiff ()
 
int main (int argc, char **argv)
 

Variables

union {
   unsigned int   hex
 
   float   value
 
INF = { 0x7f800000 }
 

Macro Definition Documentation

#define ATAN_COMPARE   COMPARE

Definition at line 449 of file math.cpp.

Referenced by testAtan(), and testAtan2().

#define FillHelperMemory (   code)
Value:
typename V::Memory data; \
typename V::Memory reference; \
for (int ii = 0; ii < V::Size; ++ii) { \
const T i = static_cast<T>(ii); \
data[ii] = i; \
reference[ii] = code; \
} do {} while (false)
for(Int_t i=0;i< n;i++)
Definition: legend1.C:18
const char * Size
Definition: TXMLSetup.cxx:56
double T(double x)
Definition: ChebyshevPol.h:34

Definition at line 338 of file math.cpp.

Referenced by testAtan2(), and testSqrt().

Enumeration Type Documentation

anonymous enum
Enumerator
NDenormals 

Definition at line 123 of file math.cpp.

enum Function
Enumerator
Sincos 
Atan 
Asin 
Acos 
Log 
Log2 
Log10 

Definition at line 59 of file math.cpp.

Function Documentation

template<typename V >
V apply_v ( VC_ALIGNED_PARAMETER(V)  x,
typename V::  EntryTypefunc)(typename V::EntryType 
)

Definition at line 127 of file math.cpp.

Referenced by testCeil(), testExp(), testFloor(), testLog(), testLog10(), testLog2(), and testTrunc().

template<typename T , Function F>
static const char* filename ( )
inlinestatic

Referenced by TChain::AddFile(), TGFileContainer::AddFile(), ROOT::Internal::TTreeGeneratorBase::AddHeader(), TClass::AddImplFile(), TGFileBrowser::AddRemoteFile(), TGFileContainer::AddRemoteFile(), begin_request_handler(), TClassDocOutput::Class2Html(), ClassImp(), TClassDocOutput::ClassTree(), TDocOutput::CreateClassIndex(), TDocOutput::CreateClassTypeDefs(), TDocOutput::CreateHierarchy(), TClassDocOutput::CreateHierarchyDot(), TDocOutput::CreateModuleIndex(), TDocMacroDirective::CreateSubprocessInputFile(), ROOT::TMetaUtils::declareModuleMap(), TMultiLayerPerceptron::DumpWeights(), TProof::Exec(), TMultiLayerPerceptron::Export(), TGeoElementTable::ExportElementsRN(), TVirtualStreamerInfo::Factory(), TASPluginGS::File2ASImage(), TPerfStats::FileEvent(), TClingCallbacks::FileNotFound(), TPerfStats::FileOpenEvent(), TGMimeTypes::Find(), TCastorFile::FindServerAndPath(), TPostScript::FontEmbed(), TStreamerInfo::GenerateHeaderFile(), TNetXNGSystem::GetDirEntry(), TDSet::GetEntries(), ROOT::TMetaUtils::GetFileName(), TEveManager::GetGeometry(), THtml::TModuleDefinition::GetModule(), TPacketizerFile::GetNextPacket(), TDocLatexDirective::GetResult(), TSelector::GetSelector(), TProofServ::HandleProcess(), TProofServ::HandleSocketInput(), RooWorkspace::import(), TCling::IsLoaded(), TDocOutput::IsModified(), TEntryListFromFile::LoadList(), TMultiLayerPerceptron::LoadWeights(), TDocParser::LocateMethods(), TTreePlayer::MakeCode(), TGeoManager::OptimizeVoxels(), TPerfStats::PacketEvent(), TChain::ParseTreeFilename(), TEntryListFromFile::Print(), TPad::Print(), TSelEventGen::Process(), TDocOutput::ProcessDocInDir(), TProofServ::ProcessNext(), THttpServer::ProcessRequest(), TXMLFile::ProduceFileNames(), R__WriteDependencyFile(), RooDataSet::read(), read_data(), RooArgSet::readFromStream(), TROOT::ReadGitInfo(), TASImage::ReadImage(), TSelHandleDataSet::ReleaseCache(), TDocOutput::RunDot(), TPad::SaveAs(), TParallelCoord::SaveEntryLists(), TGMimeTypes::SaveMimes(), TDirectoryFile::SaveObjectAs(), TDirectory::SaveObjectAs(), TParallelCoord::SavePrimitive(), TGTextView::SavePrimitive(), TGTextEdit::SavePrimitive(), TTreeViewer::SaveSource(), TProofProgressLog::SaveToFile(), TParallelCoord::SaveTree(), THttpServer::SetDefaultPage(), THttpServer::SetDrawPage(), TChain::SetEntryList(), TChain::SetEventList(), THttpCallArg::SetFile(), Baker::setFilename(), TEntryList::SetFileName(), TEntryList::SetTree(), THtml::TFileDefinition::SplitClassIntoDirFile(), TGLAutoRotator::StartImageAutoSave(), TGLAutoRotator::StartImageAutoSaveAnimatedGif(), TGraph::TGraph(), TGraph2D::TGraph2D(), TGraphErrors::TGraphErrors(), TGLAutoRotator::Timeout(), RScanner::TreatRecordDeclOrTypedefNameDecl(), ROOT::TMetaUtils::WriteClassInit(), TClassDocOutput::WriteMethod(), and ROOT::Internal::TTreeProxyGenerator::WriteProxy().

template<>
const char* filename< double, Asin > ( )
inline

Definition at line 68 of file math.cpp.

template<>
const char* filename< double, Atan > ( )
inline

Definition at line 66 of file math.cpp.

template<>
const char* filename< double, Log > ( )
inline

Definition at line 72 of file math.cpp.

template<>
const char* filename< double, Log10 > ( )
inline

Definition at line 76 of file math.cpp.

template<>
const char* filename< double, Log2 > ( )
inline

Definition at line 74 of file math.cpp.

template<>
const char* filename< double, Sincos > ( )
inline

Definition at line 64 of file math.cpp.

template<>
const char* filename< float, Asin > ( )
inline

Definition at line 67 of file math.cpp.

template<>
const char* filename< float, Atan > ( )
inline

Definition at line 65 of file math.cpp.

template<>
const char* filename< float, Log > ( )
inline

Definition at line 71 of file math.cpp.

template<>
const char* filename< float, Log10 > ( )
inline

Definition at line 75 of file math.cpp.

template<>
const char* filename< float, Log2 > ( )
inline

Definition at line 73 of file math.cpp.

template<>
const char* filename< float, Sincos > ( )
inline

Definition at line 63 of file math.cpp.

template<typename V >
void isNegative ( )

Definition at line 581 of file math.cpp.

Referenced by main(), and testAtan2().

int main ( int  argc,
char **  argv 
)

Definition at line 864 of file math.cpp.

static float my_log2 ( float  x)
inlinestatic

Definition at line 262 of file math.cpp.

Referenced by testLog2().

static double my_log2 ( double  x)
inlinestatic

Definition at line 263 of file math.cpp.

static float my_trunc ( float  x)
inlinestatic

Definition at line 146 of file math.cpp.

Referenced by testTrunc().

static double my_trunc ( double  x)
inlinestatic

Definition at line 157 of file math.cpp.

template<typename T , Function Fun>
static Array<Reference<T> > referenceData ( )
static

Definition at line 100 of file math.cpp.

template<typename T >
static Array<SincosReference<T> > sincosReference ( )
static

Definition at line 79 of file math.cpp.

Referenced by convert().

template<typename Vec >
void testAbs ( )

Definition at line 136 of file math.cpp.

template<typename V >
void testAsin ( )

Definition at line 424 of file math.cpp.

Referenced by main().

template<typename V >
void testAtan ( )

Definition at line 452 of file math.cpp.

Referenced by main().

template<typename V >
void testAtan2 ( )

Definition at line 483 of file math.cpp.

Referenced by main().

template<typename V >
void testCeil ( )

Definition at line 196 of file math.cpp.

Referenced by main().

template<typename V >
void testCos ( )

Definition at line 407 of file math.cpp.

Referenced by main().

template<typename V >
void testExp ( )

Definition at line 210 of file math.cpp.

Referenced by main().

template<typename V >
void testExponent ( )

Definition at line 721 of file math.cpp.

Referenced by main().

template<typename V >
void testFloor ( )

Definition at line 182 of file math.cpp.

Referenced by main().

template<typename V >
void testFrexp ( )

Definition at line 766 of file math.cpp.

Referenced by main().

template<typename Vec >
void testInf ( )

Definition at line 590 of file math.cpp.

Referenced by main().

template<typename V >
void testLdexp ( )

Definition at line 819 of file math.cpp.

Referenced by main().

template<typename V >
void testLog ( )

Definition at line 223 of file math.cpp.

Referenced by main().

template<typename V >
void testLog10 ( )

Definition at line 297 of file math.cpp.

Referenced by main().

template<typename V >
void testLog2 ( )

Definition at line 266 of file math.cpp.

Referenced by main().

template<typename Vec >
void testMax ( )

Definition at line 320 of file math.cpp.

template<typename Vec >
void testNaN ( )

Definition at line 600 of file math.cpp.

Referenced by main().

template<typename Vec >
void testReciprocal ( )

Definition at line 558 of file math.cpp.

Referenced by main().

template<typename Vec >
void testReduceMax ( )

Definition at line 662 of file math.cpp.

template<typename Vec >
void testReduceMin ( )

Definition at line 646 of file math.cpp.

template<typename Vec >
void testReduceProduct ( )

Definition at line 678 of file math.cpp.

template<typename Vec >
void testReduceSum ( )

Definition at line 701 of file math.cpp.

template<typename Vec >
void testRound ( )

Definition at line 619 of file math.cpp.

Referenced by main().

template<typename V >
void testRSqrt ( )

Definition at line 357 of file math.cpp.

Referenced by main().

template<typename V >
void testSin ( )

Definition at line 390 of file math.cpp.

Referenced by main().

template<typename V >
void testSincos ( )

Definition at line 367 of file math.cpp.

Referenced by main().

template<typename V >
void testSqrt ( )

Definition at line 347 of file math.cpp.

Referenced by main().

template<typename V >
void testTrunc ( )

Definition at line 168 of file math.cpp.

Referenced by main().

template<typename V >
void testUlpDiff ( )

Definition at line 832 of file math.cpp.

Referenced by main().

Variable Documentation

unsigned int hex
const { ... } INF

Referenced by testAtan(), and testAtan2().

float value

Definition at line 443 of file math.cpp.

Referenced by TExMap::Add(), TQRootDialog::Add(), TMVA::kNN::Node< T >::Add(), THnBase::Add(), add_map_element(), TExMap::AddAt(), TMVA::Tools::AddAttr(), TDocLatexDirective::AddParameter(), TEveProjection::AddPreScaleEntry(), TGridJDL::AddQuotes(), TAlienJDL::AddToReqSet(), TFormula::AddVariable(), ROOT::Fit::HFitInterface::AdjustError(), RooRealSumPdf::analyticalIntegralWN(), RooAddModel::analyticalIntegralWN(), PiecewiseInterpolation::analyticalIntegralWN(), RooAddPdf::analyticalIntegralWN(), ParamHistFunc::analyticalIntegralWN(), ROOT::Math::GoFTest::AndersonDarling2SamplesTest(), areEqualValues(), RooMinimizerFcn::BackProp(), TSelectorDraw::Begin(), begin_request_handler(), ROOT::Math::KelvinFunctions::Bei(), ROOT::Math::KelvinFunctions::Ber(), TAlienMasterJobStatus::Browse(), TAlienJobStatus::Browse(), TTableSorter::BSearch(), RooProdPdf::calculate(), TMVA::MethodFDA::CalculateMulticlassValues(), TMVA::VariablePCATransform::CalculatePrincipalComponents(), ROOT::Vc::AVX::Vector< T >::callWithValuesSorted(), ROOT::Vc::SSE::Vector< T >::callWithValuesSorted(), TSQLStructure::ChangeValueOnly(), TFilePrefetch::CheckBlockInCache(), TGeoChecker::CheckGeometryFull(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::ChiSquare(), clamp(), ClassImp(), TGDMLParse::ConProcess(), TMVA::Event::CopyVarValues(), TEveCaloDataHist::DataChanged(), TRootSniffer::DecodeUrlOptionValue(), TSQLStructure::DefineObjectId(), TRootContextMenu::Dialog(), TEveDigitSet::DigitValue(), TFormula::DoAddParameter(), TEveManager::DoRedraw3D(), RooStats::MCMCIntervalPlot::DrawParameterVsTime(), EscInit(), RooRealSumPdf::evaluate(), RooAddModel::evaluate(), RooAddPdf::evaluate(), RooParametricStepFunction::evaluate(), RooRealMPFE::evaluate(), ParamHistFunc::evaluate(), TMVA::Event::Event(), PyROOT::TCppObjectByValueExecutor::Execute(), PyROOT::TCppObjectBySmartPtrExecutor::Execute(), PyROOT::TCppObjectBySmartPtrPtrExecutor::Execute(), PyROOT::TCppObjectBySmartPtrRefExecutor::Execute(), TQRootDialog::ExecuteMethod(), TLeafF::Export(), TLeafI::Export(), TLeafL::Export(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::FDist(), BaseSelectionRule::FillCache(), ROOT::Fit::FillData(), RooFitResult::fillLegacyCorrMatrix(), fillSparse(), fit2DHist(), fit3DHist(), fitSparse2D(), fitSparse3D(), TMVA::TNeuron::ForceValue(), ROOT::FromHumanReadableSize(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::Gamma(), TGridJDL::Generate(), TZIPFile::Get(), TZIPFile::Get64(), XMLReader::GetAttributes(), TTreeSQL::GetColumnIndice(), TMVA::VariableGaussTransform::GetCumulativeDist(), TGridJDL::GetDescription(), TDataSetManager::GetGroupQuota(), TH1::GetMaximum(), TH1::GetMaximumBin(), TH1::GetMinimum(), TH1::GetMinimumBin(), TMVA::QuickMVAProbEstimator::GetMVAProbAt(), TFitter::GetParameter(), TFitter::GetParError(), GetRomanIndex(), TTimeStamp::GetTimeSpec(), TGridJDL::GetValue(), TNeuron::GetValue(), RooAbsCachedPdf::getValV(), gl2psDrawImageMap(), TColor::HSV2RGB(), TPython::Import(), TDataMember::Init(), TPostScript::Initialize(), ROOT::Math::GenAlgoOptions::InsertValue(), TString::Itoa(), ROOT::Math::KelvinFunctions::Kei(), ROOT::Math::KelvinFunctions::Ker(), TString::LLtoa(), TPython::LoadMacro(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::LogNormal(), ROOT::Math::KelvinFunctions::M(), mg_start(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::MultiNomial(), THnBase::Multiply(), ROOT::Math::KelvinFunctions::N(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::NegativeBinomial(), TAlienFile::Open(), TFile::OpenFromCache(), TGeoBranchArray::operator!=(), ROOT::Internal::FillBinCoord_t< I, COORD, AXES >::operator()(), TGeoBranchArray::operator<(), operator<<(), TGeoBranchArray::operator<=(), RooInt::operator=(), RooDouble::operator=(), TGeoBranchArray::operator==(), TGeoBranchArray::operator>(), TGeoBranchArray::operator>=(), TXMLEngine::OutputValue(), THistPainter::PaintText(), THistPainter::PaintTH2PolyText(), XMLReader::Parse(), parse_auth_header(), TUrl::ParseOptions(), ROOT::ParseRule(), TArchiveFile::ParseUrl(), TAlienMasterJobStatus::PercentFinished(), TSQLStructure::PerformConversion(), ROOT::Math::KelvinFunctions::Phi(), RooStats::HistFactory::FlexibleInterpVar::PolyInterpValue(), TAlienMasterJobStatus::Print(), ROOT::Minuit2::MnPrint::PrintFcn(), TAlienJobStatus::PrintJob(), TLeafF::PrintValue(), TLeafD::PrintValue(), TLeafB::PrintValue(), TLeafO::PrintValue(), TLeafS::PrintValue(), TLeafC::PrintValue(), TLeafI::PrintValue(), TLeafL::PrintValue(), TTreeFormula::PrintValue(), TFormula::ProcessFormula(), TEveSceneList::ProcessSceneChanges(), TProcPool::ProcTree(), TMVA::GeneticRange::RandomDiscrete(), TMVA::Tools::ReadAttr(), TLeafF::ReadBasketExport(), TLeafI::ReadBasketExport(), TLeafL::ReadBasketExport(), TProofResourcesStatic::ReadConfigFile(), TSQLFile::ReadConfigurations(), RooErrorVar::readFromStream(), RooRealVar::readFromStream(), XrdProofGroupMgr::ReadPriorities(), TLeafD::ReadValue(), TLeafF::ReadValue(), TLeafB::ReadValue(), TLeafS::ReadValue(), TLeafO::ReadValue(), TLeafI::ReadValue(), TLeafL::ReadValue(), TBufferSQL2::ReadVersion(), RooStats::HypoTestInverter::RebuildDistributions(), TProcPool::Reduce(), returnConstant(), returnConstantOffset(), returnConstantOffset2(), RooRealVar::RooRealVar(), TMVA::PDEFoam::RootPlot2dim(), RooStats::NumberCountingPdfFactory::SafeObservableCreation(), TFilePrefetch::SaveBlockInCache(), TRootSniffer::ScanObjectProperties(), TGeoChecker::Score(), RooHistError::seek(), RooAbsCollection::selectByAttrib(), RooRealMPFE::serverLoop(), ROOT::Fit::BinPoint::Set(), TGQuartz::SetAA(), ROOT::v5::TFormula::SetAction(), RooDataHist::setAllWeights(), RooAbsArg::setAttribute(), RooAbsCategoryLValue::setConstant(), RooAbsRealLValue::setConstant(), TF2::SetContourLevel(), TH1::SetContourLevel(), TMVA::ConvergenceTest::SetCurrentValue(), RooCmdArg::setDouble(), TODBCStatement::SetDouble(), RooRealVar::setError(), ROOT::Minuit2::FumiliFCNBase::SetFCNValue(), TRootSnifferStoreXml::SetField(), TPad::SetGridx(), TPad::SetGridy(), RooCmdArg::setInt(), TODBCStatement::SetInt(), TPad::SetLogx(), TPad::SetLogy(), TPad::SetLogz(), TODBCStatement::SetLong(), TODBCStatement::SetLong64(), TGX11::SetMWMHints(), TGMainFrame::SetMWMHints(), RooCmdArg::setObject(), TProofResourcesStatic::SetOption(), TMVA::VariableTransformBase::SetOutput(), TF1Parameters::SetParameter(), TFumili::SetParameter(), TFormula::SetParameter(), TDocDirective::SetParameters(), RooStats::HistFactory::Asimov::SetParamValue(), RooStats::HistFactory::Measurement::SetParamValue(), RooMinimizerFcn::SetPdfParamVal(), RooMinuit::setPdfParamVal(), TFPBlock::SetPos(), RooAbsIntegrator::setPrintEvalCounter(), ROOT::Fit::BinData::SetRefVolume(), ClassSelectionRule::SetRequestOnlyTClass(), ClassSelectionRule::SetRequestPrivate(), ClassSelectionRule::SetRequestProtected(), TF1::SetSavedPoint(), TWinNTSystem::SetSockOpt(), TMVA::Event::SetSpectator(), RooCmdArg::setString(), RooAbsArg::setStringAttribute(), TCling::SetSuspendAutoParsing(), TMVA::Event::SetTarget(), TPad::SetTickx(), TPad::SetTicky(), TSQLiteStatement::SetTimestamp(), RooAbsPdf::setTraceCounter(), TODBCStatement::SetUInt(), TODBCStatement::SetULong64(), TEveCaloViz::SetupColorHeight(), TProofServ::SetupCommon(), RooRealVar::setValFast(), TMVA::ResultsClassification::SetValue(), TMVA::ResultsRegression::SetValue(), TMVA::ResultsMulticlass::SetValue(), TSQLStructure::SetValue(), TFormula::SetVariable(), ROOT::Minuit2::similarity(), TBufferSQL2::SqlReadArraySize(), TBufferSQL2::SqlWriteObject(), TSQLStructure::StoreElementInNormalForm(), TSQLStructure::StoreTString(), ROOT::Math::RandomFunctions< EngineType, DefaultEngineType >::tDist(), TBits::TestBitNumber(), testIntegration(), TGraph::TGraph(), TGraph2D::TGraph2D(), TGraphErrors::TGraphErrors(), TGX11::TGX11(), ROOT::Math::KelvinFunctions::Theta(), PyROOT::TVoidArrayConverter::ToMemory(), PyROOT::TCppObjectConverter::ToMemory(), PyROOT::TCppObjectPtrConverter< ISREFERENCE >::ToMemory(), RooAbsString::traceEval(), RooAbsCategory::traceEval(), RooAbsReal::traceEval(), TMVA::MethodLikelihood::Train(), PyROOT::TTreeGetAttr(), TString::UItoa(), TString::ULLtoa(), TCling::UpdateEnumConstants(), TXMLEngine::ValidateVersion(), RooRealConstant::value(), TBufferXML::XmlWriteBasic(), TGWin32::~TGWin32(), and TGX11::~TGX11().