You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/stdlib_experimental_quadrature.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ end program
82
82
83
83
Returns the Simpson's rule integral of an array `y` representing discrete samples of a function. The integral is computed assuming either equidistant abscissas with spacing `dx` or arbitary abscissas `x`.
84
84
85
-
Simpson's rule is defined for odd-length arrays only. For even-length arrays, an optional argument `even` may be used to specify at which index to replace Simpson's rule with Simpson's 3/8 rule. The 3/8 rule will be used for the array section `y(even:even+4)` and the ordinary Simpon's rule will be used elsewhere.
85
+
Simpson's ordinary ("1/3") rule is used for odd-length arrays. For even-length arrays, Simpson's 3/8 rule is also utilized in a way that depends on the value of `even`. If `even` is negative (positive), the 3/8 rule is used at the beginning (end) of the array. If `even` is zero or not present, the result is as if the 3/8 rule were first used at the beginning of the array, then at the end of the array, and these two results were averaged.
86
86
87
87
### Syntax
88
88
@@ -98,15 +98,15 @@ Simpson's rule is defined for odd-length arrays only. For even-length arrays, an
98
98
99
99
`dx`: Shall be a scalar of type `real` having the same kind as `y`.
100
100
101
-
`even`: (Optional) Shall be a scalar integer of defaultkind. Its default value is `1`.
101
+
`even`: (Optional) Shall be a default-kind`integer`.
102
102
103
103
### Return value
104
104
105
105
The result is a scalar of type `real` having the same kind as `y`.
106
106
107
107
If the size of `y` is zero or one, the result is zero.
108
108
109
-
If the size of `y` is two, the result is the same as if `trapz` had been called instead, regardless of the value of `even`.
109
+
If the size of `y` is two, the result is the same as if `trapz` had been called instead.
110
110
111
111
### Example
112
112
@@ -116,7 +116,7 @@ TBD
116
116
117
117
Given an array of abscissas `x`, computes the array of weights `w` such that if `y` represented function values tabulated at `x`, then `sum(w*y)` produces a Simpson's rule approximation to the integral.
118
118
119
-
Simpson's rule is defined for odd-length arrays only. For even-length arrays, an optional argument `even` may be used to specify at which index to replace Simpson's rule with Simpson's 3/8 rule. The 3/8 rule will be used for the array section `x(even:even+4)` and the ordinary Simpon's rule will be used elsewhere.
119
+
Simpson's ordinary ("1/3") rule is used for odd-length arrays. For even-length arrays, Simpson's 3/8 rule is also utilized in a way that depends on the value of `even`. If `even` is negative (positive), the 3/8 rule is used at the beginning (end) of the array and the 1/3 rule used elsewhere. If `even` is zero or not present, the result is as if the 3/8 rule were first used at the beginning of the array, then at the end of the array, and then these two results were averaged.
120
120
121
121
### Syntax
122
122
@@ -126,7 +126,7 @@ Simpson's rule is defined for odd-length arrays only. For even-length arrays, an
126
126
127
127
`x`: Shall be a rank-one array of type `real`.
128
128
129
-
`even`: (Optional) Shall be a scalar integer of defaultkind. Its default value is `1`.
129
+
`even`: (Optional) Shall be a default-kind`integer`.
0 commit comments