Skip to main content
18-Opal
November 23, 2021
Solved

How much more efficient is this?

  • November 23, 2021
  • 3 replies
  • 4603 views

Apparently, https://www.poshenloh.com/quadraticdetail/ shows a 'new" way of solving quadratic equations.

It is described as "computationally-efficient, .."  

Math Genius Has Devised a Wildly Simple New Way to Solve Quadratic Equations (sciencealert.com)

Does anyone know how to do timing tests in mathcad to check the difference in speeds in the "new" and the generally old method?

muser_0-1637629518069.png

 

 

Best answer by Werner_E

Of course its just a different way to write the old well known formula and so you should not expect much difference in execution time - it mostly depends on the implementation (and also on the implementation of, e.g. the root function etc.).

Here's my comparison:

Werner_E_0-1637681232828.png

Here are a few more runs

Werner_E_1-1637681320446.png

 

Prime 6 worksheet attached, sorry, not working in Express

3 replies

25-Diamond I
November 23, 2021

A not very exact way is to use the "time" function inside of a program which calls the solvefunctions you created multiple times.

Components for a more precise timing were posted here a long time ago, but they won't work in Prime.

 

Did you already turn the "new" solve method into a Mathcad function?

18-Opal
November 23, 2021

No - I'll stick to the old. Fast enough for me.

23-Emerald IV
November 23, 2021

I don't think the argument is about computational speed, but more about not having to remind a formula.

You still have to calculate one square root and do some additions, subtractions, multiplications and divisions.  But to save you from reminding that formula, you now have to remember a multi step approach, and it all comes down to the same (which is good, because you wouldn't want this new approach to find different roots for the same expression).

LucMeekes_3-1637667334392.png

I don't know what is more complicated.

 

Success!
Luc

 

Werner_E25-Diamond IAnswer
25-Diamond I
November 23, 2021

Of course its just a different way to write the old well known formula and so you should not expect much difference in execution time - it mostly depends on the implementation (and also on the implementation of, e.g. the root function etc.).

Here's my comparison:

Werner_E_0-1637681232828.png

Here are a few more runs

Werner_E_1-1637681320446.png

 

Prime 6 worksheet attached, sorry, not working in Express

23-Emerald I
November 23, 2021

Prime 4.0 Express file attached.  Try it!

 

We have a winner

23-Emerald I
November 23, 2021

Taking advantage of Stuart's efforts:

Fred_Kohlhepp_0-1637683432527.png

 

23-Emerald V
November 23, 2021

Hi Fred,

 

If you change that 1 as the first argument to timer1 to something like 10^3 or 10^4, you might get a better idea of the difference.  The timer functions accumulate the time taken to execute function f n times.

 

Stuart

 

I'm away from a Mathcad machine at the moment ... I'm busy on my iMac, trying to get an Adafruit Feather RP2040 to do something and it's not cooperating!  👿