Numerical integration: Difference between revisions
Content deleted Content added
→{{header|J}}: use symbols |
→{{header|J}}: simplify |
||
Line 843: | Line 843: | ||
) |
) |
||
rectangle=: adverb |
rectangle=: adverb def 'u -: +/ y' |
||
u -: +/ y |
|||
) |
|||
trapezium=: adverb |
trapezium=: adverb def '-: +/ u y' |
||
-: +/ u y |
|||
) |
|||
simpson=: adverb |
simpson =: adverb def '6 %~ 1 1 4 +/ .* u y, -:+/y'</lang> |
||
(6 %~ [: +/ 4&*@u@-:@(+/) , u) y |
|||
)</lang> |
|||
'''Example usage'''<br> |
'''Example usage'''<br> |
||
Integrate <code>square</code> (<code>*:</code>) from 0 to π in 10 steps using various methods. |
Integrate <code>square</code> (<code>*:</code>) from 0 to π in 10 steps using various methods. |