@@ -18,7 +18,7 @@ So what rule should we write for this case?
1818The obvious answer, would be to write a rule that throws an error if input at a point where calculus says the derivative is not defined.
1919Another option is to return some error signally value like ` NaN ` .
2020Which you * can* do.
21- However, this is not useful.
21+ However, there is no where to go with an error, the user still wants a derivative; so this is not useful.
2222
2323Let us explore what is useful:
2424# Case Studies
@@ -65,9 +65,10 @@ plot(x-> x < 0 ? x : 5x)
6565```
6666
6767Here was have 3 main options, all are good.
68- We could say there derivative at 0 is
68+
69+ We could say there derivative at 0 is:
6970 - 1: which agrees with backwards finite differencing
70- - 5: which agrees with fowards finite differencing
71+ - 5: which agrees with forwards finite differencing
7172 - 3: which is the mean of ` [1, 5] ` , and agrees with central finite differencing
7273
7374All of these options are perfectly nice members of the [ subderivative] ( https://en.wikipedia.org/wiki/Subderivative ) .
@@ -80,6 +81,13 @@ Saying it is `3` is the arguably the nicest, but it is also the most expensive t
8081plot(ceil)
8182```
8283
84+ Here it seems most useful to say the derivative is zero everywhere.
85+ The limits are zero from both sides.
86+
87+ The other option for ` ceil ` would be to say it is 1 everywhere.
88+ But that it too weird, if the use wanted a relaxation of the problem then they would provide one.
89+ Imposing one on ` ceil ` for everyone is not reasonable.
90+
8391### Primal finite, and derivative nonfinite and same on both sides
8492
8593``` @example nondiff
0 commit comments