Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
between addition and multiplication
So I tried this out on the weekend to see what it looked like, and it works very well. Between addition and multiplication I used the "weighted arithmetic-geometric mean" that I described earlier in the post. Between multiplication and exponentiation I used a similar weighted function I call the "weighted exponential-geometric mean". Here is the C code; I lazily had it iterate 6 times instead of calling itself recursively and ending when the two means were close enough. I calculate m = a * b and n = a ^ b, I specify phi with some value between 1 and 2 and I call this function:

float wgxm(float m, float n, float phi)
int i;
float p,q;
for (i=1;i<6;i++) {
p = pow(n/m,phi) * m;
q = pow(m, pow(log(n)/log(m),phi));
m = p;
n = q;
return p;

The attached graph shows the functions y = x {phi} 3, where phi varies from 0 to 2 by stepping 0.2. The light blue lines are at integer values of phi, i.e. y=x+3, y=3x and y=x^3. The yellow lines are the values calculated by the function above (and the corresponding one between addition and multiplication. The x axis goes from 1 to 20 and the y axis goes from 0 to 800. The grid lines are every unit in the x direction, and every 40 units in the y direction.

Something needs to be done to clean up the exponential/geometric interpolation function a little for it to work with values close to x=1 (the log of values close to 0 is negative). I don't think the formula works quite right whenever x^3 is smaller than x*3. The second attached graph is a close-up of the first, where x goes from 1 to 2 and y goes from 1 to 9, with gridlines in both directions every 0.25 (meaning the stretching/scaling is only by a factor of 2).

I'll have to see how the wgxm function looks if I interpolate between 3x and 3^x next, instead of x^3. Let me know if you think any of this looks nice.

(03/11/2011, 06:12 PM)JmsNxn Wrote:
(03/11/2011, 12:35 AM)lloyd Wrote: Surely, though, {0.25} should be weighted 3/4s towards the arithmetic mean, and 1/4 towards the geometric mean. Ah but is the weighting carried out arithmetically or geometrically? Apply a 3/4 arithmetic : 1/4 geometric weighting there too! And take the limiting case again.

In other words, for a {0.25} b, with a<b,

m1 of a and b = a + (b-a)*0.25 (0.25 of the way between a and b, judged arithmetically)
m2 of a and b = a * (b/a)^0.25 (0.25 of the way between a and b, judged geometrically)

Now plug m1 and m2 into a and b, and iterate until you get something stable (i.e. m1 = m2 to whatever degree of precision you need)

This seems like a good generalisation to real values between 0 and 1!

Yes! I like that a lot.

Attached Files Image(s)

Messages In This Thread
between addition and multiplication - by lloyd - 03/10/2011, 09:10 PM
RE: between addition and multiplication - by lloyd - 03/14/2011, 05:33 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  A fundamental flaw of an operator who's super operator is addition JmsNxn 4 6,893 06/23/2019, 08:19 PM
Last Post: Chenjesu
  Between addition and product ( pic ) tommy1729 4 3,759 07/10/2016, 07:32 AM
Last Post: Gottfried
  special addition tommy1729 0 1,795 01/11/2015, 02:00 AM
Last Post: tommy1729
  extension of the Ackermann function to operators less than addition JmsNxn 2 4,026 11/06/2011, 08:06 PM
Last Post: JmsNxn
  Periodic functions that are periodic not by addition JmsNxn 0 2,734 04/17/2011, 09:54 PM
Last Post: JmsNxn

Users browsing this thread: 1 Guest(s)