File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1111 # # sin
1212 function rrule (:: typeof (sin), x:: CommutativeMulNumber )
1313 sinx, cosx = sincos (x)
14- sin_pullback (Δy) = (NoTangent (), cosx' * Δy)
14+ project_x = ProjectTo (x)
15+ sin_pullback (Δy) = (NoTangent (), project_x (cosx' * Δy))
1516 return (sinx, sin_pullback)
1617 end
1718
2324 # # cos
2425 function rrule (:: typeof (cos), x:: CommutativeMulNumber )
2526 sinx, cosx = sincos (x)
26- cos_pullback (Δy) = (NoTangent (), - sinx' * Δy)
27+ project_x = ProjectTo (x)
28+ cos_pullback (Δy) = (NoTangent (), - project_x (sinx' * Δy))
2729 return (cosx, cos_pullback)
2830 end
2931
6163 project_x = ProjectTo (x)
6264 function inv_pullback (ΔΩ)
6365 Ω′ = conj (Ω)
64- return NoTangent (), project_x (Ω′ * - ΔΩ * Ω′)
66+ return NoTangent (), - project_x (Ω′ * ΔΩ * Ω′)
6567 end
6668 return Ω, inv_pullback
6769 end
You can’t perform that action at this time.
0 commit comments