5 ms·
How 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 )
by irchans 6mo ago
How 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 5mo 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. *)