(defpackage :geff
  (:use :common-lisp :gsl)
  (:export "GEFF-INIT" "GEFF" "HEFF"))

(in-package :geff)

(eval-when (:compile-toplevel :load-toplevel :execute)
  (unless (fboundp 'concat)
    (defmacro concat (&rest args)
      `(concatenate 'string ,@args))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmacro defmnumfun (fun)
  "This redefines the function as a maxima totally numerical function.
If maxima is not loaded it creates a dummy :maxima package."
  (if (not (find-package :maxima))
      (make-package :maxima))
  (let* ((f fun)
	 (mfun (intern (concat "$" (symbol-name f)) (find-package :maxima)))
	 (args (gensym)))
    `(defun ,mfun (&rest ,args)
       (if (every #'numberp ,args)
	   (apply #',f ,args)
	   (cons '(,mfun) ,args)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defparameter +tmin+ 0.6)
(defparameter +tmax+ 1e6)
(defparameter *geff* '(
(    0.60000000E+01 0.10748519E+02)
(    0.80000000E+01 0.10749920E+02)
(    0.10000000E+02 0.10759510E+02)
(    0.12000000E+02 0.10790853E+02)
(    0.14000000E+02 0.10859204E+02)
(    0.16000000E+02 0.10972420E+02)
(    0.18000000E+02 0.11130203E+02)
(    0.20000000E+02 0.11326278E+02)
(    0.22000000E+02 0.11551549E+02)
(    0.24000000E+02 0.11796436E+02)
(    0.26000000E+02 0.12052247E+02)
(    0.28000000E+02 0.12311787E+02)
(    0.30000000E+02 0.12569482E+02)
(    0.32000000E+02 0.12821258E+02)
(    0.34000000E+02 0.13064314E+02)
(    0.36000000E+02 0.13296875E+02)
(    0.38000000E+02 0.13517961E+02)
(    0.40000000E+02 0.13727190E+02)
(    0.42000000E+02 0.13924615E+02)
(    0.44000000E+02 0.14110597E+02)
(    0.46000000E+02 0.14285708E+02)
(    0.48000000E+02 0.14450657E+02)
(    0.50000000E+02 0.14606233E+02)
(    0.52000000E+02 0.14753267E+02)
(    0.54000000E+02 0.14892601E+02)
(    0.56000000E+02 0.15025073E+02)
(    0.58000000E+02 0.15151499E+02)
(    0.60000000E+02 0.15272670E+02)
(    0.62000000E+02 0.15389343E+02)
(    0.64000000E+02 0.15502245E+02)
(    0.66000000E+02 0.15612068E+02)
(    0.68000000E+02 0.15719474E+02)
(    0.70000000E+02 0.15825099E+02)
(    0.72000000E+02 0.15929549E+02)
(    0.74000000E+02 0.16033410E+02)
(    0.76000000E+02 0.16137250E+02)
(    0.78000000E+02 0.16241620E+02)
(    0.80000000E+02 0.16347058E+02)
(    0.82000000E+02 0.16454094E+02)
(    0.84000000E+02 0.16563251E+02)
(    0.86000000E+02 0.16675050E+02)
(    0.88000000E+02 0.16790008E+02)
(    0.90000000E+02 0.16908648E+02)
(    0.92000000E+02 0.17031495E+02)
(    0.94000000E+02 0.17159080E+02)
(    0.96000000E+02 0.17291941E+02)
(    0.98000000E+02 0.17430629E+02)
(    0.10000000E+03 0.17575703E+02)
(    0.10200000E+03 0.17727735E+02)
(    0.10400000E+03 0.17887313E+02)
(    0.10600000E+03 0.18055036E+02)
(    0.10800000E+03 0.18231520E+02)
(    0.11000000E+03 0.18417395E+02)
(    0.11200000E+03 0.18613307E+02)
(    0.11400000E+03 0.18819918E+02)
(    0.11600000E+03 0.19037905E+02)
(    0.11800000E+03 0.19267959E+02)
(    0.12000000E+03 0.19510787E+02)
(    0.12200000E+03 0.19767108E+02)
(    0.12400000E+03 0.20037655E+02)
(    0.12600000E+03 0.20323171E+02)
(    0.12800000E+03 0.20624413E+02)
(    0.13000000E+03 0.20942142E+02)
(    0.13200000E+03 0.21277133E+02)
(    0.13400000E+03 0.21630163E+02)
(    0.13600000E+03 0.22002014E+02)
(    0.13800000E+03 0.22393475E+02)
(    0.14000000E+03 0.22805332E+02)
(    0.14200000E+03 0.23238378E+02)
(    0.14400000E+03 0.23693382E+02)
(    0.14600000E+03 0.24171193E+02)
(    0.14800000E+03 0.24672335E+02)
(    0.15000000E+03 0.25198540E+02)
(    0.16000000E+03 0.28257490E+02)
(    0.17000000E+03 0.31993532E+02)
(    0.18000000E+03 0.36523645E+02)
(    0.19000000E+03 0.41912770E+02)
(    0.20000000E+03 0.46382188E+02)
(    0.21000000E+03 0.48734611E+02)
(    0.22000000E+03 0.50069151E+02)
(    0.23000000E+03 0.50732695E+02)
(    0.24000000E+03 0.51366468E+02)
(    0.25000000E+03 0.51978081E+02)
(    0.26000000E+03 0.52573252E+02)
(    0.27000000E+03 0.53156122E+02)
(    0.28000000E+03 0.53729575E+02)
(    0.29000000E+03 0.54295505E+02)
(    0.30000000E+03 0.54836389E+02)
(    0.30200000E+03 0.54948263E+02)
(    0.30204713E+03 0.54950894E+02)
(    0.30209648E+03 0.54953654E+02)
(    0.30214815E+03 0.54956536E+02)
(    0.30220226E+03 0.54959554E+02)
(    0.30225893E+03 0.54962723E+02)
(    0.30231826E+03 0.54966032E+02)
(    0.30238038E+03 0.54969498E+02)
(    0.30244544E+03 0.54973130E+02)
(    0.30251356E+03 0.54976938E+02)
(    0.30258489E+03 0.54980913E+02)
(    0.30265959E+03 0.54985075E+02)
(    0.30273780E+03 0.54989447E+02)
(    0.30281970E+03 0.54994012E+02)
(    0.30290546E+03 0.54998793E+02)
(    0.30299526E+03 0.55003808E+02)
(    0.30308930E+03 0.55009051E+02)
(    0.30318776E+03 0.55014542E+02)
(    0.30329087E+03 0.55020292E+02)
(    0.30339883E+03 0.55026310E+02)
(    0.30351189E+03 0.55032614E+02)
(    0.30363027E+03 0.55039211E+02)
(    0.30375423E+03 0.55046125E+02)
(    0.30388403E+03 0.55053353E+02)
(    0.30401995E+03 0.55060926E+02)
(    0.30416228E+03 0.55068858E+02)
(    0.30431131E+03 0.55077154E+02)
(    0.30446737E+03 0.55085847E+02)
(    0.30463078E+03 0.55094950E+02)
(    0.30480189E+03 0.55104472E+02)
(    0.30498107E+03 0.55114446E+02)
(    0.30516869E+03 0.55124886E+02)
(    0.30536516E+03 0.55135817E+02)
(    0.30557088E+03 0.55147261E+02)
(    0.30578630E+03 0.55159240E+02)
(    0.30601187E+03 0.55171782E+02)
(    0.30624807E+03 0.55184910E+02)
(    0.30649541E+03 0.55198655E+02)
(    0.30675440E+03 0.55213044E+02)
(    0.30702560E+03 0.55228103E+02)
(    0.30730957E+03 0.55243871E+02)
(    0.30760693E+03 0.55260377E+02)
(    0.30791831E+03 0.55277652E+02)
(    0.30824436E+03 0.55295737E+02)
(    0.30858578E+03 0.55314668E+02)
(    0.30894328E+03 0.55334482E+02)
(    0.30931764E+03 0.55355222E+02)
(    0.30970964E+03 0.55376931E+02)
(    0.31012011E+03 0.55399654E+02)
(    0.31054993E+03 0.55423434E+02)
(    0.31100000E+03 0.55448326E+02)
(    0.31147129E+03 0.55474377E+02)
(    0.31196478E+03 0.55501640E+02)
(    0.31248154E+03 0.55530175E+02)
(    0.31302264E+03 0.55560036E+02)
(    0.31358925E+03 0.55591286E+02)
(    0.31418257E+03 0.55623989E+02)
(    0.31480384E+03 0.55658209E+02)
(    0.31545440E+03 0.55694017E+02)
(    0.31613561E+03 0.55731486E+02)
(    0.31684893E+03 0.55770692E+02)
(    0.31759587E+03 0.55811713E+02)
(    0.31837801E+03 0.55854630E+02)
(    0.31919701E+03 0.55899531E+02)
(    0.32005461E+03 0.55946505E+02)
(    0.32095262E+03 0.55995645E+02)
(    0.32189296E+03 0.56047050E+02)
(    0.32287762E+03 0.56100820E+02)
(    0.32390868E+03 0.56157061E+02)
(    0.32498833E+03 0.56215882E+02)
(    0.32611886E+03 0.56277401E+02)
(    0.32730268E+03 0.56341736E+02)
(    0.32854229E+03 0.56409009E+02)
(    0.32984032E+03 0.56479352E+02)
(    0.33119952E+03 0.56552898E+02)
(    0.33262278E+03 0.56629787E+02)
(    0.33411311E+03 0.56710162E+02)
(    0.33567369E+03 0.56794176E+02)
(    0.33730781E+03 0.56881983E+02)
(    0.33901894E+03 0.56973744E+02)
(    0.34081072E+03 0.57069626E+02)
(    0.34268694E+03 0.57169802E+02)
(    0.34465158E+03 0.57274451E+02)
(    0.34670882E+03 0.57383754E+02)
(    0.34886301E+03 0.57497903E+02)
(    0.35111872E+03 0.57617093E+02)
(    0.35348075E+03 0.57741522E+02)
(    0.35595409E+03 0.57871396E+02)
(    0.35854399E+03 0.58006925E+02)
(    0.36125596E+03 0.58148323E+02)
(    0.36409573E+03 0.58295810E+02)
(    0.36706934E+03 0.58449608E+02)
(    0.37018310E+03 0.58609940E+02)
(    0.37344360E+03 0.58777034E+02)
(    0.37685776E+03 0.58951121E+02)
(    0.38043282E+03 0.59132422E+02)
(    0.38417638E+03 0.59321197E+02)
(    0.38809636E+03 0.59517558E+02)
(    0.39220108E+03 0.59722172E+02)
(    0.39649926E+03 0.59933523E+02)
(    0.40100000E+03 0.60155079E+02)
(    0.40571285E+03 0.60385464E+02)
(    0.41064782E+03 0.60622335E+02)
(    0.41581536E+03 0.60869663E+02)
(    0.42122644E+03 0.61125663E+02)
(    0.42689254E+03 0.61391033E+02)
(    0.43282567E+03 0.61665760E+02)
(    0.43903843E+03 0.61950005E+02)
(    0.44554398E+03 0.62243850E+02)
(    0.45235612E+03 0.62547366E+02)
(    0.45948932E+03 0.62860592E+02)
(    0.46695869E+03 0.63183540E+02)
(    0.47478008E+03 0.63516185E+02)
(    0.48297009E+03 0.63858467E+02)
(    0.49154607E+03 0.64210289E+02)
(    0.50052623E+03 0.64571512E+02)
(    0.50992961E+03 0.64941957E+02)
(    0.51977616E+03 0.65321397E+02)
(    0.53008677E+03 0.65709563E+02)
(    0.54088329E+03 0.66106137E+02)
(    0.55218864E+03 0.66510755E+02)
(    0.56402680E+03 0.66923000E+02)
(    0.57642287E+03 0.67342411E+02)
(    0.58940315E+03 0.67768476E+02)
(    0.60299517E+03 0.68200636E+02)
(    0.61722777E+03 0.68638284E+02)
(    0.63213112E+03 0.69080768E+02)
(    0.64773685E+03 0.69527394E+02)
(    0.66407805E+03 0.69977426E+02)
(    0.68118940E+03 0.70430092E+02)
(    0.69910717E+03 0.70884585E+02)
(    0.71786938E+03 0.71340068E+02)
(    0.73751583E+03 0.71795681E+02)
(    0.75808819E+03 0.72250550E+02)
(    0.77963009E+03 0.72703771E+02)
(    0.80218723E+03 0.73154446E+02)
(    0.82580746E+03 0.73601679E+02)
(    0.85054087E+03 0.74044569E+02)
(    0.87643994E+03 0.74482237E+02)
(    0.90355959E+03 0.74913815E+02)
(    0.93195734E+03 0.75338491E+02)
(    0.96169345E+03 0.75755383E+02)
(    0.99283097E+03 0.76163886E+02)
(    0.10254360E+04 0.76563230E+02)
(    0.10595776E+04 0.76952618E+02)
(    0.10953282E+04 0.77331652E+02)
(    0.11327638E+04 0.77699700E+02)
(    0.11719636E+04 0.78056329E+02)
(    0.12130108E+04 0.78401136E+02)
(    0.12559926E+04 0.78733804E+02)
(    0.13010000E+04 0.79054084E+02)
(    0.13481285E+04 0.79361801E+02)
(    0.13974782E+04 0.79656850E+02)
(    0.14491536E+04 0.79939194E+02)
(    0.15032644E+04 0.80208863E+02)
(    0.15599254E+04 0.80465952E+02)
(    0.16192567E+04 0.80710608E+02)
(    0.16813843E+04 0.80943034E+02)
(    0.17464398E+04 0.81163480E+02)
(    0.18145612E+04 0.81372237E+02)
(    0.18858932E+04 0.81569634E+02)
(    0.19605869E+04 0.81756030E+02)
(    0.20388008E+04 0.81931808E+02)
(    0.21207009E+04 0.82097372E+02)
(    0.22064607E+04 0.82253140E+02)
(    0.22962623E+04 0.82399541E+02)
(    0.23902961E+04 0.82537010E+02)
(    0.24887616E+04 0.82665975E+02)
(    0.25918677E+04 0.82786884E+02)
(    0.26998329E+04 0.82900161E+02)
(    0.28128864E+04 0.83006212E+02)
(    0.29312680E+04 0.83105466E+02)
(    0.30552287E+04 0.83198315E+02)
(    0.31850315E+04 0.83285147E+02)
(    0.33209517E+04 0.83366331E+02)
(    0.34632777E+04 0.83442223E+02)
(    0.36123112E+04 0.83513162E+02)
(    0.37683685E+04 0.83579473E+02)
(    0.39317805E+04 0.83641462E+02)
(    0.41028940E+04 0.83699421E+02)
(    0.42820717E+04 0.83753625E+02)
(    0.44696938E+04 0.83804336E+02)
(    0.46661583E+04 0.83851797E+02)
(    0.48718819E+04 0.83896256E+02)
(    0.50873009E+04 0.83937938E+02)
(    0.53128723E+04 0.83977057E+02)
(    0.55490746E+04 0.84013853E+02)
(    0.57964087E+04 0.84048556E+02)
(    0.60553994E+04 0.84081417E+02)
(    0.63265959E+04 0.84112711E+02)
(    0.66105734E+04 0.84142753E+02)
(    0.69079345E+04 0.84171909E+02)
(    0.72193097E+04 0.84200607E+02)
(    0.75453596E+04 0.84229352E+02)
(    0.78867758E+04 0.84258739E+02)
(    0.82442823E+04 0.84289457E+02)
(    0.86186377E+04 0.84322302E+02)
(    0.90106359E+04 0.84358172E+02)
(    0.94211084E+04 0.84398065E+02)
(    0.98509259E+04 0.84443065E+02)
(    0.10301000E+05 0.84494334E+02)
(    0.10772285E+05 0.84553078E+02)
(    0.11265782E+05 0.84620536E+02)
(    0.11782536E+05 0.84697942E+02)
(    0.12323644E+05 0.84786504E+02)
(    0.12890254E+05 0.84887381E+02)
(    0.13483567E+05 0.85001657E+02)
(    0.14104843E+05 0.85130330E+02)
(    0.14755398E+05 0.85274328E+02)
(    0.15436612E+05 0.85434379E+02)
(    0.16149932E+05 0.85611366E+02)
(    0.16896869E+05 0.85805881E+02)
(    0.17679008E+05 0.86018345E+02)
(    0.18498009E+05 0.86249494E+02)
(    0.19355607E+05 0.86499699E+02)
(    0.20253623E+05 0.86769423E+02)
(    0.21193961E+05 0.87059042E+02)
(    0.22178616E+05 0.87368886E+02)
(    0.23209677E+05 0.87699204E+02)
(    0.24289329E+05 0.88050142E+02)
(    0.25419864E+05 0.88421718E+02)
(    0.26603680E+05 0.88813784E+02)
(    0.27843287E+05 0.89226002E+02)
(    0.29141315E+05 0.89657810E+02)
(    0.30500517E+05 0.90108409E+02)
(    0.31923777E+05 0.90576741E+02)
(    0.33414112E+05 0.91061493E+02)
(    0.34974685E+05 0.91561099E+02)
(    0.36608805E+05 0.92073758E+02)
(    0.38319940E+05 0.92597465E+02)
(    0.40111717E+05 0.93130039E+02)
(    0.41987938E+05 0.93669170E+02)
(    0.43952583E+05 0.94212463E+02)
(    0.46009819E+05 0.94757486E+02)
(    0.48164009E+05 0.95301817E+02)
(    0.50419723E+05 0.95843092E+02)
(    0.52781746E+05 0.96379049E+02)
(    0.55255087E+05 0.96907560E+02)
(    0.57844994E+05 0.97426666E+02)
(    0.60556959E+05 0.97934603E+02)
(    0.63396734E+05 0.98429814E+02)
(    0.66370345E+05 0.98910965E+02)
(    0.69484097E+05 0.99376955E+02)
(    0.72744596E+05 0.99826901E+02)
(    0.76158758E+05 0.10026014E+03)
(    0.79733823E+05 0.10067622E+03)
(    0.83477377E+05 0.10107488E+03)
(    0.87397359E+05 0.10145607E+03)
(    0.91502084E+05 0.10181987E+03)
(    0.95800259E+05 0.10216652E+03)
(    0.10030100E+06 0.10249639E+03)
(    0.10501385E+06 0.10280998E+03)
(    0.10994882E+06 0.10310789E+03)
(    0.11511636E+06 0.10339078E+03)
(    0.12052744E+06 0.10365943E+03)
(    0.12619354E+06 0.10391476E+03)
(    0.13212667E+06 0.10415737E+03)
(    0.13833943E+06 0.10438970E+03)
(    0.14484498E+06 0.10460743E+03)
(    0.15000000E+06 0.10478264E+03)
(    0.20000000E+06 0.10572519E+03)
(    0.25000000E+06 0.10553307E+03)
(    0.30000000E+06 0.10546785E+03)
(    0.31595869E+06 0.10534259E+03)
(    0.32378008E+06 0.10533981E+03)
(    0.33197009E+06 0.10533669E+03)
(    0.34054607E+06 0.10533416E+03)
(    0.34952623E+06 0.10533194E+03)
(    0.35892961E+06 0.10533008E+03)
(    0.36877616E+06 0.10532855E+03)
(    0.37908677E+06 0.10532733E+03)
(    0.38988329E+06 0.10532641E+03)
(    0.40118864E+06 0.10532576E+03)
(    0.41302680E+06 0.10532537E+03)
(    0.42542287E+06 0.10532522E+03)
(    0.43840315E+06 0.10532529E+03)
(    0.45199517E+06 0.10532557E+03)
(    0.46622777E+06 0.10532606E+03)
(    0.48113112E+06 0.10532670E+03)
(    0.49673685E+06 0.10532751E+03)
(    0.51307805E+06 0.10532847E+03)
(    0.53018940E+06 0.10532957E+03)
(    0.54810717E+06 0.10533080E+03)
(    0.56686938E+06 0.10533214E+03)
(    0.58651583E+06 0.10533358E+03)
(    0.60708819E+06 0.10533511E+03)
(    0.62863009E+06 0.10533673E+03)
(    0.65118723E+06 0.10533843E+03)
(    0.67480746E+06 0.10534020E+03)
(    0.69954087E+06 0.10534203E+03)
(    0.72543994E+06 0.10534391E+03)
(    0.75255959E+06 0.10534585E+03)
(    0.78095734E+06 0.10534784E+03)
(    0.81069345E+06 0.10534986E+03)
(    0.84183097E+06 0.10535192E+03)
(    0.87443596E+06 0.10535401E+03)
(    0.90857758E+06 0.10535613E+03)
(    0.94432823E+06 0.10535828E+03)
(    0.98176377E+06 0.10536046E+03)
(    0.10209636E+07 0.10536265E+03)
(    0.10620108E+07 0.10536486E+03)
(    0.11049926E+07 0.10536709E+03)
))
(defparameter *heff* '(
(    0.60000000E+01    0.10747506E+02)
(    0.80000000E+01    0.10749217E+02 )
(    0.10000000E+02    0.10757244E+02 )
(    0.12000000E+02    0.10783184E+02 )
(    0.14000000E+02    0.10840283E+02 )
(    0.16000000E+02    0.10936002E+02 )
(    0.18000000E+02    0.11071020E+02 )
(    0.20000000E+02    0.11240799E+02 )
(    0.22000000E+02    0.11438110E+02 )
(    0.24000000E+02    0.11655002E+02 )
(    0.26000000E+02    0.11884030E+02 )
(    0.28000000E+02    0.12118843E+02 )
(    0.30000000E+02    0.12354365E+02 )
(    0.32000000E+02    0.12586749E+02 )
(    0.34000000E+02    0.12813226E+02 )
(    0.36000000E+02    0.13031918E+02 )
(    0.38000000E+02    0.13241654E+02 )
(    0.40000000E+02    0.13441813E+02 )
(    0.42000000E+02    0.13632187E+02 )
(    0.44000000E+02    0.13812870E+02 )
(    0.46000000E+02    0.13984174E+02 )
(    0.48000000E+02    0.14146560E+02 )
(    0.50000000E+02    0.14300587E+02 )
(    0.52000000E+02    0.14446875E+02 )
(    0.54000000E+02    0.14586079E+02 )
(    0.56000000E+02    0.14718861E+02 )
(    0.58000000E+02    0.14845888E+02 )
(    0.60000000E+02    0.14967810E+02 )
(    0.62000000E+02    0.15085266E+02 )
(    0.64000000E+02    0.15198870E+02 )
(    0.66000000E+02    0.15309217E+02 )
(    0.68000000E+02    0.15416882E+02 )
(    0.70000000E+02    0.15522415E+02 )
(    0.72000000E+02    0.15626352E+02 )
(    0.74000000E+02    0.15729207E+02 )
(    0.76000000E+02    0.15831483E+02 )
(    0.78000000E+02    0.15933668E+02 )
(    0.80000000E+02    0.16036241E+02 )
(    0.82000000E+02    0.16139671E+02 )
(    0.84000000E+02    0.16244423E+02 )
(    0.86000000E+02    0.16350958E+02 )
(    0.88000000E+02    0.16459736E+02 )
(    0.90000000E+02    0.16571217E+02 )
(    0.92000000E+02    0.16685865E+02 )
(    0.94000000E+02    0.16804146E+02 )
(    0.96000000E+02    0.16926533E+02 )
(    0.98000000E+02    0.17053506E+02 )
(    0.10000000E+03    0.17185555E+02 )
(    0.10200000E+03    0.17323177E+02 )
(    0.10400000E+03    0.17466881E+02 )
(    0.10600000E+03    0.17617187E+02 )
(    0.10800000E+03    0.17774628E+02 )
(    0.11000000E+03    0.17939746E+02 )
(    0.11200000E+03    0.18113099E+02 )
(    0.11400000E+03    0.18295257E+02 )
(    0.11600000E+03    0.18486800E+02 )
(    0.11800000E+03    0.18688324E+02 )
(    0.12000000E+03    0.18900433E+02 )
(    0.12200000E+03    0.19123747E+02 )
(    0.12400000E+03    0.19358892E+02 )
(    0.12600000E+03    0.19606508E+02 )
(    0.12800000E+03    0.19867242E+02 )
(    0.13000000E+03    0.20141749E+02 )
(    0.13200000E+03    0.20430693E+02 )
(    0.13400000E+03    0.20734742E+02 )
(    0.13600000E+03    0.21054569E+02 )
(    0.13800000E+03    0.21390853E+02 )
(    0.14000000E+03    0.21744272E+02 )
(    0.14200000E+03    0.22115508E+02 )
(    0.14400000E+03    0.22505229E+02 )
(    0.14600000E+03    0.22914162E+02 )
(    0.14800000E+03    0.23342792E+02 )
(    0.15000000E+03    0.23792507E+02 )
(    0.16000000E+03    0.26399581E+02 )
(    0.17000000E+03    0.29585467E+02 )
(    0.18000000E+03    0.33449102E+02 )
(    0.19000000E+03    0.38049743E+02 )
(    0.20000000E+03    0.42062912E+02 )
(    0.21000000E+03    0.44461906E+02 )
(    0.22000000E+03    0.46048908E+02 )
(    0.23000000E+03    0.47056900E+02 )
(    0.24000000E+03    0.47980798E+02 )
(    0.25000000E+03    0.48837357E+02 )
(    0.26000000E+03    0.49639660E+02 )
(    0.27000000E+03    0.50397871E+02 )
(    0.28000000E+03    0.51119847E+02 )
(    0.29000000E+03    0.51811635E+02 )
(    0.30000000E+03    0.52463862E+02 )
(    0.30200000E+03    0.52594869E+02 )
(    0.30204713E+03    0.52597944E+02 )
(    0.30209648E+03    0.52601167E+02 )
(    0.30214815E+03    0.52604535E+02 )
(    0.30220226E+03    0.52608062E+02 )
(    0.30225893E+03    0.52611762E+02 )
(    0.30231826E+03    0.52615627E+02 )
(    0.30238038E+03    0.52619675E+02 )
(    0.30244544E+03    0.52623916E+02 )
(    0.30251356E+03    0.52628359E+02 )
(    0.30258489E+03    0.52633001E+02 )
(    0.30265959E+03    0.52637861E+02 )
(    0.30273780E+03    0.52642959E+02 )
(    0.30281970E+03    0.52648287E+02 )
(    0.30290546E+03    0.52653865E+02 )
(    0.30299526E+03    0.52659711E+02 )
(    0.30308930E+03    0.52665825E+02 )
(    0.30318776E+03    0.52672226E+02 )
(    0.30329087E+03    0.52678927E+02 )
(    0.30339883E+03    0.52685940E+02 )
(    0.30351189E+03    0.52693284E+02 )
(    0.30363027E+03    0.52700967E+02 )
(    0.30375423E+03    0.52709015E+02 )
(    0.30388403E+03    0.52717431E+02 )
(    0.30401995E+03    0.52726243E+02 )
(    0.30416228E+03    0.52735470E+02 )
(    0.30431131E+03    0.52745120E+02 )
(    0.30446737E+03    0.52755226E+02 )
(    0.30463078E+03    0.52765803E+02 )
(    0.30480189E+03    0.52776867E+02 )
(    0.30498107E+03    0.52788450E+02 )
(    0.30516869E+03    0.52800570E+02 )
(    0.30536516E+03    0.52813254E+02 )
(    0.30557088E+03    0.52826528E+02 )
(    0.30578630E+03    0.52840416E+02 )
(    0.30601187E+03    0.52854950E+02 )
(    0.30624807E+03    0.52870157E+02 )
(    0.30649541E+03    0.52886069E+02 )
(    0.30675440E+03    0.52902718E+02 )
(    0.30702560E+03    0.52920134E+02 )
(    0.30730957E+03    0.52938358E+02 )
(    0.30760693E+03    0.52957423E+02 )
(    0.30791831E+03    0.52977365E+02 )
(    0.30824436E+03    0.52998228E+02 )
(    0.30858578E+03    0.53020051E+02 )
(    0.30894328E+03    0.53042877E+02 )
(    0.30931764E+03    0.53066752E+02 )
(    0.30970964E+03    0.53091722E+02 )
(    0.31012011E+03    0.53117838E+02 )
(    0.31054993E+03    0.53145147E+02 )
(    0.31100000E+03    0.53173706E+02 )
(    0.31147129E+03    0.53203569E+02 )
(    0.31196478E+03    0.53234792E+02 )
(    0.31248154E+03    0.53267438E+02 )
(    0.31302264E+03    0.53301567E+02 )
(    0.31358925E+03    0.53337246E+02 )
(    0.31418257E+03    0.53374542E+02 )
(    0.31480384E+03    0.53413524E+02 )
(    0.31545440E+03    0.53454267E+02 )
(    0.31613561E+03    0.53496847E+02 )
(    0.31684893E+03    0.53541342E+02 )
(    0.31759587E+03    0.53587836E+02 )
(    0.31837801E+03    0.53636414E+02 )
(    0.31919701E+03    0.53687163E+02 )
(    0.32005461E+03    0.53740178E+02 )
(    0.32095262E+03    0.53795552E+02 )
(    0.32189296E+03    0.53853387E+02 )
(    0.32287762E+03    0.53913784E+02 )
(    0.32390868E+03    0.53976850E+02 )
(    0.32498833E+03    0.54042696E+02 )
(    0.32611886E+03    0.54111438E+02 )
(    0.32730268E+03    0.54183193E+02 )
(    0.32854229E+03    0.54258084E+02 )
(    0.32984032E+03    0.54336239E+02 )
(    0.33119952E+03    0.54417788E+02 )
(    0.33262278E+03    0.54502868E+02 )
(    0.33411311E+03    0.54591619E+02 )
(    0.33567369E+03    0.54684186E+02 )
(    0.33730781E+03    0.54780718E+02 )
(    0.33901894E+03    0.54881369E+02 )
(    0.34081072E+03    0.54986297E+02 )
(    0.34268694E+03    0.55095666E+02 )
(    0.34465158E+03    0.55209644E+02 )
(    0.34670882E+03    0.55328402E+02 )
(    0.34886301E+03    0.55452117E+02 )
(    0.35111872E+03    0.55580971E+02 )
(    0.35348075E+03    0.55715148E+02 )
(    0.35595409E+03    0.55854838E+02 )
(    0.35854399E+03    0.56000236E+02 )
(    0.36125596E+03    0.56151535E+02 )
(    0.36409573E+03    0.56308938E+02 )
(    0.36706934E+03    0.56472648E+02 )
(    0.37018310E+03    0.56642869E+02 )
(    0.37344360E+03    0.56819808E+02 )
(    0.37685776E+03    0.57003676E+02 )
(    0.38043282E+03    0.57194676E+02 )
(    0.38417638E+03    0.57393039E+02 )
(    0.38809636E+03    0.57598887E+02 )
(    0.39220108E+03    0.57812759E+02 )
(    0.39649926E+03    0.58033554E+02 )
(    0.40100000E+03    0.58263901E+02 )
(    0.40571285E+03    0.58502835E+02 )
(    0.41064782E+03    0.58748608E+02 )
(    0.41581536E+03    0.59004242E+02 )
(    0.42122644E+03    0.59268436E+02 )
(    0.42689254E+03    0.59541750E+02 )
(    0.43282567E+03    0.59824210E+02 )
(    0.43903843E+03    0.60115968E+02 )
(    0.44554398E+03    0.60417119E+02 )
(    0.45235612E+03    0.60727748E+02 )
(    0.45948932E+03    0.61047913E+02 )
(    0.46695869E+03    0.61377647E+02 )
(    0.47478008E+03    0.61716956E+02 )
(    0.48297009E+03    0.62065814E+02 )
(    0.49154607E+03    0.62424165E+02 )
(    0.50052623E+03    0.62791914E+02 )
(    0.50992961E+03    0.63168933E+02 )
(    0.51977616E+03    0.63555052E+02 )
(    0.53008677E+03    0.63950060E+02 )
(    0.54088329E+03    0.64353707E+02 )
(    0.55218864E+03    0.64765696E+02 )
(    0.56402680E+03    0.65185683E+02 )
(    0.57642287E+03    0.65613283E+02 )
(    0.58940315E+03    0.66048060E+02 )
(    0.60299517E+03    0.66489534E+02 )
(    0.61722777E+03    0.66937177E+02 )
(    0.63213112E+03    0.67390418E+02 )
(    0.64773685E+03    0.67848638E+02 )
(    0.66407805E+03    0.68311178E+02 )
(    0.68118940E+03    0.68777339E+02 )
(    0.69910717E+03    0.69246382E+02 )
(    0.71786938E+03    0.69717534E+02 )
(    0.73751583E+03    0.70189992E+02 )
(    0.75808819E+03    0.70662932E+02 )
(    0.77963009E+03    0.71135496E+02 )
(    0.80218723E+03    0.71606819E+02 )
(    0.82580746E+03    0.72076029E+02 )
(    0.85054087E+03    0.72542241E+02 )
(    0.87643994E+03    0.73004579E+02 )
(    0.90355959E+03    0.73462170E+02 )
(    0.93195734E+03    0.73914179E+02 )
(    0.96169345E+03    0.74359713E+02 )
(    0.99283097E+03    0.74798086E+02 )
(    0.10254360E+04    0.75228493E+02 )
(    0.10595776E+04    0.75650104E+02 )
(    0.10953282E+04    0.76062396E+02 )
(    0.11327638E+04    0.76464676E+02 )
(    0.11719636E+04    0.76856406E+02 )
(    0.12130108E+04    0.77237084E+02 )
(    0.12559926E+04    0.77606278E+02 )
(    0.13010000E+04    0.77963622E+02 )
(    0.13481285E+04    0.78308818E+02 )
(    0.13974782E+04    0.78641637E+02 )
(    0.14491536E+04    0.78961915E+02 )
(    0.15032644E+04    0.79269554E+02 )
(    0.15599254E+04    0.79564525E+02 )
(    0.16192567E+04    0.79846850E+02 )
(    0.16813843E+04    0.80116616E+02 )
(    0.17464398E+04    0.80373959E+02 )
(    0.18145612E+04    0.80619064E+02 )
(    0.18858932E+04    0.80852160E+02 )
(    0.19605869E+04    0.81073515E+02 )
(    0.20388008E+04    0.81283431E+02 )
(    0.21207009E+04    0.81482237E+02 )
(    0.22064607E+04    0.81670289E+02 )
(    0.22962623E+04    0.81847962E+02 )
(    0.23902961E+04    0.82015644E+02 )
(    0.24887616E+04    0.82173731E+02 )
(    0.25918677E+04    0.82322641E+02 )
(    0.26998329E+04    0.82462780E+02 )
(    0.28128864E+04    0.82594548E+02 )
(    0.29312680E+04    0.82718368E+02 )
(    0.30552287E+04    0.82834637E+02 )
(    0.31850315E+04    0.82943753E+02 )
(    0.33209517E+04    0.83046101E+02 )
(    0.34632777E+04    0.83142059E+02 )
(    0.36123112E+04    0.83231991E+02 )
(    0.37683685E+04    0.83316250E+02 )
(    0.39317805E+04    0.83395174E+02 )
(    0.41028940E+04    0.83469089E+02 )
(    0.42820717E+04    0.83538305E+02 )
(    0.44696938E+04    0.83603122E+02 )
(    0.46661583E+04    0.83663820E+02 )
(    0.48718819E+04    0.83720683E+02 )
(    0.50873009E+04    0.83773972E+02 )
(    0.53128723E+04    0.83823938E+02 )
(    0.55490746E+04    0.83870849E+02 )
(    0.57964087E+04    0.83914960E+02 )
(    0.60553994E+04    0.83956546E+02 )
(    0.63265959E+04    0.83995892E+02 )
(    0.66105734E+04    0.84033318E+02 )
(    0.69079345E+04    0.84069180E+02 )
(    0.72193097E+04    0.84103886E+02 )
(    0.75453596E+04    0.84137904E+02 )
(    0.78867758E+04    0.84171778E+02 )
(    0.82442823E+04    0.84206131E+02 )
(    0.86186377E+04    0.84241675E+02 )
(    0.90106359E+04    0.84279213E+02 )
(    0.94211084E+04    0.84319636E+02 )
(    0.98509259E+04    0.84363917E+02 )
(    0.10301000E+05    0.84413100E+02 )
(    0.10772285E+05    0.84468282E+02 )
(    0.11265782E+05    0.84530598E+02 )
(    0.11782536E+05    0.84601192E+02 )
(    0.12323644E+05    0.84681203E+02 )
(    0.12890254E+05    0.84771738E+02 )
(    0.13483567E+05    0.84873857E+02 )
(    0.14104843E+05    0.84988557E+02 )
(    0.14755398E+05    0.85116780E+02 )
(    0.15436612E+05    0.85259317E+02 )
(    0.16149932E+05    0.85417066E+02 )
(    0.16896869E+05    0.85590705E+02 )
(    0.17679008E+05    0.85780766E+02 )
(    0.18498009E+05    0.85988012E+02 )
(    0.19355607E+05    0.86212921E+02 )
(    0.20253623E+05    0.86456027E+02 )
(    0.21193961E+05    0.86717793E+02 )
(    0.22178616E+05    0.86998630E+02 )
(    0.23209677E+05    0.87298881E+02 )
(    0.24289329E+05    0.87618796E+02 )
(    0.25419864E+05    0.87958514E+02 )
(    0.26603680E+05    0.88318032E+02 )
(    0.27843287E+05    0.88697183E+02 )
(    0.29141315E+05    0.89095606E+02 )
(    0.30500517E+05    0.89512731E+02 )
(    0.31923777E+05    0.89947765E+02 )
(    0.33414112E+05    0.90399679E+02 )
(    0.34974685E+05    0.90867217E+02 )
(    0.36608805E+05    0.91348905E+02 )
(    0.38319940E+05    0.91843065E+02 )
(    0.40111717E+05    0.92347847E+02 )
(    0.41987938E+05    0.92861255E+02 )
(    0.43952583E+05    0.93381191E+02 )
(    0.46009819E+05    0.93905488E+02 )
(    0.48164009E+05    0.94431951E+02 )
(    0.50419723E+05    0.94958404E+02 )
(    0.52781746E+05    0.95482719E+02 )
(    0.55255087E+05    0.96002857E+02 )
(    0.57844994E+05    0.96516897E+02 )
(    0.60556959E+05    0.97023058E+02 )
(    0.63396734E+05    0.97519726E+02 )
(    0.66370345E+05    0.98005459E+02 )
(    0.69484097E+05    0.98479010E+02 )
(    0.72744596E+05    0.98939319E+02 )
(    0.76158758E+05    0.99385509E+02 )
(    0.79733823E+05    0.99816908E+02 )
(    0.83477377E+05    0.10023301E+03 )
(    0.87397359E+05    0.10063349E+03 )
(    0.91502084E+05    0.10101818E+03 )
(    0.95800259E+05    0.10138705E+03 )
(    0.10030100E+06    0.10174022E+03 )
(    0.10501385E+06    0.10207792E+03 )
(    0.10994882E+06    0.10240051E+03 )
(    0.11511636E+06    0.10270843E+03 )
(    0.12052744E+06    0.10300221E+03 )
(    0.12619354E+06    0.10328256E+03 )
(    0.13212667E+06    0.10354994E+03 )
(    0.13833943E+06    0.10380625E+03 )
(    0.14484498E+06    0.10404833E+03 )
(    0.15000000E+06    0.10423757E+03 )
(    0.20000000E+06    0.10535225E+03 )
(    0.25000000E+06    0.10535981E+03 )
(    0.30000000E+06    0.10536715E+03 )
(    0.31595869E+06    0.10528336E+03 )
(    0.32378008E+06    0.10528544E+03 )
(    0.33197009E+06    0.10528700E+03 )
(    0.34054607E+06    0.10528874E+03 )
(    0.34952623E+06    0.10529046E+03 )
(    0.35892961E+06    0.10529223E+03 )
(    0.36877616E+06    0.10529401E+03 )
(    0.37908677E+06    0.10529583E+03 )
(    0.38988329E+06    0.10529767E+03 )
(    0.40118864E+06    0.10529954E+03 )
(    0.41302680E+06    0.10530144E+03 )
(    0.42542287E+06    0.10530335E+03 )
(    0.43840315E+06    0.10530529E+03 )
(    0.45199517E+06    0.10530726E+03 )
(    0.46622777E+06    0.10530925E+03 )
(    0.48113112E+06    0.10531125E+03 )
(    0.49673685E+06    0.10531328E+03 )
(    0.51307805E+06    0.10531533E+03 )
(    0.53018940E+06    0.10531740E+03 )
(    0.54810717E+06    0.10531949E+03 )
(    0.56686938E+06    0.10532159E+03 )
(    0.58651583E+06    0.10532372E+03 )
(    0.60708819E+06    0.10532586E+03 )
(    0.62863009E+06    0.10532801E+03 )
(    0.65118723E+06    0.10533018E+03 )
(    0.67480746E+06    0.10533236E+03 )
(    0.69954087E+06    0.10533456E+03 )
(    0.72543994E+06    0.10533677E+03 )
(    0.75255959E+06    0.10533900E+03 )
(    0.78095734E+06    0.10534123E+03 )
(    0.81069345E+06    0.10534348E+03 )
(    0.84183097E+06    0.10534573E+03 )
(    0.87443596E+06    0.10534800E+03 )
(    0.90857758E+06    0.10535027E+03 )
(    0.94432823E+06    0.10535255E+03 )
(    0.98176377E+06    0.10535484E+03 )
(    0.10209636E+07    0.10535714E+03 )
(    0.10620108E+07    0.10535945E+03 )
(    0.11049926E+07    0.10536176E+03 )
))
(defvar *geff-fsplines*)
(defvar *heff-fsplines*)

(defun geff-init ()
  (setq *geff-fsplines*
	(make-spline +cubic-spline-interpolation+
		     (grid:make-foreign-array 'double-float :initial-contents
					      (mapcar 'car *geff*))
		     (grid:make-foreign-array 'double-float :initial-contents
					      (mapcar 'cadr *geff*))))
  (setq *heff-fsplines*
	(make-spline +cubic-spline-interpolation+
		     (grid:make-foreign-array 'double-float :initial-contents
					      (mapcar 'car *heff*))
		     (grid:make-foreign-array 'double-float :initial-contents
					      (mapcar 'cadr *heff*)))))


(geff-init)

(defun geff (x)
  (setq x (* 1000 x)) ; Switch from GeV to MeV!
  (if (< x +tmin+) (progn (setq x +tmin+)
			 (print "T below minimum in geff")))
  (if (> x +tmax+) (progn (setq x +tmax+)
			 (print "T above maximum in geff")))
  (evaluate *geff-fsplines* x))

(defun heff (x)
  (setq x (* 1000 x)) ; Switch from GeV to MeV!
  (if (< x +tmin+) (progn (setq x +tmin+)
			 (print "T below minimum in heff")))
  (if (> x +tmax+) (progn (setq x +tmax+)
			 (print "T above maximum in heff")))
  (evaluate *heff-fsplines* x))

(defmnumfun geff)
(defmnumfun heff)

;; (defun a06 (xb q2 i)
;;   (if (< q2 +qsqmin+) (progn
;; 			(setq q2 +qsqmin+)
;; 			(print "q2 below minimum")))
;;   (if (> q2 (* 0.99 +qsqmax+)) (progn
;; 			(setq q2 (* 0.99 +qsqmax+))
;; 			(print "q2 above maximum")))
;;   (if (< xb +xmin+) (progn
;; 			(setq xb +xmin+)
;; 			(print "xb below minimum")))
;;   (if (> xb +xmax+) (progn
;; 			(setq xb +xmax+)
;; 			(print "xb above maximum")))
;;   (let* ((ss (- (log (log (/ q2 0.04d0))) (log (log (/ +qsqmin+ 0.04d0)))))
;; 	 (m (truncate ss +dels+))
;; 	 (b (- (/ ss +dels+) m))
;; 	 f0 fp fm pdf)
;;     (setq f0 (evaluate (aref *fsplines* i m) xb))
;;     (setq fp (evaluate (aref *fsplines* i (1+ m)) xb))
;;     (if (>= m 1)
;; 	(progn
;; 	  (setq fm (evaluate (aref *fsplines* i (1- m)) xb))
;; 	  (setq pdf (+ (/ (* fm b (- b 1)) 2)
;; 		       (* f0 (- 1 (* b b)))
;; 		       (/ (* fp b (+ b 1)) 2))))
;; 	(setq pdf (+ (* f0 (- 1 b)) (* fp b))))
;;     (* pdf (expt (- 1 xb) (elt +nexp+ i)))))

;; Seems to be even better, than the original
