AngouriMath

Navigation

← Back to list of members

Product​(AngouriMath.​Entity,​AngouriMath.​Entity,​AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

A product of expr as var runs from
from to to inclusive. Mirrors
Sum(AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Entity), with an empty range multiplying to
1.

Parameter "expr"

The factor. It may mention var.

Parameter "var"

The index, which this binds.

Parameter "from"

The first value of the index.

Parameter "to"

The last value of the index, inclusive.

Returns

The product written out where the bounds are concrete integers and there are not too
many terms; a closed form where the factor is a monomial in the index — a
narrower class than the sum's, a product having no linearity to take a sum of terms
apart with; and an unevaluated node otherwise.

Remarks

The closed form's condition is to >= from rather than the sum's
to >= from - 1: at the empty range itself it would be c ^ 0, which is
undefined at c = 0 where the empty product is 1. Where the index is in
the factor the lower bound must be a concrete integer of at least one, since the
answer is a ratio of factorials and factorial has no value at the negative
integers.

Example

using System;
using AngouriMath;
using static AngouriMath.MathS;
            
Console.WriteLine(Product("k", "k", 1, 5).Simplify());

Prints
120

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online