Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

TSE: Math: Floating: Point: Add 2 positive or negative floating point numbers: DeepSeek AI

30 views
Skip to first unread message

knud van eeden

unread,
Jan 17, 2025, 4:05:01 PMJan 17
to SemWare TSE Pro Text Editor
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):

Prompt used: 

1. Can you create a floating point addition function written in TSE SAL language? Input 2 floating point numbers and output a floating point number"

2. and later in another prompt added handling negative numbers.

Note: I tried Claude AI (paid) first, but too many errors and I reached the limit of asking questions (then you have to wait 3 hours or more to be able. So started anew in DeepSeek from scratch. So I would say that is (again) a fail for Claude AI to create a TSE SAL program without significant errors. So DeepSeek AI is the much better choice for now.

Note: Workflow: I input first a list of TSE rules which I have stored in a file and continue to improve, then after pasting those TSE SAL rules create my prompts. Then I get output running the generated program in TSE. Any errors I feed back into DeepSeek together with new prompt updates until I get a working TSE SAL program.

Note: Example: 

-100 + 0.12345678901234567890 = -99.87654321098765432110

3. See attachment.

4. If you use it and catch any errors (given that you type valid floating point input), let me know.

Thanks
with friendly greetings
Knud van Eeden



tsemathfloatingpointadd.s

Carlo Hogeveen

unread,
Jan 17, 2025, 5:07:53 PMJan 17
to sem...@googlegroups.com

Knud,

Thank you for sharing that macro.
It is a great example of what an AI can and cannot do.
I mean no disrespect when I observe how you giving feedback to the AI limits its end-result to your requirements for adding two floating point numbers.
These are your choices to make, and the end-result works within these requirements.
It revealed to me how a result can still be your own despite the use of AI.
I am going to think about how this probably applies to non-TSE topics too.
Interesting!

Carlo
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/922140167.1392759.1737147895502%40mail.yahoo.com?utm_medium=email&utm_source=footer.

knud van eeden

unread,
Jan 17, 2025, 8:27:28 PMJan 17
to SemWare TSE Pro Text Editor
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):

Prompt used: 

1. Can you create a floating point multiplication function written in TSE SAL language? Input 2 floating point numbers and output a floating point number. The floating point numbers can be positive or negative.

2. Note: Workflow: I input first a list of TSE rules which I have stored in a file and continue to improve, then after pasting those TSE SAL rules create my prompts. Then I get output running the generated program in TSE. Any errors I feed back into DeepSeek together with new prompt updates until I get a working TSE SAL program.

Note: Example: 

0.123456 * -0.123456 gives 0.015241383936

3. See attachment.

4. If you use it and catch any errors (given that you type valid floating point input), let me know.

Thanks
with friendly greetings
Knud van Eeden


.
tsemathfloatingpointmultiply.s

knud van eeden

unread,
Jan 17, 2025, 8:37:42 PMJan 17
to SemWare TSE Pro Text Editor
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):

Prompt used: 

1. Can you create a floating point divide function written in TSE SAL language? Input 2 floating point numbers and output a floating point number. The floating point numbers can be positive or negative.

2. Note: Workflow: I input first a list of TSE rules which I have stored in a file and continue to improve, then after pasting those TSE SAL rules create my prompts. Then I get output running the generated program in TSE. Any errors I feed back into DeepSeek together with new prompt updates until I get a working TSE SAL program.

Note: Example: 

1.5 / 0.5 gives 3

22 / 7 gives 3.1428571428

-22 / 7 gives -3.1428571428

3. See attachment.

4. If you use it and catch any errors (given that you type valid floating point input), let me know.

Thanks
with friendly greetings
Knud van Eeden


.



.
tsemathfloatingpointdivide.s

zhong zhao

unread,
Jan 19, 2025, 8:27:52 PMJan 19
to SemWare TSE Pro text editor
win2k\private\windows\shell\accesory\calc\calc.c
win2k\private\windows\shell\accesory\ratpak\*.*
Search "win2k source code"
for high precision floating-point operation

knud van eeden

unread,
Jan 19, 2025, 9:36:15 PMJan 19
to SemWare TSE Pro text editor
> win2k\private\windows\shell\accesory\calc\calc.c
win2k\private\windows\shell\accesory\ratpak\*.*
Search "win2k source code"
for high precision floating-point operation

Yes, but that is not written in TSE SAL language.

And that is the (big) challenge now... Write those scientific operations in TSE SAL...

