axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Understanding Axiom.


From: Franz Lehner
Subject: Re: [Axiom-developer] Understanding Axiom.
Date: Fri, 9 Jul 2010 20:47:29 +0200 (CEST)
User-agent: Alpine 1.10 (DEB 962 2008-03-14)

On Fri, 9 Jul 2010, Grigory Sarnitskiy wrote:
Imagine I want to have a function that returns the derivative of real-valued 
function of one real variable, something like

Deriv  : ((Float) -> Float) -> ((Float) -> Float)
As Martin wrote, axiom only handles derivatives of expressions.
In Leibniz' times every function was an expression, nowadays this is not true anymore. In Axiom an object of type Float->Float is a function in the sense of programming, i.e., it takes an object of type float and returns an object of type float.
You can always turn an expression into a function in this sense:
(1) -> y:=sin x + 1

   (1)  sin(x) + 1
                                                    Type: Expression(Integer)
(2) -> function(y,f,x)

   (2)  f
                                                                 Type: Symbol
(3) -> f(u)
   Compiling function f with type Variable(u) -> Expression(Integer)

   (3)  sin(u) + 1
                                                    Type: Expression(Integer)
(4) -> f(1.0)
   Compiling function f with type Float -> Float

   (4)  1.8414709848 078965067
                                                                 Type: Float

regards,
Franz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]