;ELC
;;; Compiled by LTX@Xue-LingTaos-MacBook-Pro.local on Wed Mar 16 23:10:06 2011
;;; from file /Users/LTX/Projects/Emacs/emacs/lisp/calc/calc-rules.el
;;; in Emacs version 24.0.50.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\207" [require calc-ext calc-macs] 2)
(defalias 'calc-compile-rule-set #[(name rules) "\302\303\"\210\304	\305\"\302\306\"\210\207" [name rules message "Preparing rule set %s..." math-read-plain-expr t "Preparing rule set %s...done"] 4])
#@14 CommuteRules
(defalias 'calc-CommuteRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "CommuteRules" "[\niterations(1),\nselect(plain(a + b))		:=  select(plain(b + a)),\nselect(plain(a - b))		:=  select(plain((-b) + a)),\nselect(plain((1/a) * b))	:=  select(b / a),\nselect(plain(a * b))		:=  select(b * a),\nselect((1/a) / b)		:=  select((1/b) / a),\nselect(a / b)			:=  select((1/b) * a),\nselect((a^b) ^ c)		:=  select((a^c) ^ b),\nselect(log(a, b))		:=  select(1 / log(b, a)),\nselect(plain(a && b))		:=  select(b && a),\nselect(plain(a || b))		:=  select(b || a),\nselect(plain(a = b))		:=  select(b = a),\nselect(plain(a != b))		:=  select(b != a),\nselect(a < b)			:=  select(b > a),\nselect(a > b)			:=  select(b < a),\nselect(a <= b)			:=  select(b >= a),\nselect(a >= b)			:=  select(b <= a) ]"] 3 (#$ . 823)])
#@11 JumpRules
(defalias 'calc-JumpRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "JumpRules" "[\niterations(1),\nplain(select(x) = y)		:=  0 = select(-x) + y,\nplain(a + select(x) = y)	:=  a = select(-x) + y,\nplain(a - select(x) = y)	:=  a = select(x) + y,\nplain(select(x) + a = y)	:=  a = select(-x) + y,\nplain(a * select(x) = y)	:=  a = y / select(x),\nplain(a / select(x) = y)	:=  a = select(x) * y,\nplain(select(x) / a = y)	:=  1/a = y / select(x),\nplain(a ^ select(2) = y)	:=  a = select(sqrt(y)),\nplain(a ^ select(x) = y)	:=  a = y ^ select(1/x),\nplain(select(x) ^ a = y)	:=  a = log(y, select(x)),\nplain(log(a, select(x)) = y)	:=  a = select(x) ^ y,\nplain(log(select(x), a) = y)	:=  a = select(x) ^ (1/y),\nplain(y = select(x))		:=  y - select(x) = 0,\nplain(y = a + select(x))	:=  y - select(x) = a,\nplain(y = a - select(x))	:=  y + select(x) = a,\nplain(y = select(x) + a)	:=  y - select(x) = a,\nplain(y = a * select(x))	:=  y / select(x) = a,\nplain(y = a / select(x))	:=  y * select(x) = a,\nplain(y = select(x) / a)	:=  y / select(x) = 1/a,\nplain(y = a ^ select(2))	:=  select(sqrt(y)) = a,\nplain(y = a ^ select(x))	:=  y ^ select(1/x) = a,\nplain(y = select(x) ^ a)	:=  log(y, select(x)) = a,\nplain(y = log(a, select(x)))	:=  select(x) ^ y = a,\nplain(y = log(select(x), a))	:=  select(x) ^ (1/y) = a ]"] 3 (#$ . 1656)])
#@14 DistribRules
(defalias 'calc-DistribRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "DistribRules" "[\niterations(1),\nx * select(a + b)		:=  x*select(a) + x*b,\nx * select(sum(a,b,c,d))	:=  sum(x*select(a),b,c,d),\nx / select(a + b)		:=  1 / (select(a)/x + b/x),\nselect(a + b) / x		:=  select(a)/x + b/x,\nsum(select(a),b,c,d) / x	:=  sum(select(a)/x,b,c,d),\nx ^ select(a + b)		:=  x^select(a) * x^b,\nx ^ select(sum(a,b,c,d))	:=  prod(x^select(a),b,c,d),\nx ^ select(a * b)		:=  (x^a)^select(b),\nx ^ select(a / b)		:=  (x^a)^select(1/b),\nselect(a + b) ^ n		:=  select(x)\n				    :: integer(n) :: n >= 2\n				    :: let(x, expandpow(a+b,n))\n				    :: quote(matches(x,y+z)),\nselect(a + b) ^ x		:=  a*select(a+b)^(x-1) + b*select(a+b)^(x-1),\nselect(a * b) ^ x		:=  a^x * select(b)^x,\nselect(prod(a,b,c,d)) ^ x	:=  prod(select(a)^x,b,c,d),\nselect(a / b) ^ x		:=  select(a)^x / b^x,\nselect(- a) ^ x			:=  (-1)^x * select(a)^x,\nplain(-select(a + b))		:=  select(-a) - b,\nplain(-select(sum(a,b,c,d)))    :=  sum(select(-a),b,c,d),\nplain(-select(a * b))	        :=  select(-a) * b,\nplain(-select(a / b))	        :=  select(-a) / b,\nsqrt(select(a * b))		:=  sqrt(select(a)) * sqrt(b),\nsqrt(select(prod(a,b,c,d)))	:=  prod(sqrt(select(a)),b,c,d),\nsqrt(select(a / b))		:=  sqrt(select(a)) / sqrt(b),\nsqrt(select(- a))		:=  sqrt(-1) sqrt(select(a)),\nexp(select(a + b))		:=  exp(select(a)) / exp(-b) :: negative(b),\nexp(select(a + b))		:=  exp(select(a)) * exp(b),\nexp(select(sum(a,b,c,d)))	:=  prod(exp(select(a)),b,c,d),\nexp(select(a * b))		:=  exp(select(a)) ^ b :: constant(b),\nexp(select(a * b))		:=  exp(select(a)) ^ b,\nexp(select(a / b))		:=  exp(select(a)) ^ (1/b),\nln(select(a * b))		:=  ln(select(a)) + ln(b),\nln(select(prod(a,b,c,d)))	:=  sum(ln(select(a)),b,c,d),\nln(select(a / b))		:=  ln(select(a)) - ln(b),\nln(select(a ^ b))		:=  ln(select(a)) * b,\nlog10(select(a * b))		:=  log10(select(a)) + log10(b),\nlog10(select(prod(a,b,c,d)))	:=  sum(log10(select(a)),b,c,d),\nlog10(select(a / b))		:=  log10(select(a)) - log10(b),\nlog10(select(a ^ b))		:=  log10(select(a)) * b,\nlog(select(a * b), x)		:=  log(select(a), x) + log(b,x),\nlog(select(prod(a,b,c,d)),x)	:=  sum(log(select(a),x),b,c,d),\nlog(select(a / b), x)		:=  log(select(a), x) - log(b,x),\nlog(select(a ^ b), x)		:=  log(select(a), x) * b,\nlog(a, select(b))		:=  ln(a) / select(ln(b)),\nsin(select(a + b))		:=  sin(select(a)) cos(b) + cos(a) sin(b),\nsin(select(2 a))		:=  2 sin(select(a)) cos(a),\nsin(select(n a))		:=  2sin((n-1) select(a)) cos(a) - sin((n-2) a)\n				    :: integer(n) :: n > 2,\ncos(select(a + b))		:=  cos(select(a)) cos(b) - sin(a) sin(b),\ncos(select(2 a))		:=  2 cos(select(a))^2 - 1,\ncos(select(n a))		:=  2cos((n-1) select(a)) cos(a) - cos((n-2) a)\n				    :: integer(n) :: n > 2,\ntan(select(a + b))		:=  (tan(select(a)) + tan(b)) /\n				    (1 - tan(a) tan(b)),\ntan(select(2 a))		:=  2 tan(select(a)) / (1 - tan(a)^2),\ntan(select(n a))		:=  (tan((n-1) select(a)) + tan(a)) /\n				    (1 - tan((n-1) a) tan(a))\n				    :: integer(n) :: n > 2,\ncot(select(a + b))		:=  (cot(select(a)) cot(b) - 1) /\n				    (cot(a) + cot(b)),\nsinh(select(a + b))		:=  sinh(select(a)) cosh(b) + cosh(a) sinh(b),\ncosh(select(a + b))		:=  cosh(select(a)) cosh(b) + sinh(a) sinh(b),\ntanh(select(a + b))		:=  (tanh(select(a)) + tanh(b)) /\n				    (1 + tanh(a) tanh(b)),\ncoth(select(a + b))		:=  (coth(select(a)) coth(b) + 1) /\n				    (coth(a) + coth(b)),\nx && select(a || b)		:=  (x && select(a)) || (x && b),\nselect(a || b) && x		:=  (select(a) && x) || (b && x),\n! select(a && b)		:=  (!a) || (!b),\n! select(a || b)		:=  (!a) && (!b) ]"] 3 (#$ . 3015)])
#@12 MergeRules
(defalias 'calc-MergeRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "MergeRules" "[\niterations(1),\n (x*opt(a)) + select(x*b)	:=  x * (a + select(b)),\n (x*opt(a)) - select(x*b)	:=  x * (a - select(b)),\nsum(select(x)*a,b,c,d)		:=  x * sum(select(a),b,c,d),\n (a/x) + select(b/x)		:=  (a + select(b)) / x,\n (a/x) - select(b/x)		:=  (a - select(b)) / x,\nsum(a/select(x),b,c,d)		:=  sum(select(a),b,c,d) / x,\n (a/opt(b)) + select(c/d)	:=  ((select(a)*d) + (b*c)) / (b*d),\n (a/opt(b)) - select(c/d)	:=  ((select(a)*d) - (b*c)) / (b*d),\n (x^opt(a)) * select(x^b)	:=  x ^ (a + select(b)),\n (x^opt(a)) / select(x^b)	:=  x ^ (a - select(b)),\nselect(x^a) / (x^opt(b))	:=  x ^ (select(a) - b),\nprod(select(x)^a,b,c,d)		:=  x ^ sum(select(a),b,c,d),\nselect(x^a) / (x^opt(b))	:=  x ^ (select(a) - b),\n (a^x) * select(b^x)		:=  select((a * b) ^x),\n (a^x) / select(b^x)		:=  select((b / b) ^ x),\nselect(a^x) / (b^x)		:=  select((a / b) ^ x),\nprod(a^select(x),b,c,d)		:=  select(prod(a,b,c,d) ^ x),\n (a^x) * select(b^y)		:=  select((a * b^(y-x)) ^x),\n (a^x) / select(b^y)		:=  select((b / b^(y-x)) ^ x),\nselect(a^x) / (b^y)		:=  select((a / b^(y-x)) ^ x),\nselect(x^a) ^ b			:=  x ^ select(a * b),\n (x^a) ^ select(b)		:=  x ^ select(a * b),\nselect(sqrt(a)) ^ b		:=  select(a ^ (b / 2)),\nsqrt(a) ^ select(b)		:=  select(a ^ (b / 2)),\nsqrt(select(a) ^ b)		:=  select(a ^ (b / 2)),\nsqrt(a ^ select(b))		:=  select(a ^ (b / 2)),\nsqrt(a) * select(sqrt(b))	:=  select(sqrt(a * b)),\nsqrt(a) / select(sqrt(b))	:=  select(sqrt(a / b)),\nselect(sqrt(a)) / sqrt(b)	:=  select(sqrt(a / b)),\nprod(select(sqrt(a)),b,c,d)	:=  select(sqrt(prod(a,b,c,d))),\nexp(a) * select(exp(b))		:=  select(exp(a + b)),\nexp(a) / select(exp(b))		:=  select(exp(a - b)),\nselect(exp(a)) / exp(b)		:=  select(exp(a - b)),\nprod(select(exp(a)),b,c,d)	:=  select(exp(sum(a,b,c,d))),\nselect(exp(a)) ^ b		:=  select(exp(a * b)),\nexp(a) ^ select(b)		:=  select(exp(a * b)),\nln(a) + select(ln(b))		:=  select(ln(a * b)),\nln(a) - select(ln(b))		:=  select(ln(a / b)),\nselect(ln(a)) - ln(b)		:=  select(ln(a / b)),\nsum(select(ln(a)),b,c,d)	:=  select(ln(prod(a,b,c,d))),\nb * select(ln(a))		:=  select(ln(a ^ b)),\nselect(b) * ln(a)		:=  select(ln(a ^ b)),\nselect(ln(a)) / ln(b)		:=  select(log(a, b)),\nln(a) / select(ln(b))		:=  select(log(a, b)),\nselect(ln(a)) / b		:=  select(ln(a ^ (1/b))),\nln(a) / select(b)		:=  select(ln(a ^ (1/b))),\nlog10(a) + select(log10(b))	:=  select(log10(a * b)),\nlog10(a) - select(log10(b))	:=  select(log10(a / b)),\nselect(log10(a)) - log10(b)	:=  select(log10(a / b)),\nsum(select(log10(a)),b,c,d)	:=  select(log10(prod(a,b,c,d))),\nb * select(log10(a))		:=  select(log10(a ^ b)),\nselect(b) * log10(a)		:=  select(log10(a ^ b)),\nselect(log10(a)) / log10(b)	:=  select(log(a, b)),\nlog10(a) / select(log10(b))	:=  select(log(a, b)),\nselect(log10(a)) / b		:=  select(log10(a ^ (1/b))),\nlog10(a) / select(b)		:=  select(log10(a ^ (1/b))),\nlog(a,x) + select(log(b,x))	:=  select(log(a * b,x)),\nlog(a,x) - select(log(b,x))	:=  select(log(a / b,x)),\nselect(log(a,x)) - log(b,x)	:=  select(log(a / b,x)),\nsum(select(log(a,x)),b,c,d)	:=  select(log(prod(a,b,c,d),x)),\nb * select(log(a,x))		:=  select(log(a ^ b,x)),\nselect(b) * log(a,x)		:=  select(log(a ^ b,x)),\nselect(log(a,x)) / log(b,x)	:=  select(log(a, b)),\nlog(a,x) / select(log(b,x))	:=  select(log(a, b)),\nselect(log(a,x)) / b		:=  select(log(a ^ (1/b),x)),\nlog(a,x) / select(b)		:=  select(log(a ^ (1/b),x)),\nselect(x && a) || (x && opt(b)) :=  x && (select(a) || b) ]"] 3 (#$ . 6704)])
#@13 NegateRules
(defalias 'calc-NegateRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "NegateRules" "[\niterations(1),\na + select(x)			:=  a - select(-x),\na - select(x)			:=  a + select(-x),\nsum(select(x),b,c,d)		:=  -sum(select(-x),b,c,d),\na * select(x)			:=  -a * select(-x),\na / select(x)			:=  -a / select(-x),\nselect(x) / a			:=  -select(-x) / a,\nprod(select(x),b,c,d)		:=  (-1)^(d-c+1) * prod(select(-x),b,c,d),\nselect(x) ^ n			:=  select(-x) ^ a :: integer(n) :: n%2 = 0,\nselect(x) ^ n			:=  -(select(-x) ^ a) :: integer(n) :: n%2 = 1,\nselect(x) ^ a			:=  (-select(-x)) ^ a,\na ^ select(x)			:=  (1 / a)^select(-x),\nabs(select(x))			:=  abs(select(-x)),\ni sqrt(select(x))		:=  -sqrt(select(-x)),\nsqrt(select(x))			:=  i sqrt(select(-x)),\nre(select(x))			:=  -re(select(-x)),\nim(select(x))			:=  -im(select(-x)),\nconj(select(x))			:=  -conj(select(-x)),\ntrunc(select(x))		:=  -trunc(select(-x)),\nround(select(x))		:=  -round(select(-x)),\nfloor(select(x))		:=  -ceil(select(-x)),\nceil(select(x))			:=  -floor(select(-x)),\nftrunc(select(x))		:=  -ftrunc(select(-x)),\nfround(select(x))		:=  -fround(select(-x)),\nffloor(select(x))		:=  -fceil(select(-x)),\nfceil(select(x))		:=  -ffloor(select(-x)),\nexp(select(x))			:=  1 / exp(select(-x)),\nsin(select(x))			:=  -sin(select(-x)),\ncos(select(x))			:=  cos(select(-x)),\ntan(select(x))			:=  -tan(select(-x)),\nsec(select(x))			:=  sec(select(-x)),\ncsc(select(x))			:=  -csc(select(-x)),\ncot(select(x))			:=  -cot(select(-x)),\narcsin(select(x))		:=  -arcsin(select(-x)),\narccos(select(x))		:=  4 arctan(1) - arccos(select(-x)),\narctan(select(x))		:=  -arctan(select(-x)),\nsinh(select(x))			:=  -sinh(select(-x)),\ncosh(select(x))			:=  cosh(select(-x)),\ntanh(select(x))			:=  -tanh(select(-x)),\nsech(select(x))			:=  sech(select(-x)),\ncsch(select(x))			:=  -csch(select(-x)),\ncoth(select(x))			:=  -coth(select(-x)),\narcsinh(select(x))		:=  -arcsinh(select(-x)),\narctanh(select(x))		:=  -arctanh(select(-x)),\nselect(x) = a			:=  select(-x) = -a,\nselect(x) != a			:=  select(-x) != -a,\nselect(x) < a			:=  select(-x) > -a,\nselect(x) > a			:=  select(-x) < -a,\nselect(x) <= a			:=  select(-x) >= -a,\nselect(x) >= a			:=  select(-x) <= -a,\na < select(x)			:=  -a > select(-x),\na > select(x)			:=  -a < select(-x),\na <= select(x)			:=  -a >= select(-x),\na >= select(x)			:=  -a <= select(-x),\nselect(x)			:=  -select(-x) ]"] 3 (#$ . 10303)])
#@13 InvertRules
(defalias 'calc-InvertRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "InvertRules" "[\niterations(1),\na * select(x)			:=  a / select(1/x),\na / select(x)			:=  a * select(1/x),\nselect(x) / a			:=  1 / (select(1/x) a),\nprod(select(x),b,c,d)		:=  1 / prod(select(1/x),b,c,d),\nabs(select(x))			:=  1 / abs(select(1/x)),\nsqrt(select(x))			:=  1 / sqrt(select(1/x)),\nln(select(x))			:=  -ln(select(1/x)),\nlog10(select(x))		:=  -log10(select(1/x)),\nlog(select(x), a)		:=  -log(select(1/x), a),\nlog(a, select(x))		:=  -log(a, select(1/x)),\narctan(select(x))               :=  simplify(2 arctan(1))-arctan(select(1/x)),\nselect(x) = a			:=  select(1/x) = 1/a,\nselect(x) != a			:=  select(1/x) != 1/a,\nselect(x) < a			:=  select(1/x) > 1/a,\nselect(x) > a			:=  select(1/x) < 1/a,\nselect(x) <= a			:=  select(1/x) >= 1/a,\nselect(x) >= a			:=  select(1/x) <= 1/a,\na < select(x)			:=  1/a > select(1/x),\na > select(x)			:=  1/a < select(1/x),\na <= select(x)			:=  1/a >= select(1/x),\na >= select(x)			:=  1/a <= select(1/x),\nselect(x)			:=  1 / select(1/x) ]"] 3 (#$ . 12751)])
#@13 FactorRules
(defalias 'calc-FactorRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "FactorRules" "[\nthecoefs(x, [z, a+b, c]) := thefactors(x, [d x + d a/c, (c/d) x + (b/d)])\n        :: z = a b/c :: let(d := pgcd(pcont(c), pcont(b))),\nthecoefs(x, [z, a, c]) := thefactors(x, [(r x + a/(2 r))^2])\n        :: z = (a/2)^2/c :: let(r := esimplify(sqrt(c)))\n        :: !matches(r, sqrt(rr)),\nthecoefs(x, [z, 0, c]) := thefactors(x, [rc x + rz, rc x - rz])\n        :: negative(z)\n        :: let(rz := esimplify(sqrt(-z))) :: !matches(rz, sqrt(rzz))\n        :: let(rc := esimplify(sqrt(c))) :: !matches(rc, sqrt(rcc)),\nthecoefs(x, [z, 0, c]) := thefactors(x, [rz + rc x, rz - rc x])\n        :: negative(c)\n        :: let(rz := esimplify(sqrt(z))) :: !matches(rz, sqrt(rzz))\n        :: let(rc := esimplify(sqrt(-c))) :: !matches(rc, sqrt(rcc))\n ]"] 3 (#$ . 13864)])
#@17 IntegAfterRules
(defalias 'calc-IntegAfterRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "IntegAfterRules" "[\n opt(a) ln(x) + opt(b) ln(y) := 2 a esimplify(arctanh(x-1))\n     :: a + b = 0 :: nrat(x + y) = 2 || nrat(x - y) = 2,\n a * (b + c) := a b + a c :: constant(a)\n ]"] 3 (#$ . 14748)])
#@10 FitRules
(defalias 'calc-FitRules #[nil "\300\301\302\"\207" [calc-compile-rule-set "FitRules" "[\n\nschedule(1,2,3,4),\niterations(inf),\n\nphase(1),\ne^x  		:=  exp(x),\nx^y		:=  exp(y ln(x))  :: !istrue(constant(y)),\nx/y		:=  x fitinv(y),\nfitinv(x y)	:=  fitinv(x) fitinv(y),\nexp(a) exp(b)	:=  exp(a + b),\na exp(b)	:=  exp(ln(a) + b)  :: !hasfitvars(a),\nfitinv(exp(a))  :=  exp(-a),\nln(a b)		:=  ln(a) + ln(b),\nln(fitinv(a))	:=  -ln(a),\nlog10(a b)	:=  log10(a) + log10(b),\nlog10(fitinv(a)) := -log10(a),\nlog(a,b)	:=  ln(a)/ln(b),\nln(exp(a))	:=  a,\na*(b+c)		:=  a*b + a*c,\n(a+b)^n		:=  x  :: integer(n) :: n >= 2\n		       :: let(x, expandpow(a+b,n))\n		       :: quote(matches(x,y+z)),\n\nphase(1,2),\nfitmodel(y = x)   :=  fitmodel(0, y - x),\nfitmodel(y, x+c)  :=  fitmodel(y-c, x)  :: !hasfitparams(c),\nfitmodel(y, x c)  :=  fitmodel(y/c, x)  :: !hasfitparams(c),\nfitmodel(y, x/(c opt(d)))  :=  fitmodel(y c, x/d)  :: !hasfitparams(c),\nfitmodel(y, apply(f,[x]))  :=  fitmodel(yy, x)\n			       :: hasfitparams(x)\n			       :: let(FTemp() = yy,\n			              solve(apply(f,[FTemp()]) = y,\n					    FTemp())),\nfitmodel(y, apply(f,[x,c]))  :=  fitmodel(yy, x)\n				 :: !hasfitparams(c)\n				 :: let(FTemp() = yy,\n				        solve(apply(f,[FTemp(),c]) = y,\n					      FTemp())),\nfitmodel(y, apply(f,[c,x]))  :=  fitmodel(yy, x)\n				 :: !hasfitparams(c)\n				 :: let(FTemp() = yy,\n				        solve(apply(f,[c,FTemp()]) = y,\n					      FTemp())),\n\nphase(2,3),\nfitmodel(y, x)              :=  fitsystem(y, [], [], fitpart(1,1,x)),\nfitpart(a,b,plain(x + y))   :=  fitpart(a,b,x) + fitpart(a,b,y),\nfitpart(a,b,plain(x - y))   :=  fitpart(a,b,x) + fitpart(-a,b,y),\nfitpart(a,b,plain(-x))	    :=  fitpart(-a,b,x),\nfitpart(a,b,x opt(c))	    :=  fitpart(a,x b,c)  :: !hasfitvars(x),\nfitpart(a,x opt(b),c)	    :=  fitpart(x a,b,c)  :: !hasfitparams(x),\nfitpart(a,x y + x opt(z),c) :=	fitpart(a,x*(y+z),c),\nfitpart(a,b,c)		    :=  fitpart2(a,b,c),\n\nphase(3),\nfitpart2(a1,b1,x) + fitpart2(a2,b2,x)  :=  fitpart(1, a1 b1 + a2 b2, x),\nfitpart2(a1,x,c1) + fitpart2(a2,x,c2)  :=  fitpart2(1, x, a1 c1 + a2 c2),\n\nphase(4),\nfitinv(x)  	:=  1 / x,\nexp(x + ln(y))  :=  y exp(x),\nexp(x ln(y))	:=  y^x,\nln(x) + ln(y)	:=  ln(x y),\nln(x) - ln(y)	:=  ln(x/y),\nx*y + x*z	:=  x*(y+z),\nfitsystem(y, xv, pv, fitpart2(a,fitparam(b),c) + opt(d))\n		:=  fitsystem(y, rcons(xv, a c),\n      		              rcons(pv, fitdummy(b) = fitparam(b)), d)\n		    :: b = vlen(pv)+1,\nfitsystem(y, xv, pv, fitpart2(a,b,c) + opt(d))\n		:=  fitsystem(y, rcons(xv, a c),\n			      rcons(pv, fitdummy(vlen(pv)+1) = b), d),\nfitsystem(y, xv, pv, 0)  :=  fitsystem(y, xv, cons(fvh,fvt))\n			     :: !hasfitparams(xv)\n			     :: let(cons(fvh,fvt),\n				    solve(pv, table(fitparam(j), j, 1,\n						    hasfitparams(pv)))),\nfitparam(n) = x  :=  x ]"] 3 (#$ . 15057)])
(provide 'calc-rules)
