Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a formula as such: $$(x^n + y^n)^{1/n} = \alpha$$

$x$, $y$, and $n$ are known and I'm solving for $\alpha$.

Specifically, I'm implementing this in software where I can not use numbers larger than 32-bits. In the case of $x=1024$, $y=1024$, $n=5$ the resulting naive calculation $pow(pow(x, n) + pow(y, n), 1/n)$ won't fit so I need some sort of method to reduce the calculation if possible. Maybe it's not possible, I don't know.

share|improve this question
1  
Shouldn't you use floating point anyway? At least for $n>2$ it is known that $\alpha$ won't be an integer if $x,y$ are. (I have a wonderful proof for that statement, but the comment field is too small) –  Hagen von Eitzen Feb 11 '13 at 14:04
    
Although it would be better not to use floating point (this is an embedded system with no FPU) but if this can be simplified to a simple floating point calculation that might work. How? Are you suggesting for example to reduce $1024$ to a fractional amount? –  CR. Feb 11 '13 at 14:06
4  
Maybe I'm a bit off here, but if $x \ge y > 0$ why not write the formula as $x [1+(y/x)^n]^{1/n}$? That should keep the numbers to be of order unity. –  Ron Gordon Feb 11 '13 at 14:06
    
@CR: Floating point is not only for representing non-integers, but also for approximating numbers that are too large to fit in a machine integer. –  Henning Makholm Feb 11 '13 at 18:27
    
Any other information you can give on $x$, $y$, $n$? Is $x \approx y$ or not? Minimal and maximal values of $x, y$? What values of $n$ are of interest? How precise has the answer to be? –  vonbrand Feb 11 '13 at 18:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.