The package NumericalQuadrature
implements several operations for numerical integration. Here I provide just some examples. Documentation is to be found in the corresponding .spad
or .pamphlet
file.
fricas
(1) -> romberg(x+->exp(x),0.0,1.0,0.1,0.1,6,10)
Type: Record(value: Float,error: Float,totalpts: Integer,success: Boolean)
fricas
simpson(x+->exp(x),0.0,1.0,0.1,0.1,6,10)
Type: Record(value: Float,error: Float,totalpts: Integer,success: Boolean)
fricas
trapezoidal(x+->exp(x),0.0,1.0,0.1,0.1,6,10)
Type: Record(value: Float,error: Float,totalpts: Integer,success: Boolean)
Note that for some reason
fricas
%pi::Float
Type: Float
works, while
fricas
%e::Float
Cannot convert the value from type Expression(Integer) to Float .
fails. You have to use
fricas
exp(1)$Float
Type: Float
instead.