#include #include #include namespace Poincare { Expression NormalDistributionFunctionNode::shallowReduce(ReductionContext reductionContext) { return NormalDistributionFunction(this).shallowReduce(reductionContext.context()); } Expression NormalDistributionFunction::shallowReduce(Context * context, bool * stopReduction) { if (stopReduction != nullptr) { *stopReduction = true; } { Expression e = Expression::defaultShallowReduce(); if (e.isUndefined()) { return e; } } Expression mu = childAtIndex(1); Expression var = childAtIndex(2); // Check mu and var bool muAndVarOK = false; bool couldCheckMuAndVar = NormalDistribution::ExpressionParametersAreOK(&muAndVarOK, mu, var, context); if (!couldCheckMuAndVar) { return *this; } if (!muAndVarOK) { return replaceWithUndefinedInPlace(); } if (stopReduction != nullptr) { *stopReduction = false; } return *this; } }