Anonymous user
Gradient descent: Difference between revisions
m
→{{header|REXX}}: changed to use a much smaller tolerance, added wording to the REXX section header..
m (→{{header|Phix}}: added a comment involving an exception.) |
m (→{{header|REXX}}: changed to use a much smaller tolerance, added wording to the REXX section header..) |
||
Line 631:
=={{header|REXX}}==
The ''tolerance'' can be much smaller; a tolerance of '''1e-200''' was tested. It works, but causes the program to execute a bit slower, but still sub-second execution time.
<lang rexx>/*REXX pgm searches for minimum values of the bi─variate function (AKA steepest descent)*/
numeric digits (length( e() ) - length(.) ) % 2 /*use half of number decimal digs in E.*/
tolerance= 1e-30 /*use a much smaller tolerance for REXX*/
alpha= 0.1
x.0= 0.1; x.1= -1
|