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>
| Changeset | dd314b634cc9bd4a981bf1ecc47e133f35ef15a9 |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@gmail.com>, |
| Parents | bbb151e42204 |
| Children | |
| Pushlog | by timo via ssh |
modified tools/ingest_tck.py +10 −5
| @@ -70,6 +70,7 @@ | ||
| 70 | 70 | "reverse", "flatten", "sublist", |
| 71 | 71 | # numeric |
| 72 | 72 | "decimal", "floor", "ceiling", "abs", "modulo", |
| 73 | + "sqrt", "exp", "log", "even", "odd", | |
| 73 | 74 | }) |
| 74 | 75 | |
| 75 | 76 | |
| @@ -193,12 +194,16 @@ | ||
| 193 | 194 | # --------------------------------------------------------------------------- # |
| 194 | 195 | |
| 195 | 196 | # 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 | |
| 198 | 202 | 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." | |
| 202 | 207 | ) |
| 203 | 208 | |
| 204 | 209 | |