[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Exact (LISP-ish) calculations in Ruby?
From:       Gavin Sinclair <gsinclair () gmail ! com>
Date:       2009-11-20 6:45:39
Message-ID: 1df25170-18ef-4be5-9dc4-df951c1a4f2d () g22g2000prf ! googlegroups ! com
[Download RAW message or body]

On Nov 20, 5:11 pm, David Masover <ni...@slaphack.com> wrote:
>
> > Furthermore, there's a Calculus-based algorithm (Newton's method, it's
> > called in my syllabus, but I think it's properly called the Newton-
> > Raphson method) for calculating square/cube/fourth/... roots to any
> > desired accuracy.
>
> Newton's Method, according to at least one Calculus textbook, is a way of
> finding roots (zeros)

_estimating_ roots (to any desired accuracy)

> for any function for which you can calculate function
> values and derivatives.

> I wrote a program to do Newton's Method. It's one of the few times I wished I
> was using Lisp instead of Ruby, as I had no easy way of taking apart a block
> as source code to find its derivative. Instead, whenever I apply it, I have to
> take the derivative manually, or feed it through Maxima.

Interesting.  I'd be curious to see Lisp and Ruby approaches to
representing and differentiating functions.  Polynomials would be
trivial in Ruby if you build an appropriate representation, but
general functions?  Leave that to the experts, I guess.

--
Gavin Sinclair


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic