Skip to content

Instantly share code, notes, and snippets.

@mwufi
Created April 12, 2018 01:41
Show Gist options
  • Save mwufi/22a9fbbbf58de7123a7299d45487f05b to your computer and use it in GitHub Desktop.
Save mwufi/22a9fbbbf58de7123a7299d45487f05b to your computer and use it in GitHub Desktop.
m <- function(x){
if (-1 <= x && x < -0.5)
(x+2)^2/2
else if (x < 0)
x/2 + 0.875
else if (x < 0.5)
-5*(x-0.2)^2 + 1.075
else if (x < 1)
x + 0.125
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment