File: hypergeometric_mac.mac

package info (click to toggle)
maxima-sage 5.45.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 113,788 kB
  • sloc: lisp: 440,833; fortran: 14,665; perl: 14,369; tcl: 10,997; sh: 4,475; makefile: 2,520; ansic: 447; python: 262; xml: 59; awk: 37; sed: 17
file content (21 lines) | stat: -rw-r--r-- 720 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
Copyright 2009 by Barton Willis

  This is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License,
  http://www.gnu.org/copyleft/gpl.html.

 This software has NO WARRANTY, not even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/


/* Apply the hgfred simplifications. */

hypergeometric_simp(e) := block([sublis_apply_lambda : true], 
  e : sublis(['hypergeometric = lambda([a,b,x], hgfred(a,b,x))], e),
  subst(['%f = lambda([[s]], hypergeometric)], e));

/* Convert x to a float; if float fails (say overflow), convert to a big float. */
safe_float(x) := block([y : errcatch(float(x))],
 if y = [] then bfloat(x) else first(y));