# code for Simpson's rule

## Primary tabs

Type of Math Object:
Algorithm
Major Section:
Reference
Groups audience:

## Mathematics Subject Classification

### codes for algorithms

I thought it would be a nice idea having examples of coding some of algorithms in here, but instead of creating 20 pages for each major language, it'd be better to post all versions into a single page

I've written this one in python, but if anyone else wants to add some other languages, could be meerged with this entry. Just remember
*CLARITY and SIMPLICITY* over optimizations and language-specific tricks.

It's much better to have code which can be read and understood, even if it's not the most efficient way.

Ah, and about the bug of autolinking happeningg inside verbatim, I'm about to fill a bug report on that (I couldn't find a getaround)
f
G -----> H G
p \ /_ ----- ~ f(G)
\ / f ker f
G/ker f

### Re: codes for algorithms

the integral can be done algebraically to get the "actual" actual value.

### Re: codes for algorithms

I agree the actual value is not the actual vallue I should correct that
f
G -----> H G
p \ /_ ----- ~ f(G)
\ / f ker f
G/ker f

### disabling autolinks on an entry?

I guess I could fi x this entry by adding manual linkstops, but it will break again whenever a new link (say a new entry mentioning a term) is created, and I cannto be watching over this entry (and other code-related ones I intend to create) all the time.

so, any idea how to make autolinks not wok at all?
f
G -----> H G
p \ /_ ----- ~ f(G)
\ / f ker f
G/ker f

### Re: disabling autolinks on an entry?

Perhaps \PMlinkescapetext the whole entry, just take care with formatting instructions (formatting commands render only when set outside of \PMlinkescapetext.

--
"Do not meddle in the affairs of wizards for they are subtle and quick to anger."

### Re: disabling autolinks on an entry?

yes, that's the problem
I need to use verbatim environments, which stop the rendering of autolinks
so when viewwing the rendering, not only a link is NOT created, but also the commands that would create the link are inserted and displayed mixed with the code

and I can't use verbatim INSIDE the pm-pseudo latex commands as stated in the documentation

f
G -----> H G
p \ /_ ----- ~ f(G)
\ / f ker f
G/ker f

### Re: disabling autolinks on an entry?

Can you use link controlling within verbatim? Like when you want something in italics not to be linked you write
and it works.

--
"Do not meddle in the affairs of wizards for they are subtle and quick to anger."

### Re: disabling autolinks on an entry?

Yes, I just tried it. It should work by just writing
\begin{verbatim}
bar
}
\end{verbatim}

--
"Do not meddle in the affairs of wizards for they are subtle and quick to anger."

### Re: disabling autolinks on an entry?

it ALMOST works, except by showing the PMlinkescape command as if it were part of the code (i.e. not hidden during rendering)
check the entry on which this thread is attached to see
f
G -----> H G
p \ /_ ----- ~ f(G)
\ / f ker f
G/ker f