Skip to content

Instantly share code, notes, and snippets.

@aherve
Created November 23, 2016 15:05
Show Gist options
  • Select an option

  • Save aherve/ec17fcfd2aa7a93175b6110f9ff41afe to your computer and use it in GitHub Desktop.

Select an option

Save aherve/ec17fcfd2aa7a93175b6110f9ff41afe to your computer and use it in GitHub Desktop.
derivative_of_square = nth_derivator.(1).(square) #derivate one time
second_derivative_of_square = nth_derivator.(2).(square) #derivate two times
third_derivative_of_square = nth_derivator.(3).(square) #derivate three times
p derivative_of_square.(3) # => 5.999999999999339
p second_derivative_of_square.(3) # => 2.000000000279556
p third_derivative_of_square.(3) # => 0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment