Re: Linear approx for cube root?





On Tue, 23 Oct 2006, sherwood@xxxxxxxxxxxxxx wrote:

For a cube root subroutine, I want the best linear approximation to
CUBEROOT(x), for x real and in the (discontinuous) range 1/2 <= |x| <
1. In other words, determine a and b to minimize the expected value of
diff = | ax + b - CUBEROOT(x) |. Initially, I am assuming all values of
x are equally probable.

The cube root function on your disconnected domain has odd symmetry, so
the best linear approximation is of the form a*x only (b must be 0).

After some algebra and calculus, I obtained

a = 2/5^(1/3), approximately 1.16960709528515

Is this what you really wanted?

For comparison, the value of a that minimizes the maximal absolute
difference is

a=(2+4^(1/3))/3, approximately 1.19580035065607

And the value of a for the least squares error is

(9/49)*(8-2^(2/3)), approximately 1.17782429657727

Cheers, ZVK(Slavek).
.