New Analytical Functions

Abstract: An attempt was made to analytically describe some basic functions which are provided with the libraries of mathematical functions of programming languages. This study will rely on Mathematica in calculating all numerical results. This study provides global methods to calculate some discrete functions, which were previously calculated by using low-level language techniques to chop digits. Using these definitions we can simulate digital signals without the need for IF statements and conditions.

A comparison were made between the formulas provided by this study and some functions provided by Mathematica such as FractionalPart function that converges very slowly or does NOT converge at all to correct results. The formulas derived herein were applied to complex numbers and some interesting results were obtained, such as the integer part of a complex number equals the Floor of its real part, and will be without imaginary part, i.e. the integer part of a complex number is a real number!

Full article with Mathematica evaluations can be found here:

formatting link
Mohamed Al-Dabbagh

Reply to
Mohamed Al-Dabbagh
Loading thread data ...

Integer part of a complex number is the floor of its real part??? Stop! Think! Does that make sense? You are apparently saying that the integer part of 1+j0 =integer part of 1+j10000 etc. Your algorithm might give this but if it does, then I humbly suggest that it is leading you down the garden path and is not valid. Integer part being the floor of the magnitude of the complex number- no problem. Integer part of each of the real and imaginary components-again no problem. I note that your results presented Int(x) =110 -j30 for x=110.1-j30.1 which appears to be different from your claim. (the '100 is a mystery to me) which implies that the integer function is taking the integer values of both the real and imaginary components. This is contrary to your claim.

I feel that you have been carried away to some extent. For example, f(x)=arctan(tan(x)) or f(x)=arcsin(sin(x)) are really redundant as the solution f(x)=x is,by definition, known. Your algorithm requires x in order to find the fractional part of x. If you already know x, then it is simple to find the integer (or the fractional) part. However, If I give you a value of tan(x) =1 there is no way that one can determine whether x =pi/4, or some value of pi/4 +/- n*pi/2. That is the reason for the periodicity observed in the result from Mathematica. tan(x) has the same magnitude for an infinite number of x values and there is no way to determine which one of these it is unless you already know x- in which case the problem is trivial. In all your examples, x is known.

However, it appears that your intent is to get a general algorithm which is faster than those now used while taking into account periodicity of the function. That is good but it also appears that you have confined yourself to rather useless cases. The speed problem is inherent in the artificial cases that you have presented, not in the evaluation of the fractional part. If your approach has some merit- then you will have to show this merit with cases that are not quite so artificial. Also, please clarify what some of your statements mean- using normal notation, not a Mathematica script.

I suggest that you go through all this and ask yourself "WHY?" "AM I SIMPLY SPINNING MATHEMATICA(L) WHEELS?" , "DOES IT MAKE ENGINEERING SENSE?"

Reply to
Don Kelly

Believe it or not: I don't believe in that to. HOWEVER, the formula I derived proves that.

Check the website again again. You are wrong. The output results for my formulas clearly states that Int(110.1+30.1i)= 110+ 0(1E-19)i which means that the imaginary part has vanished! What you are referring to the output of Mathematica's function which gives the result you mentioned.

You are right from the pure mathematical point of view. HOWEVER, when you use Mathematica or Maple or any software that deals with mathematics, the inverse functions are returned only with principal values. They are not returned with all solutions, as in inverse there is no one-to-one solution.

Believe it or not. When the matter involves derivatives of the FractionalPart function in mathematica, this imposes a lot of difficulties on the software. The main reason that the Mathematica (and other mathematical software) uses chopping algorithms to find FractionalPart. Truncation errors accumulate so dangerously such that it even deceives the comparison algorithms and gives it "an impression" that the result is correct, and convergence occured which is NOT true!

I proved that in the paper:

I have calculated the 2nd dreivative of the fractional part of the function: y=FP(x^5) at x=12.2..

The result using Mathematica's kernel and Mathematica's FractionalPart function was: 33582.83 WHILE the correct result is 36316.96. And guess what? The input was given correct to 400 places of decimals, but the output WASN'T correct even to one significant digit. FURTHERMORE: Mathematica took about 70 seconds to evaluate this result, WITHOUT uttering a word that the algorithm FAILED to converge. One would believe that the result given by Mathematica is correct!

I returned the experiment using my Fr(x) function, and the result:

36316.96 was correct to 400 places of decimals within 0.11 seconds, that means 600 times faster than Mathematica FractionalPart function!

This experiment should give you the impression that there is a serious result that stands behind 600 times improvement in Mathematica's performance, not to mention the precise results as compared to modest results before.

The web page contains a link to the Mathematica notebook that generated exactly the same webpage. You can use it and evaluate results on your machine.

Mohamed Al-Dabbagh

Reply to
Mohamed Al-Dabbagh

-------- I saw that- the result you get is meaningless. That is why I said "THINK" Mathematica gives the integral part of both the real and imaginary values- each of which, taken alone, is a real number. The only other meaningful interpretation is to determine the integral part of the magnitude of the complex number. It is your formula that is giving unrealistic values in this case. It may be in the way that mathematica handles the tan and arctan of a complex number (and your formula is based on "real" arithmetic ).

-------------

---------- Agreed but there is actually no way to differentiate between tan(pi/4) and tan(pi(1/4 +n)) For all n, the value is 1. How then can the inverse function determine the difference between 1 and 1? Note that in your evaluation of INT(x), you have, in addition to the trig functions, used the value of x. It seems that old fashioned conversion from floating point to integer arithmetic which is at the machine language level or hard wired, is a lot simpler than the approach that you have, with rather more complex computation. Secondly, consider how a trig function is evaluated. An interpolation table or more generally a series approximation is used. There are limits to a table (likely only to the 0 to pi/2 range) and a series approximation loses accuracy rapidly for large x. Hence, buried in the software- at an elementary level (often machine language level) any evaluation of a trig function is reduced to the range 0 to pi/2 with a sign change in order to get a fast but accurate answer. This requires several "if" decisions and a mod function based on pi.

------ Possibly there is a problem in "what is the fractional part?" as I see it and as you see it. Is it the fractional part of y ? evidently not Is it the change in y due to the fractional part of x? Apparently so. This is not clear in your paper.

----------------

------------ I calculated the second derivative using an obsolete version of APL*PLUS. This agrees with your result but the time taken, including screen output was less than 0.06 seconds for 100 evaluations including loop time -on an interpreter. Mind you I did not carry the solution beyond 64 bit FP accuracy and there is no practical reason to do so as 400 decimal places is meaningless. I also calculated the fractional part of a set of numbers using your formula and it was correct except for integer x (approximately 60ms for

1000 numbers). The reason is, of course, roundoff and other numerical errors. Have you tried your formula in Mathematica for integer x? Have you compared the speed and accuracy for a set of real floating point numbers, with the Mathematica INT function?

What you have shown is that the Mathematica trig functions are very well optimised while the fractional part function used to calculate a derivative, has a heavy overhead. This seems to be a problem with mathematica, not a general advantage of your routine. Mathematica can give you, quickly, the analytic form of the second derivative of x^5 and should be able to solve this case quickly for any x. I am surprised because of the inherent overhead of trig functions. Certainly less than the 70 seconds quoted. Possibly Mathematica should review their fractional part routine.-this may well be due to the need to handle analytic solutions as well as purely numerical solutions- but you will have to show many more examples to convince them of the errors of their ways.

-------------

--------- The link doesn't lead to the notebook. It does lead to fortunecity

Reply to
Don Kelly

First of all thank you Don for your review.

I think my formula is working well as the floor of a complex number should logically has a derivative of zero. Complex number means that you are considering components of sines and cosines the matter that necessitates the existance of infinite number of derivatives. Also, you have to remember that there is no specific agreement on the meaning of Floor(a + b i). What makes me feel comfortable about my results is that it is all done using trigonometric quantities,and complex numbers are well coherent with the use of trigonometry.

Yes... I know that very well.. However, what has drawn my attention are the dreivative of my formulas, the results were completely correct within the continuity of these functions. This has lead me to experiment things numerically. My choice was Mathematica which is the best in numerical evaluation using arbitrary precision.

Mathematica handbook defines fractional part being the absolute value of the degits to the right of the decimal point. And this is how mathematica calculate it. What encourages me is that I used the SAME Mathematica to evaluate my results.

Mathematica is even faster than you have. If you have Mathematica you will see how swiftly it goes in these things.The purpose of 400 places of decimals I used was to measure the speed and accuracy.

I have tried with many other examples. Some of which taken 30 minutes to evaluate ERRATICALLY! But taken less than a second to evaluate CORRECTLY using my formulas.

You are right, there is a problem with the server.However, you may give your email I will send it over. No problem! Use my email in the website. Thank you for your patience.

Mohamed Al-Dabbagh

Reply to
Mohamed Al-Dabbagh

The significance of knowing some function to have a zero derivative in all of its domain means that it was constant before derivation! Now can we actually consider a complex number to be a constant? IMHO, I cannot consider complex number to be a FULLY CONSTANT. The reason is obvious, complex number has an infinite set of equivalents in terms of phase angle. You can only differentiate between different complex numbers if and only if you write them in polar form.

I don't really know if I am right in considering Mathematica one of the best algebraic applications in the market. However, I am 100% sure that they want to excel in using the most reliable definitions. Mathematica maintains a website that considered one of the most complete encyclopedias online. There is something said there about our discussion:

formatting link
You will see that.... yes! many people interested in these weird functions.

I didn't say second derivative of x^5 !! Maybe you misunderstood: I said the FP''(x^5) that means the second derivative OF the fractional part OF x^5....!!! The study has proved that the second derivative of fractional part of x^5 is equal to the derivative of x^5 (ie FP''(x^5)=f''(x^5). This proof is also included in my study using the definition of fractional part formula (8). The result of this study was used then in the numerical example.

You are right concerning the method by which the Sgn is calculated. Just search for the sign bit and voila. But if you read further in the study, you will see that Sgn function analytic form was a great aid in deriving unit step function, from which one is capable of representing ANALYTIC FORM of piecewise functions! Further one is also capable of finding the derivatives of them or even integrate them (of course we should notice the discontinuities).

What you forget here is that the experiment was done to 400 significant digits. What is sought is an output that is at least 390 digits correct. The output precision cannot exceed input precision. When you tell arbitrary precision software to do a certain math you need to specify how much input digits are available. There is a working precision and precision goal. In my experiment my formulas lead to an answer correct to 400 figures in practically NO time, while Mathematica internal formulas lead to a figure that is ERRATIC in 70 seconds without even complaining of divergence.!!

Mohamed Al-Dabbagh

Reply to
Mohamed Al-Dabbagh

I feel compelled to jump in, but unfortunately lack appropriate tact..

The above is totally false. Stupid even..

False again... Makes no sense at all... Where are you getting this silliness??

adieu

Reply to
dave y.

Let me rephrase: can you remind me of one constant in mathematics or physics which is a complex number (with BOTH real part and imaginary part DO NOT equal zero)? Can you for example add a complex number as a constant to an indefinite integral?

If you write r(cos theta + sin theta i) then if theta is 0 it may also be 2Pi and 4Pi , etc. and they will all indicate the same number if you write it in the form (a+bi).

Mohamed Al-Dabbagh

Reply to
Mohamed Al-Dabbagh

---------- The floor of a number is a single number. It's domain spans a single integer. Rather uninteresting. If you want to represent something by a series of steps, then you have a discontinuous function. derivative =0 except at the step where it becomes infinite. The only significance is that if you are looking for the derivative of a function, then f' (xo +x) =f' (x) where xo is the floor - if the region is limited to xo>Mathematica apparently

Thanks. On the basis of the definitions as used (either one) for the Int and fractional parts (which are what i always knew) there is a great gap in your evaluation of the second derivative- much is left out. Eq 17 hints at part of it.

-------- The report has not proven what you claim. You have since clarified part of this but the fractional part of x^5 is by definition

------- And we couldn't do this before without calling on transcendential functions?

-------

--------- Possibly Mathematica's routine needs work or there is a difference in the way that the problem was presented. I said this before. However, my point is still valid. In real life, the luxury of 100 to 400 decimal points is not available and is meaningless.

If you want, you can continue with this as personal mail.

Reply to
Don Kelly

A mathematical constant: 1+1i

Why is it a constant? Because it never changes!!!

Sure, why not: 1+1i + INTEGRAL(xdx)

This is silly. A constant is still a constant even if if you compute it using trig functions.

e.g. Is ONE a constant? By your logic its not since

1 = sin(pi/2 + 2pi*n)

What's you point to all this nuttiness?

Reply to
dave y.

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.