No reason to cast as double and then cast as sparse
Dead code
Precalc to speed up recursive differentiation