3 ms·
Not really. 1+x/2, however, would be a good approximation to sqrt(1+x) for small (in absolute value) x.
by FabHK 6mo ago
Not really. 1+x/2, however, would be a good approximation to sqrt(1+x) for small (in absolute value) x.
- irchans 6mo agoHow about: (* Mathematica Notation, Assume x>0 ) If[ x < 10^(-10), 1+ x/2, ( order x^2 error ) If[ x> 10^10, Sqrt[x], ( order 1/Sqrt[x] error ) (else) Sqrt[x +1] ] ] ( I guess the If statements take too much time. *)
- notpushkin 6mo agoHN formatter ate up the asterisks in your code comments :) To paste code blocks here, prepend each line with 2 or more spaces: (* Mathematica Notation, Assume x>0 *) If[ x < 10^(-10), 1 + x/2, (* order x^2 error *) If[ x > 10^10, Sqrt[x], (* order 1/Sqrt[x] error *) (* else *) Sqrt[x+1] ] ] (* I guess the If statements take too much time. *)