# HP Forums

Full Version: [WP 34s] Trouble finding root - (solved)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I am having troubles finding the root of the following equation:

$0.05=\frac{x\times coth(x) - 1}{10x\times coth(10x) - 1}$

to which I created the following program:

Code:
 LBL 01 #10 * ENTER TANH / 1 - x<>y ENTER TANH / 1 - x<>y / #005 #100 / - END

1
5
SLV 01

The 34s will complain there is a domain error.

Hope I am missing something.

Thanks

Marcio

EDIT: Found the error. Problem solved!
(06-29-2015 01:09 AM)Marcio Wrote: [ -> ]EDIT: Found the error. Problem solved!

It would be interesting for others to know what went wrong and how you fixed it.
(06-29-2015 01:09 AM)Marcio Wrote: [ -> ]Hello all,

I am having troubles finding the root of the following equation:

$0.05=\frac{x\times coth(x) - 1}{10x\times coth(10x) - 1}$

to which I created the following program:

Code:
 LBL 01 #10 * ENTER TANH / 1 - x<>y ENTER TANH / 1 - x<>y / #005 #100 / - END

1
5
SLV 01

The 34s will complain there is a domain error.

Hope I am missing something.

Thanks

Marcio

EDIT: Found the error. Problem solved!

You could save a few steps:
Code:
LBL 01 XEQ 00 X<>Y SDL 001 ENTER XEQ 00 / #005 SDR002 - RTN LBL 00 TANH / 1 - END
(06-29-2015 07:37 AM)Marcus von Cube Wrote: [ -> ]
(06-29-2015 01:09 AM)Marcio Wrote: [ -> ]EDIT: Found the error. Problem solved!

It would be interesting for others to know what went wrong and how you fixed it.

The 34s complained because the first guess I entered was zero.
(06-29-2015 11:06 AM)RMollov Wrote: [ -> ]You could save a few steps:
Code:
LBL 01 XEQ 00 X<>Y SDL 001 ENTER XEQ 00 / #005 SDR002 - RTN LBL 00 TANH / 1 - END

Yes, much shorter. Thanks.
(06-29-2015 11:23 AM)Marcio Wrote: [ -> ]Yes, much shorter. Thanks.

Both shorter and faster, using the some special 34s features:

Code:
LBL 01 TANH / DEC X X<> Y SDL 001 ENTER TANH / DEC X / #005 SDR 002 - END

1 [ENTER] 5 [SLV] 01
=> 1,64561382716

Dieter
Indeed. Faster than the solver of the 35s too.
Code:
 LBL 1 1 0 * ENTER TANH / 1 - x<>y ENTER TANH / 1 - x<>y / 0 . 0 5 / - END

Gentlemen,

I have been trying to solve this equation for X using the 15C but it is not working.

Anyway, the code above will make the 15C output 0.0389, which is not correct. Could you identify what I am missing here?

Please note that there has been no attempt to optimize the given code.

Very much appreciated.

Marcio
Marcio Wrote: [ -> ]Could you identify what I am missing here?

Just remove the last "/", before the "-".
(08-05-2015 03:48 AM)Didier Lachieze Wrote: [ -> ]
Marcio Wrote: [ -> ]Could you identify what I am missing here?

Just remove the last "/", before the "-".

Oh yes, I forgot to remove that extra /. Thanks.
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :