Don't use fname to define functions
[maxima.git] / src / numerical / slatec / derf.lisp
blob3afda5235f166c85132228b1c2fcb9cbdb6068d4
1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
3 ;;; "f2cl2.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
4 ;;; "f2cl3.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
5 ;;; "f2cl4.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
6 ;;; "f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v fceac530ef0c 2011/11/26 04:02:26 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2012-04 (20C Unicode)
11 ;;;
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':simple-array)
14 ;;; (:array-slicing nil) (:declare-common nil)
15 ;;; (:float-format double-float))
17 (in-package :slatec)
20 (let ((nterf 0)
21 (xbig 0.0)
22 (sqeps 0.0)
23 (erfcs
24 (make-array 21
25 :element-type 'double-float
26 :initial-contents '(-0.049046121234691806
27 -0.14226120510371365
28 0.010035582187599796
29 -5.768764699767485e-4
30 2.741993125219606e-5
31 -1.1043175507344507e-6
32 3.8488755420345036e-8
33 -1.1808582533875466e-9
34 3.2334215826050907e-11
35 -7.991015947004549e-13
36 1.7990725113961456e-14
37 -3.718635487818693e-16
38 7.103599003714253e-18
39 -1.2612455119155226e-19
40 2.0916406941769294e-21
41 -3.2539731029314073e-23
42 4.766867209797675e-25
43 -6.598012078285134e-27
44 8.655011469963763e-29
45 -1.0788925177498064e-30
46 1.2811883993017003e-32)))
47 (sqrtpi 1.772453850905516)
48 (first$ nil))
49 (declare (type (f2cl-lib:integer4) nterf)
50 (type (double-float) xbig sqeps sqrtpi)
51 (type (simple-array double-float (21)) erfcs)
52 (type f2cl-lib:logical first$))
53 (setq first$ f2cl-lib:%true%)
54 (defun derf (x)
55 (declare (type (double-float) x))
56 (prog ((y 0.0) (derf 0.0))
57 (declare (type (double-float) derf y))
58 (cond
59 (first$
60 (setf nterf
61 (initds erfcs 21
62 (* 0.1f0 (f2cl-lib:freal (f2cl-lib:d1mach 3)))))
63 (setf xbig
64 (f2cl-lib:fsqrt
65 (- (f2cl-lib:flog (* sqrtpi (f2cl-lib:d1mach 3))))))
66 (setf sqeps (f2cl-lib:fsqrt (* 2.0 (f2cl-lib:d1mach 3))))))
67 (setf first$ f2cl-lib:%false%)
68 (setf y (abs x))
69 (if (> y 1.0) (go label20))
70 (if (<= y sqeps) (setf derf (/ (* 2.0 x) sqrtpi)))
71 (if (> y sqeps)
72 (setf derf (* x (+ 1.0 (dcsevl (- (* 2.0 x x) 1.0) erfcs nterf)))))
73 (go end_label)
74 label20
75 (if (<= y xbig) (setf derf (f2cl-lib:sign (- 1.0 (derfc y)) x)))
76 (if (> y xbig) (setf derf (f2cl-lib:sign 1.0 x)))
77 (go end_label)
78 end_label
79 (return (values derf nil)))))
81 (in-package #:cl-user)
82 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
83 (eval-when (:load-toplevel :compile-toplevel :execute)
84 (setf (gethash 'fortran-to-lisp::derf fortran-to-lisp::*f2cl-function-info*)
85 (fortran-to-lisp::make-f2cl-finfo :arg-types '((double-float))
86 :return-values '(nil)
87 :calls '(fortran-to-lisp::derfc
88 fortran-to-lisp::dcsevl
89 fortran-to-lisp::initds
90 fortran-to-lisp::d1mach))))