2 Copyright 2009 by Barton Willis
4 This is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License,
6 http://www.gnu.org/copyleft/gpl.html.
8 This software has NO WARRANTY, not even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 /* Apply the hgfred simplifications. */
15 hypergeometric_simp(e) := block([sublis_apply_lambda : true],
16 e : sublis(['hypergeometric = lambda([a,b,x], hgfred(a,b,x))], e),
17 subst(['%f = lambda([[s]], hypergeometric)], e));
19 /* Convert x to a float; if float fails (say overflow), convert to a big float. */
20 safe_float(x) := block([y : errcatch(float(x))],
21 if y = [] then bfloat(x) else first(y));