Module: Symbolic::Math

Defined in:
lib/symbolic/math.rb

Constant Summary collapse

Arg =

for use in defining derivatives

Symbolic::Variable.new(:name=>'Arg')
Abs =

first, make the functions with derivatives

Symbolic::Function.new('abs', proc{|arg| arg/Abs[arg]}){|arg| arg.abs}
Sqrt =
Symbolic::Function.new('sqrt', Rational(1,2) / Arg ** Rational(1,2))
Exp =
Symbolic::Function.new('exp')
Log =
Symbolic::Function.new('log', 1 / Arg)
Log10 =

since log10(x) = log(x) / log(10)

Symbolic::Function.new('log10', 1 / Arg / ::Math.log(10))
Cos =
Symbolic::Function.new('cos')
Sin =
Symbolic::Function.new('sin',Cos)
Tan =
Symbolic::Function.new('tan', 1 / Cos[Arg] ** 2)
Cosh =
Symbolic::Function.new('cosh')
Sinh =
Symbolic::Function.new('sinh',Cosh)
Tanh =
Symbolic::Function.new('tanh',1 / Cosh[Arg] ** 2)
Acos =
Symbolic::Function.new('acos',- 1 / (1 - Arg) ** Rational(1,2))
Asin =
Symbolic::Function.new('asin',1 / (1 - Arg) ** Rational(1,2))
Atan =
Symbolic::Function.new('atan',1 / (Arg**2 + 1))
Acosh =
Symbolic::Function.new('acosh',1 / (1 - Arg) ** Rational(1,2))
Asinh =
Symbolic::Function.new('asinh',1 / (1 + Arg) ** Rational(1,2))
Atanh =
Symbolic::Function.new('atanh',1/ (1 - Arg**2))