Topic: Large equations

I wrote a program several months ago, that determines the factors of an equation.
It does it's job and I use "Graph" to confirm my results.
But I have a 'large' equation that my program don't agree!
The equation is :
48x^22 + 32x^20 + 81.12x^18 - 252.64x^14 - 149.1428x^13 + 125.76x^12 - 99.4285x^11 - 56.6228x^9 + 442.12x^5 + 114x^4 - 220.08x^3 + 76x^2 - 149.34

I get :
* No Rational roots found *
4 irrational root(s)
            between
-0.9266986843 and -0.9266986842                                                             y
0.9266978347 and  0.9266978348
0.9591199950 and  0.9591199951
1.0641530325 and  1.0641530326

Sorry, but I'm partially blind and am having difficulty reading the graph.
Do you agree with my results ?
Can you help please ?
Pete

Re: Large equations

Yes, that seems to be correct. In case you didn't know, you can use Calc|Evaluate to find the roots when you plot the function. If you select x-axis under Snap to, you can click on the graph to find the nearest root.

Re: Large equations

Thanks Ivan,
  Will save  me 'hunting' around!
Did you get the same/similar results ?
I must get down to reading the manual!
Pete

Re: Large equations

Hi Ivan,
  I think before the week is over you'll be fed up with my questions!
If so, just say - I'll leave off!
In my program I have to determine a range of 'x' values to check - I'm
currently multiplying the 1st coefficient by the constant, which I try in the equation in steps of 1 / 1000000000!
This can lead to (say) 10 minutes calculation - can you give me any idea how to narrow this down ?
I gather you are either a mathematician or a programmer - or both - yes?
Excellent program (Graph).
Pete

Re: Large equations

Did you get the same/similar results ?

Graph gives the following roots for the function, which are the same you have found:
-0.92669868427
0.92669783476
0.95911999503
1.06415303253

currently multiplying the 1st coefficient by the constant, which I try in the equation in steps of 1 / 1000000000!
This can lead to (say) 10 minutes calculation - can you give me any idea how to narrow this down ?

I am not sure what exactly it is you are trying to do, which makes it a little difficult to give suggestions.

I gather you are either a mathematician or a programmer - or both - yes?

Well, I have an education as electrical engineer, but I have only been working with software development.

Re: Large equations

Hi Ivan,
  Example : x^2 + 5x + 6
To clarify : I determine a range of values of 'x' to be substituted in the equation, in this case -6 to +6
There are 2 functions FX1 & FX2. and 2 independent values X1 & X2
X2 is 0.0000001 greater than X1, these are substituted into FX1 & Fx2 and the results are checked for difference in signs.
Any 'crossover' is stored.
X1 is stepped to the X2 value and X2 is stepped by Delta (0.0000001)

Hope that  makes sense!

I tried a rather 'difficult' equation :
28x13 + 125.76x12 - 99.4285x11 - 56.6228x9 + 442.12x5 + 114x4 - 220.08x3 + 76x2 - 149.34
and got these results :
      * No Rational roots found *
3 irrational root(s)
            between
-5.1899587195 and -5.1899587194                                                             y
-0.9452824780 and -0.9452824779
0.8321704412 and  0.8321704413
but using Graph only displayed the last 2 - any ideas?
Regards
Pete

Re: Large equations

This is an interesting case. It is because the function is so steep. If you change Draw type for the function to Lines you will get the expected result.

Graph calculates a lot of points. When Lines is chosen, Graph will simply connect all the points with lines. When Automatic is chosen, Graph tries to be smart and only connect the points it thinks should be connected. For example it will not show a vertical line at x=0 for f(x)=1/x.

In this case Automatic fails. Apparent the slope is so steep that Graph thinks it is jumping like f(x)=1/x does. I think it is the first time I have seen it failing.

Re: Large equations

Thanks Ivan.
Yet again you've rescued me!
I'll try it - glad it gave you something new!
Pete

Re: Large equations

Hi Ivan.
  Managed to get back - at last!
You mention Snap-to  but I cant find it anywhere...
Pete

Re: Large equations

It is in the frame shown when you select Calc|Evaluate in the menu:
https://www.padowan.dk/doc/english/EvaluateDialog.html

Re: Large equations

Hi Ivan,
  I recently ran my program (Find factors) with
x^4 - 10x^3 + 36x^2 - 55x + 31
and it came up with Q"No solutions" (Real or irrational)
so naturally I went to Graph.
Initially it seemed to concur but (very briefly) I saw a very narrow "spike"
but I was not able to capture it again.
It was asymptotic, and almost vertical.
Would you be so kind and see if you can find it ?
It appeared to be around x = 1.01652...

A close equation with the constant as 30 gives :
                                              (x - 2)(x - 3)
                                2 approximate (irrational?) roots
                    x1 = +1.381966011250   f(x1) = +0.000000000000239808173319034
                    x2 = +1.381966011251   f(x2) = -0.00000000000200017780116468

                    x1 = +3.618033988749   f(x1) = -0.00000000000200017780116468
                    x2 = +3.618033988750   f(x2) = +0.00000000000019984014443252

Regards
Pete

Re: Large equations

I cannot find any spikes. Your function doesn't have any roots. I tried entering it into the equation solver at https://www.mathpapa.com/equation-solver/ and it confirms that there are no roots.

Re: Large equations

Hi Ivan,
  If you've time & patience would you check this equation out for me please.
It's a X^4... equation which can only give  4, 2 or 0 roots.
On the Graph it gives 3 !!
The equation is : x^4 - 9.9999x^3 + 35.9992x^2 - 54.9979x + 29.9982

I'm NOT deliberately looking for problems in your program - honest!!!
Regards
Pete

Re: Large equations

I don't know how you get 3 roots. I can see 4: 1.38189365, 2, 3, 3.61800635

I actually need someone to find bugs in Graph. Otherwise they don't get fixed. And you do provide some interesting test cases.

Post's attachments

Roots.png, 5.58 kb, 600 x 300
Roots.png 5.58 kb, 513 downloads since 2019-05-21 

Re: Large equations

Hi Ivan,
  Thanks.
Me, not being able to use your programs settings!
Actually there are 2 Real roots (2 & 3) and 2 Irrational roots (1.8189364...  &  3.61800635...)
If there's any way I can help please let me know (but remember I'm 83 and slowing down!)
Regards
Pete