The following warnings occurred:
Warning [2] Undefined array key 48125 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 48125 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Quadratic Equation solved in ONE step.



#2

I've seen recent postings referring to solving the quadratic equation on the 41. Here's a solution that only takes ONE program line (of user code, of course :=)

Equation: aX^2 + bX + c = 0

Input: a, b, c in Z, Y, and X of the stack.

Output: - if Z=0, then Y=Im(Z), X=Re(Z) complex roots

- if Z#0, then Y=X1, X=X2 real roots

As expected, no data registers, user flags, or any other dependencies needed. Different acoustic tones will sound depending whether real or complex roots. It is *very* fast.

Hope you enjoy, any comments/improvements are welcome.And if you're not into MCODE, then wait until the new SANDBOX Rom comes out, it will of course have it included (together with Hyperbolics and Complex Arithmetic also as machine code functions).

Best, AM

2A0 SETDEC

0F8 READ 3(X)

2BE C=-C-1 MS

10E A=C ALL

078 READ 1(Z)

261060 ?NC XQ ->1898

128 WRIT 4(L)

078 READ 1(Z)

10E A=C ALL

01D060 ?NC XQ ->1807

10E A=C ALL

0B8 READ 2(Y)

2BE C=-C-1 MS

0AE A<>C ALL

261060 ?NC XQ ->1898

0E8 WRIT 3(X)

10E A=C ALL

135060 ?NC XQ ->184D

10E A=C ALL

138 READ 4(L)

01D060 ?NC XQ ->1807

104 CLRF 8

2FE ?C#0 MS

01B JNC +03

2BE C=-C-1 MS

108 SETF 8

2F9060 ?NC XQ ->18BE

10C ?FSET 8

03B JNC +07

0A8 WRIT 2(Y)

04E C=0 ALL

068 WRIT 1(Z)

130050 LDI S&X CON: 80

083 JNC +10

128 WRIT 4(L)

10E A=C ALL

0F8 READ 3(X)

01D060 ?NC XQ ->1807

0A8 WRIT 2(Y)

138 READ 4(L)

2BE C=-C-1 MS

10E A=C ALL

0F8 READ3(X)

01D060 ?NC XQ ->1807

0E8 WRIT 3(X)

1300C6 LDI S&X CON: 198

358 ST=C XP

379058 ?NC XQ ->16DE

260 SETHEX

3E0 RTN


Possibly Related Threads…
Thread Author Replies Views Last Post
  Equation Library/App for the Prime Harold A Climer 3 1,692 10-30-2013, 10:14 AM
Last Post: CompSystems
  Equation Library on the PRIME Harold A Climer 0 1,038 10-26-2013, 10:01 AM
Last Post: Harold A Climer
  Meltiple Equation Solver PRIME Vs. HP 50G Harold A Climer 5 1,788 10-07-2013, 05:11 PM
Last Post: CR Haeger
  EOT--TI N-Spire Equation Limit Matt Agajanian 2 1,275 09-22-2013, 12:37 PM
Last Post: Matt Agajanian
  Does Prime Have a Multiple Equation Solver? Norman Dziedzic 2 1,346 09-20-2013, 09:43 AM
Last Post: Norman Dziedzic
  Equation of the parabola given three points Gerson W. Barbosa 27 6,369 09-18-2013, 01:58 PM
Last Post: Gerson W. Barbosa
  Quadratic & Cubic Regression RPN progs Matt Agajanian 9 2,890 09-17-2013, 11:37 AM
Last Post: Jeff O.
  WP-34S: Little issue with program step indicator Miguel Toro 6 2,290 09-06-2013, 12:45 PM
Last Post: Miguel Toro
  WP34s program submission: Quadratic fit Andrew Nikitin 2 1,230 06-13-2013, 02:44 AM
Last Post: Paul Dale
  HP 50g: Customize Your Equation Library Software49g 2 1,234 05-27-2013, 12:39 PM
Last Post: Software49g

Forum Jump: