README.md in dydx-0.1.3 vs README.md in dydx-0.1.4

- old
+ new

@@ -1,124 +1,89 @@ -# Dydx is new math DSL in Ruby +# Dydx is new MATH Language on Ruby. ### Since you report a bug, I will fix it within 24 hours. The most important thing in this DSL is we can handle math in the same sense sense of the math on paper. ex. limit, trigonometric functions and logarithmic. +## We should enjoy MATH even using PC. +(to say nothing of using pen.) After `inlcude Dydx` , ruby become like other language. ## Outline ```ruby: require 'dydx' include Dydx # Define the function. syntax is not good enough... -f(x) <= x ^ 2 +f(x, y) <= x + x*y + y -f(3) -=> 9 +# simplify +f(x, y) == x * (1 + y) + y +=> true -f(x).to_s -=> "( x ^ 2 )" +#part substitution +f(a, 2) == 3*a + 2 +=> true -f(x) == eval('f(x).to_s') +f(1, a + b) == 1 + 2 * ( a + b ) => true + # Differentiate -g(x) <= d/dx(f(x)) +d/dx(f(x, y)) == 1 + y +=> true -g(3) -=> 6 +g(x) <= sin(x) -g(x).to_s -=> '2 * x' +d/dx(g(x)) == cos(x) # Integrate -S(f(x), dx)[0, 1] -=> 0.3333333333333334 +S(g(x), dx)[0, pi/2] +=> 1.0 ``` #### limit, trigonometric functions and logarithmic. ```ruby: f(z) <= log(z) S(f(z), dz)[0,1] => -Infinity -( d/dx(log(x)) ).to_s -=> "( 1 / x )" +d/dx(log(x)) == 1 / x +=> true -( d/dx(cos(x)) ).to_s -=> "( - sin( x ) )" +d/dx(cos(x)) == -cos(x) +=> true -( d/dx(e ^ x) ).to_s -=> "( e ^ x )" +d/dx(e ** x) == e ** x +=> true -f(x) <= sin(x) -S(f(x), dx)[0, Math::PI/2] -=> 1.000000000021139 - # standard normal distribution; -f(x) <= (1.0 / ( ( 2.0 * pi ) ^ 0.5 ) ) * ( e ^ (- (x ^ 2) / 2) ) +f(x) <= (1.0 / ( 2.0 * pi ) ** 0.5) * e ** (- x ** 2 / 2) S(f(x), dx)[-oo, oo] -=> 0.9952054164466917 +=> 1.0 ``` -#### it's like a magic... - -```ruby: -f(x) <= x ^ 2 - -f(a + b).to_s -=> "( ( a + b ) ^ 2 )" - -#↓it"s magic!!! -g(a, b) <= f(a + b) - -g(a, b).to_s -=> "( ( a + b ) ^ 2 )" - -g(2, 2) -=> 16 - -( d/da(g(a, b)) ).to_s -=> "( 2 * ( a + b ) )" - -# simplify -((x * y) + (z * x)).to_s -=> "( x * ( y + z ) )" - -((x ^ y) / (x ^ z)).to_s -=> "( x ^ ( y - z ) )" - -(x + x).to_s -=> "( 2 * x )" -``` - - ## Documents I'm going to write now...cominng soon.... ### Module, class configuration ``` Dydx |- Algebra - | |- Set - | | |- Num - | | |- .... - | | | |- Operator | | |- Interface | | |- .... | | + | |- Set | |- Formula | |- inverse | |- Function |- Delta @@ -154,8 +119,8 @@ ## Test run `bundle exec rake spec` ``` -Finished in 3.23 seconds -309 examples, 0 failures +Finished in 3.76 seconds +325 examples, 0 failures ```