Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions (/thread-220516.html) |
Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Gerson W. Barbosa - 05-08-2012 In the latest Datafile issue (V31 N2) Wlodek Mier-Jedrzejowicz says his best slide rule (one he actually never used as it was soon replaced by the HP-35), a top of the range model from the German company Aristo, had 30 scales on it. They included the sqrt(1 - x2) and sqrt(1 + x2) functions, which to this day, he says, are not available on calculators. Well, they can be implemented using only two steps each (four, if we count LBL and RTN) on most RPN programmable calculators, like the HP-11C, for instance. Is someone willing to present these or other solutions?
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Crawl - 05-08-2012 Sin(Arccos(x)) = Sqrt(1 - x^2) Cosh(Arcsinh(x)) = Sqrt(1 + x^2)
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Gerson W. Barbosa - 05-08-2012 Exactly!
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Paul Dale - 05-08-2012 More interesting from a numeric standpoint are 1-sqrt(1-x2) and sqrt(1+x2)-1.
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Dieter - 05-09-2012 No problem - all this can be done with two other functions that are available on HP calculators since 1979 - and today again on the 34s: sqrt(1+x^2) - 1 1 - sqrt(1-x^2)That's what these functions are made for. ;-)
Dieter
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Eduardo Duenez - 05-10-2012 It's true that a numerically stable formula for sqrt(1-x^2)-1 for small x can be given in terms of ln(x+1) and exp(x)-1. However, a logarithm/exp combination is a very inefficient way to compute these functions! (E.g., the algorithm for x^2 is not exponentiating twice the log. For that matter, efficient algorithms for x^2 do not simply multiply x by itself.)
A related thought: On the opposite case, when abs(x) is close to 1, say for concreteness that x=1-t for some small t, then evaluating sqrt(1-(1-t)^2) directly is numerically unstable, but never forget your algebra: rewrite in the stable form sqrt(t*(2-t)).
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Paul Dale - 05-10-2012 Alternatively, multiply through by (1 + sqrt(1-x2)) over itself. A little bit of algebra leads to this formula: 1-sqrt(1-x2) = x2 / (1 + sqrt(1-x2)) which is stable. The same can be done for sqrt(1+x2)-1.
- Pauli
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Palmer O. Hanson, Jr. - 05-10-2012 The old NOVUS 4510 Mathematician had a function (M + x2).
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Matt Agajanian - 05-10-2012 Yeah. I remember that too. Wonder if that was added to give the 4510 a competitive edge, features incentive over TI & HP. Edited: 10 May 2012, 11:07 p.m.
Re: Sqrt(1 - x^2) & Sqrt(1 + x^2) functions - Palmer O. Hanson, Jr. - 05-11-2012 If you go to Article 437 you will see that the function permitted efficient accumulation of the sums needed for single variable statistical analysis in a machine which did not have a built-in Sum+ capability.
|