Created
February 2, 2020 20:06
-
-
Save jakevossen5/ae3321742556e53d40b7585469c740d5 to your computer and use it in GitHub Desktop.
Haskell Riemann Sum implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do_integral :: (Ord p, Num p, Fractional p) => (p -> p) -> p -> p -> p -> p | |
do_integral f start end dx | |
| end <= start = 0 | |
| otherwise = (height * dx) + do_integral f (start + dx) end dx | |
where | |
height = f (start + (dx / 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment