NProduct

NProduct[f,{i,imin,imax}]

gives a numerical approximation to the product .

NProduct[f,{i,imin,imax,di}]

uses a step di in the product.

Details and Options

  • NProduct can be used for products with both finite and infinite limits.
  • NProduct[f,{i,},{j,},] can be used to evaluate multidimensional products.
  • The following options can be given:
  • AccuracyGoalInfinitynumber of digits of final accuracy sought
    EvaluationMonitor Noneexpression to evaluate whenever f is evaluated
    Method Automaticmethod to use
    PrecisionGoalAutomaticnumber of digits of final precision sought
    VerifyConvergence Truewhether to explicitly test for convergence
    WorkingPrecision MachinePrecisionthe precision used in internal computations
  • Possible settings for the Method option include:
  • "EulerMaclaurin"EulerMaclaurin summation method
    "WynnEpsilon"Wynn epsilon extrapolation method
  • With the EulerMaclaurin method, the options AccuracyGoal and PrecisionGoal can be used to specify the accuracy and precision to try and get in the final answer. NProduct stops when the error estimates it gets imply that either the accuracy or precision sought has been reached.
  • You should realize that in sufficiently pathological cases, the algorithms used by NProduct can give wrong answers. In most cases, you can test the answer by looking at its sensitivity to changes in the setting of options for NProduct.
  • VerifyConvergence is only used for products with infinite limits.
  • N[Product[]] calls NProduct.
  • NProduct first localizes the values of all variables, then evaluates f with the variables being symbolic, and then repeatedly evaluates the result numerically.
  • NProduct has attribute HoldAll, and effectively uses Block to localize variables.

Examples

open allclose all

Basic Examples  (1)

Approximate an infinite product numerically:

The error versus the exact value of :

Scope  (5)

Approximate the value of a finite product:

This is effectively the ratio of two infinite products:

Approximate a multidimensional product:

Approximate a multidimensional product with the second index depending on the first:

Complex infinite product approximation:

Multiply the even factors of an infinite product:

An equivalent way of specifying the same multiplication:

Options  (8)

AccuracyGoal and PrecisionGoal  (1)

Approximate a product with the default tolerances:

Find the error versus the exact value:

The error with smaller absolute and relative tolerances:

The error with larger absolute and relative tolerances:

EvaluationMonitor  (3)

Get the number of evaluation points used in a product approximation:

The evaluation points used in a product approximated by an integration method:

The evaluation points used in a product approximated by a sequence extrapolation method:

Method  (1)

Use the Wynn epsilon method to approximate an infinite product:

Compare to the exact value:

The error is smaller with the default method:

NProductFactors  (1)

By default NProduct uses 15 factors at the beginning before approximating the tail:

The error for this example is large because the factors peak at 20:

Increasing NProductFactors to include this feature improves the approximation:

VerifyConvergence  (1)

By default the factor's convergence is verified:

Generally, if the convergence is not verified the computation is faster:

WorkingPrecision  (1)

Use higher precision to get a better approximation:

Find the error versus the exact value:

Applications  (2)

Estimate the infinite product of a BesselJ sequence:

Use a product representation to approximate the Sin function:

Properties & Relations  (2)

Use Product to compute exact formulas:

The results of Product and NProduct agree closely:

A product is equivalent to the exponential of a sum of logarithms of factors:

Possible Issues  (2)

NProduct may not detect divergence for some infinite products:

Convergence verification is based on a ratio test that is inconclusive when equal to 1:

You should realize that in sufficiently pathological cases, the algorithms used by NProduct can give wrong answers:

Compare to the result from Product:

One option is increasing the WorkingPrecision and NProductFactors:

Wolfram Research (1988), NProduct, Wolfram Language function, https://reference.wolfram.com/language/ref/NProduct.html (updated 2003).

Text

Wolfram Research (1988), NProduct, Wolfram Language function, https://reference.wolfram.com/language/ref/NProduct.html (updated 2003).

CMS

Wolfram Language. 1988. "NProduct." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/NProduct.html.

APA

Wolfram Language. (1988). NProduct. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NProduct.html

BibTeX

@misc{reference.wolfram_2024_nproduct, author="Wolfram Research", title="{NProduct}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/NProduct.html}", note=[Accessed: 12-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_nproduct, organization={Wolfram Research}, title={NProduct}, year={2003}, url={https://reference.wolfram.com/language/ref/NProduct.html}, note=[Accessed: 12-November-2024 ]}