Skip to content

Instantly share code, notes, and snippets.

@angs angs/laplace.hs Secret
Last active Nov 7, 2016

Embed
What would you like to do?
import Data.List --for zipWith4
p f l h n=head.dropWhile((>1e-9).r).iterate j$0<$[1..n]
where
m=[0..]!!n
b=map((/(m-1)^2).f.(/(m-1)))[0..m-1]
r u=sqrt.sum.map(^2).tail$zipWith4(\a b c d->a+b+d-2*c)b(tail u)u(0:u)
j u=l:(tail$zipWith3(\a b c->0.5*(a+b+c))b(tail u)(0:u))++[h]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.