Re: Looking for a simple function with known values




William Elliot wrote:
On Mon, 20 Feb 2006, Anderson wrote:

do you see a simple increasing function with the following constraints:
f(0) = 0
f(1) = 1/2

f'(0) = sqrt(2)/2
f'(1) = log(2)/2

No. As log 2 and ln 2 are negative, f cannot be increasing at 1.

Um, ln(2) = 0.6931

In answer to the original question:

Consider a cubic f(x) = a3 x^3 + a2 x^2 + a1 x + a0.

f(0) = a0.
f(1) = a3 + a2 + a1 + a0
f'(0) = a1
f'(1) = 3 a3 + 2 a2 + a1

a0 and a1 are given immediately by your conditions.
You can easily solve for a2 and a3.

There is nothing to guarantee that such an interpolating cubic has
to be an increasing function, but in this case it is.

- Randy

.



Relevant Pages

  • Re: design question - member function argument or pointer member
    ... So far all of the postings have focused on inheritance, composition, etc. ... in your original question you stated: ... what guarantee do we have that the client will even ...
    (comp.lang.cpp)
  • Re: ORDER BY and IDENTITY
    ... directed toward a response to the original question, ... > The order by clause must work, is it the sequence of the identity values ... >> SQL Server does guarantee the order of the result set based on the ORDER ... >> direction used to create the clustered index. ...
    (microsoft.public.sqlserver.programming)