Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

feat(tools): ingest sqrt/exp/log/even/odd built-in calls

public

feat(tools): ingest sqrt/exp/log/even/odd built-in calls

Register the five new call heads in the slice whitelist so their TCK
expressions fit the ingest grammar. Widen the numeric comparison
tolerance from 1e-9 to 1e-8: exp/log return irrationals the TCK rounds
to a fixed number of decimal places (up to 5e-9 of truncation), which a
1e-9 epsilon would reject as a false negative.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changesetdd314b634cc9bd4a981bf1ecc47e133f35ef15a9
Author (claimed)Timo Stolz <timo.stolz@gmail.com>,
Parentsbbb151e42204
Children
Pushlog
by timo via ssh

modified tools/ingest_tck.py +10 −5

@@ -70,6 +70,7 @@
7070
     "reverse", "flatten", "sublist",
7171
     # numeric
7272
     "decimal", "floor", "ceiling", "abs", "modulo",
73
+    "sqrt", "exp", "log", "even", "odd",
7374
 })
7475
 
7576
 
@@ -193,12 +194,16 @@
193194
 # --------------------------------------------------------------------------- #
194195
 
195196
 # feel-core uses f64 where the spec uses decimal128. For numeric results we
196
-# therefore compare with a tolerance instead of exact equality.
197
-F64_EPSILON = 1e-9
197
+# therefore compare with a tolerance instead of exact equality. The tolerance
198
+# also has to absorb the TCK's own rounding: non-terminating results (e.g.
199
+# `exp`/`log`) are given to a fixed number of decimal places (8 -> up to 5e-9 of
200
+# truncation error), which a 1e-9 tolerance would reject as a false negative.
201
+F64_EPSILON = 1e-8
198202
 F64_DEVIATION_NOTE = (
199
-    "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; "
200
-    "numeric results are compared with an epsilon tolerance instead of exact "
201
-    "equality to avoid false negatives from binary floating-point rounding."
203
+    "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, "
204
+    "and the TCK rounds non-terminating results to a fixed number of decimal "
205
+    "places; numeric results are therefore compared with an epsilon tolerance "
206
+    "instead of exact equality to avoid false negatives from either source."
202207
 )
203208
 
204209