Simple example Consider simple algorithm y(x0, x1) contrived for didactic purposes: Implemented in C or Fortran90 as:
{"Image DocumentName": "Simple exampleConsider simple algorithm y(x0, x1) contrived for didactic purposes: Implemented in C or Fortran90 as:", "Image ImageDescription": "Task: given \u2202J/\u2202y, we want to compute \u2202J/\u2202x0 and \u2202J/\u2202x1. function algorithm(x) result(y) implicit none. real, intent(in) :: x(2) real :: y. real :: s. y = 4.0. s = 2.0 x(1) + 3.0 x(2) x(2) y = y   sin(s) return. endfunction. double algorithm(const double x[2]) { double y = 4.0; double s = 2.0 x[0] + 3.0 x[1] x[1]; y  = sin(s); return y; }", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}