Skip to content

Commit f6f1dd0

Browse files
committed
Fixes in precision_bug scripts
* Issue #27
1 parent c31d174 commit f6f1dd0

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

bugs/precision_bug/README

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Run MATLAB scripts with the following command:
2+
3+
/path/to/MATLAB/dir/bin/matlab -nodisplay -nosplash -nodesktop -r script
4+
5+
Note: Take a look to the lack of extension in the script. The script MUST be a .m file,
6+
yet the argument of the command receives it without extension

bugs/precision_bug/expr_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def initialize_config():
1414
config = Config.get_instance()
15-
config.read('../conf/configuration.ini')
15+
config.read('../../conf/configuration.ini')
1616
return config
1717

1818
# Set printable resolution (don't alter numpy interval resolution)
@@ -30,7 +30,7 @@ def initialize_config():
3030
expr61 = "(root (exp (- -6.3726 (* -7.1746 S0))))"
3131
expr612 = "(root (- -6.3726 (* -7.1746 S0)))"
3232

33-
tree = Lisp_Tree_Expr(expr612)
33+
tree = Lisp_Tree_Expr(expr6)
3434
x = np.linspace(-10.0, 10.0, num=201)
3535
mlc_y = tree.calculate_expression([x])
3636

bugs/precision_bug/matlab_expr_test.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
%--------------------- %
55

66
x = -10:0.1:10;
7-
% m = 'exp(((-6.3726) - ((-7.1746) .* S0)))';
8-
m = '((-6.3726) - ((-7.1746) .* S0))';
7+
m = 'cos(exp(((-6.3726) - ((-7.1746) .* S0))))';
8+
% m = '((-6.3726) - ((-7.1746) .* S0))';
99
y = tanh(x.^3-x.^2-1);
1010
m = strrep(m, 'S0', 'x'); y2=eval(m); J=sum((y2-y).^2); fprintf('%.10f\n', J);
1111

0 commit comments

Comments
 (0)