WEBVTT

00:00:00.000 --> 00:00:03.334
A smooth polynomial should have finite derivatives.

00:00:03.334 --> 00:00:06.667
In Apple’s MLX, the second derivative can be NaN.

00:00:07.200 --> 00:00:10.608
Sum the cumulative products of three inputs.

00:00:10.608 --> 00:00:14.016
The result is a + ab + abc.

00:00:14.533 --> 00:00:18.622
At [0, 2, 3], the first gradient is correct.

00:00:18.622 --> 00:00:22.710
Differentiate again: one Hessian column becomes NaN.

00:00:23.233 --> 00:00:26.326
The backward graph still divides by the input.

00:00:26.326 --> 00:00:29.419
A division-free recurrence avoids that problem in these tests.

00:00:29.933 --> 00:00:34.199
The prototype passes 57 scenarios and 311 checks.

00:00:34.199 --> 00:00:38.464
44 scenarios failed before.

00:00:38.967 --> 00:00:43.691
This prototype costs O(N log N) work. Large-array performance is untested.

00:00:43.691 --> 00:00:48.415
The prior first-gradient fix is credited. Code and sources are linked.

