Advertisement
Guest User

Untitled

a guest
May 1st, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (in-package :maxima)
  2.  
  3. (defun pdiff-get-number-args (f)
  4. (let ((z (cdar (member f (cdr $functions) :key #'caar))))
  5. (cond ((and z (every #'symbolp z)) (length z))
  6. ((and (atom f) (or (trigp f) (arcp f) (memq f '(%log %gamma %erf %sqrt mabs)))) 1)
  7. ((memq f '($bessel_i $bessel_j $bessel_k $bessel_y)) 2)
  8. ((or (equal f "^") (equal f ".") (equal f "^^")) 2)
  9. ((and (op-equalp f 'lambda) (every #'symbolp (margs (second f))))
  10. ($length (second f)))
  11. ((and (symbolp f) (get f 'grad)) (length (first (get f 'grad))))
  12. ((eq t ($constantp f)) 'constant-function)
  13. (t nil))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement