File: hypergeometric_mac.mac

package info (click to toggle)
maxima 5.27.0-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 120,648 kB
  • sloc: lisp: 322,503; fortran: 14,666; perl: 14,343; tcl: 11,031; sh: 4,146; makefile: 2,047; ansic: 471; awk: 24; sed: 10
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));