Skip to content

Commit d1db8a7

Browse files
committed
change semantics of even in simps* spec
1 parent b7b273b commit d1db8a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stdlib_experimental_quadrature.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ end program
8282

8383
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`.
8484

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.
8686

8787
### Syntax
8888

@@ -98,15 +98,15 @@ Simpson's rule is defined for odd-length arrays only. For even-length arrays, an
9898

9999
`dx`: Shall be a scalar of type `real` having the same kind as `y`.
100100

101-
`even`: (Optional) Shall be a scalar integer of default kind. Its default value is `1`.
101+
`even`: (Optional) Shall be a default-kind `integer`.
102102

103103
### Return value
104104

105105
The result is a scalar of type `real` having the same kind as `y`.
106106

107107
If the size of `y` is zero or one, the result is zero.
108108

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.
110110

111111
### Example
112112

@@ -116,7 +116,7 @@ TBD
116116

117117
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.
118118

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.
120120

121121
### Syntax
122122

@@ -126,7 +126,7 @@ Simpson's rule is defined for odd-length arrays only. For even-length arrays, an
126126

127127
`x`: Shall be a rank-one array of type `real`.
128128

129-
`even`: (Optional) Shall be a scalar integer of default kind. Its default value is `1`.
129+
`even`: (Optional) Shall be a default-kind `integer`.
130130

131131
### Return value
132132

0 commit comments

Comments
 (0)