Monte Carlo and Simpson method v0.1.0 Integral View Source

Documentation for Integral.

Link to this section Summary

Functions

Monte carlo integration method.

Simpson integration method.

Link to this section Functions

Link to this function

monte_carlo_method(f, from, to, n \\ 10000)

View Source

Monte carlo integration method.

Examples

iex> Integral.monte_carlo_method(fn x -> x end, 0, 10)
50.06474343307806
Link to this function

simpson_method(f, from, to, n \\ 10000)

View Source

Simpson integration method.

Examples

iex> Integral.simpson_method(fn x -> x end, 0, 10)
50.00000000000001