So not using some external C DLL or similar
or otherwise an external executable or similar written in C or Python.

with friendly greetings
Knud van Eeden

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/739bc9ac-0e80-4cf9-98ac-6ccead887c6dn%40googlegroups.com.

Guy Rouillier

unread,
Jan 20, 2025, 12:45:53 AMJan 20
to SemWare TSE Pro text editor
"Yes, but that is not written in TSE SAL language.

And that is the (big) challenge now... Write those scientific operations in TSE SAL..."

Why is that an important goal? Several Semware-supplied macros already rely on external DLLs, including sort and spellchk.  If the desired functionality can be better or more quickly provided via a DLL, then using that option seems justifiable.  Especially if Sammy can figure out how to do the same in Linux with .so.

--
Guy Rouillier

knud van eeden

unread,
Jan 20, 2025, 4:07:20 AMJan 20
to Semware TSE Pro
>> Yes, but that is not written in TSE SAL language.
>> And that is the (big) challenge now... Write those scientific operations in TSE SAL...
>> So not using some external C DLL or similar
>> or otherwise an external executable or similar written in C or Python.

===

> Why is that an important goal? 

Challenge thus.

That is where challenges are for, they might be rather arbitrarily. 

It might not an important goal for some.

Carlo proposed it initially and I think it is a really good and challenging idea to try at least some of it.

And very useful because it should run on both Microsoft Windows and Linux and I have several applications in mind already.

===

> Several Semware-supplied macros already rely on external DLLs, including sort and spellchk

No sort.dll in this TSE (e.g. latest 4.50.2) thus.

There is only 1 DLL natively present in current TSE, that is spellchk.dll.

Checking:

Latest version TSE 4.50.2
f:\wordproc\tse_beta Mon 20-01-25 09:59:58>dir *.dll /s
 Volume in drive F is KINGSTON16   Serial number is 6cfc:3e38
 Directory of  F:\WORDPROC\tse_beta\*.dll
26-07-1996  18:31          30,720  spell.dll
              30,720 bytes in 1 file and 0 dirs    32,768 bytes allocated
    Total for:  F:\WORDPROC\tse_beta\
              30,720 bytes in 1 file and 0 dirs    32,768 bytes allocated

===

> Especially if Sammy can figure out how to do the same in Linux with .so.

That has to be seen, it seems not that easy otherwise that functionality would have been there already long since for years.

===

In general adding external executables or DLLs to native TSE would thus be very exceptional from Semware's point of view as far as I know at this moment. Minimal design and file size is the standard in general. 

Though I agree that including e.g. a 'math.dll' would be an interesting idea, it would make TSE even a much more 'full' implementation out of the box.

with friendly greetings
Knud van Eeden


knud van eeden

unread,
Jan 20, 2025, 5:18:56 PMJan 20
to Semware TSE Pro
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):
https://chat.deepseek.com/

+ additional debugging by me.

Use case = calculate the floating point square root for input values from 0 to maximum 214748
 Note: Example: 


SquareRoot( 2 ) gives 1.4142135

SquareRoot( 3 ) gives 1.732051

Method: Newton

See attachment.
getstsrv.s

knud van eeden

unread,
Jan 20, 2025, 8:04:08 PMJan 20
to Semware TSE Pro
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):
https://chat.deepseek.com/

Use case = calculate the floating point Nth root for input values from 0 to maximum 2147 (e.g. for N=2 or N=3)
 Note: Example: 


ThirdRoot( 2 ) gives  1.3333333333

FourthRoot( 256 ) gives 4

Method: Newton-Raphson

See attachment.
getstnrp.s

knud van eeden

unread,
Jan 20, 2025, 8:08:58 PMJan 20
to Semware TSE Pro
Hello,

FYI

This program has been created automatically by DeepSeek AI (this is free to use for now):
https://chat.deepseek.com/

+ additional debugging by me.

Use case = calculate the integer power of a floating point number.
 Note: Example: 

Power( 0.5, 3 ) gives 0.125

Method: Use floating point multiply() to multiply a given value N times with itself.

See attachment.
getstipp.s

knud van eeden

unread,
Jan 21, 2025, 4:49:07 AMJan 21
to SemWare TSE Pro Text Editor
The latest version is attached, 
always use this latest version instead for division.

with friendly greetings
Knud van Eeden

getstfdn.s
Reply all
Reply to author
Forward
0 new messages