Ok I found a solution, for the case someone else also needs it:

var collected_summands = new HashSet();

var symbols = Structure.CollectIdentifiers(multivariate_poly);

var summands = Algebraic.Summands(multivariate_poly);

double offset = 0.0;

Dictionary<Expr, Expr> factors = new Dictionary<Expr, Expr>();

foreach (var summand in summands)

{

if (Structure.CollectIdentifiers(summand).IsEmpty) //there is no symbol so its just a value

{

offset += MathNet.Symbolics.Evaluate.Evaluate(new Dictionary<string, FloatingPoint>(), summand).RealValue;

}

}

foreach (var symbol in symbols)

{

foreach (var summand in summands)

{

var identifiers = Structure.CollectIdentifiers(summand);

if (identifiers.Contains(symbol) && !collected_summands.Contains(summand)) //only these summands that contain the variable interest us

{

collected_summands.Add(summand); //commenting this line out will lead to factors[a]=b and factors[b]=a for a summand a*b instead of just one of them added to factors.

if (factors.ContainsKey(symbol)) //we already have a factor? then add the new one divided by the factor we are looking at

{

factors[symbol] = factors[symbol] + (summand / symbol);

}

else //else we just add the new factor

{

factors[symbol] = (summand / symbol);

}

}

}

}

//testing it:

Expr reconstruct_poly = Expr.Real(offset);

foreach (var symbol in symbols)

{

reconstruct_poly += symbol * factors[symbol];

}

Expr check = Rational.Simplify("", multivariate_poly - reconstruct_poly);

if (MathNet.Symbolics.Evaluate.Evaluate(new Dictionary<string, FloatingPoint>(), check).RealValue != 0)

{

throw new Exception(“reconstruction by factors not equal with the polynomial we extracted a factor-interpretation from.”);

}

Best regards,

Patrick