Skip to content

Instantly share code, notes, and snippets.

@yassu
Created December 18, 2016 05:04
Show Gist options
  • Save yassu/3eb864c60a3a9983259a9da7102b1b68 to your computer and use it in GitHub Desktop.
Save yassu/3eb864c60a3a9983259a9da7102b1b68 to your computer and use it in GitHub Desktop.
fn sgn(x: f32) -> f32 {
x/x.abs()
}
fn get_y(x: f32) -> f32 {
1.0/(1.0 + sgn(x)) + 1.0/(1.0-sgn(x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment