Logs: liberachat/#haskell
| 2025-09-16 18:37:51 | tomsmeding | . o O ( (a -> r) -> (Error -> r) -> Promise a -> r ) |
| 2025-09-16 18:38:03 | <monochrom> | Lambda The Ultimate Callback Programming |
| 2025-09-16 18:38:59 | → | poscat joins (~poscat@user/poscat) |
| 2025-09-16 18:39:22 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 248 seconds) |
| 2025-09-16 18:39:57 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
| 2025-09-16 18:40:34 | × | poscat0x04 quits (~poscat@user/poscat) (Ping timeout: 256 seconds) |
| 2025-09-16 18:41:16 | → | arandombit joins (~arandombi@user/arandombit) |
| 2025-09-16 18:44:23 | → | Guest14 joins (~Guest91@2a0a:ef40:50c:3901:79f5:d78f:9aec:1a09) |
| 2025-09-16 18:45:03 | <Guest14> | im getting a strange error; |
| 2025-09-16 18:45:03 | <Guest14> | https://paste.tomsmeding.com/ltFVsS2E |
| 2025-09-16 18:45:14 | <Guest14> | the code does not have *any divisions* |
| 2025-09-16 18:45:23 | <Guest14> | how is it producing a NaN |
| 2025-09-16 18:45:40 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 256 seconds) |
| 2025-09-16 18:45:44 | <monochrom> | Actually division doesn't produce NaN. But sqrt does. |
| 2025-09-16 18:45:45 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 2025-09-16 18:45:55 | <monochrom> | division produces Inf. |
| 2025-09-16 18:46:08 | <int-e> | Well, there's 0/0 |
| 2025-09-16 18:46:14 | <Franciman> | indeed... |
| 2025-09-16 18:46:16 | <monochrom> | Ooops. |
| 2025-09-16 18:46:16 | <Guest14> | this is guarded against |
| 2025-09-16 18:46:38 | <Guest14> | it seems to appear when the input is a very small negative number |
| 2025-09-16 18:47:06 | → | arandombit joins (~arandombi@user/arandombit) |
| 2025-09-16 18:47:12 | <Guest14> | on google i find: |
| 2025-09-16 18:47:12 | <Guest14> | Hackage |
| 2025-09-16 18:47:13 | <Guest14> | https://hackage.haskell.org › package › fp-ieee › docs |
| 2025-09-16 18:47:13 | <Guest14> | Returns True if the operand is a negative number, negative infinity, negative zero, or a NaN with negative sign bit. |
| 2025-09-16 18:47:28 | <int-e> | anyway the bit og information that there are no divisions is quite useless |
| 2025-09-16 18:47:57 | <monochrom> | asin acos atan etc can also give NaN for the same reason as sqrt |
| 2025-09-16 18:48:09 | <Guest14> | there is a tanh |
| 2025-09-16 18:48:14 | <Guest14> | ill see if there are any powers |
| 2025-09-16 18:48:28 | <Guest14> | afikt all the arithmetric opperations are + and * |
| 2025-09-16 18:48:28 | <monochrom> | I forgot what else. Consult IEEE 754 for the complete list. |
| 2025-09-16 18:49:11 | <Guest14> | it says something about "signed zeros" |
| 2025-09-16 18:49:33 | <int-e> | Even + and * /can/ produce NaNs. (from variants of inf + -inf and 0 * inf) |
| 2025-09-16 18:49:48 | <Guest14> | but the values are small |
| 2025-09-16 18:49:57 | <Guest14> | the flop is an interpolation# |
| 2025-09-16 18:50:09 | <Guest14> | it seems to not like to approach 0 from -ve numbers? |
| 2025-09-16 18:50:30 | <Guest14> | has me flummoxed |
| 2025-09-16 18:50:43 | <monochrom> | Minimum reproducible example or you can consult IEEE 754 yourself. |
| 2025-09-16 18:50:52 | <int-e> | Guest14: don't speculate. do the actual computation that results in NaN with the actual inputs and see what goes wrong |
| 2025-09-16 18:50:52 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-09-16 18:50:59 | <Guest14> | i checked; https://en.wikipedia.org/wiki/IEEE_754 |
| 2025-09-16 18:51:11 | <Guest14> | int-e: hmm ok |
| 2025-09-16 18:51:15 | <monochrom> | Wikipedia is not going to be complete on this. |
| 2025-09-16 18:51:37 | <Guest14> | i could guard against the NaNs with isNaN, but this would be costly |
| 2025-09-16 18:51:37 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 260 seconds) |
| 2025-09-16 18:51:46 | <Guest14> | i cant see why it would produce NaNs... |
| 2025-09-16 18:52:03 | <Guest14> | ill check for a sqrt, but all i have is interpolation |
| 2025-09-16 18:53:23 | <Guest14> | https://paste.tomsmeding.com/5XD7F7oG |
| 2025-09-16 18:54:03 | <monochrom> | What is / in a/b ? |
| 2025-09-16 18:54:25 | <geekosaur> | just noticed that myself. betting it ends up 0/0 with very small numbers |
| 2025-09-16 18:54:42 | <Guest14> | but its guarded against |
| 2025-09-16 18:55:05 | <int-e> | also taken when b is NaN |
| 2025-09-16 18:55:22 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 2025-09-16 18:55:38 | <Guest14> | what its doing is calculating a volume, thats, the gradient, "lagged" (uses interpolation to fold up a buffer), and the same calc but done with the abs value. the ratio of these, the volume, is like a gradient, except bounded on the unit interval. b is strictly positive |
| 2025-09-16 18:56:42 | <int-e> | and IIUC all of c,a,b, and o are NaN in your test |
| 2025-09-16 18:56:48 | <Guest14> | i think the lag value input as a control must be injecting a NaN from somewhere... i didnt realise. there could be a sqrt somewhere. ill put an abs and then hopefully it will be ok |
| 2025-09-16 18:57:04 | <tomsmeding> | Guest14: insert the isNaN checks now, to find out where the NaN is produced, fix the problem, then remove the isNaN |
| 2025-09-16 18:57:09 | <int-e> | so the inner `control` calls produce NaNs. |
| 2025-09-16 18:57:16 | <Guest14> | yeah, if c is NaN thats the control, the injected value to use as a lag |
| 2025-09-16 18:57:43 | <Guest14> | if it tries to uses that as an interpolation constant in the lag calculation on the buffer it will return NaN |
| 2025-09-16 18:57:54 | <Guest14> | ill try and find where the control is and why its producing a NaN |
| 2025-09-16 18:57:54 | <int-e> | > let nan = 0/0 in nan <= 0.01 |
| 2025-09-16 18:57:56 | <lambdabot> | False |
| 2025-09-16 18:58:02 | → | arandombit joins (~arandombi@user/arandombit) |
| 2025-09-16 18:58:21 | <Guest14> | yeah, thats got to be it |
| 2025-09-16 18:58:47 | <tomsmeding> | right, c is NaN, hen a and b become NaN and all is borked |
| 2025-09-16 18:58:49 | <Guest14> | i was just getting confused because i thought the division is the only place that could produce it and that b is strictly positive by being the lag on a buffer of abs grads |
| 2025-09-16 18:58:59 | <Guest14> | tomsmeding: perzactly |
| 2025-09-16 18:59:06 | <int-e> | If your goal is to produce 0 when b is NaN, then you're going to have to invert that comparison. |
| 2025-09-16 18:59:09 | int-e | shrugs |
| 2025-09-16 18:59:24 | <Guest14> | i just want to find where is the NaN from and fix it. brb |
| 2025-09-16 18:59:31 | <int-e> | But there's no mystery where NaN comes from if it's an input to the function. |
| 2025-09-16 18:59:42 | <int-e> | At least not in this part of the code. |
| 2025-09-16 19:00:01 | × | caconym747 quits (~caconym@user/caconym) (Quit: bye) |
| 2025-09-16 19:00:42 | → | caconym7478 joins (~caconym@user/caconym) |
| 2025-09-16 19:01:26 | → | dontdieych2 joins (~dontdieyc@218.144.158.109) |
| 2025-09-16 19:01:44 | × | dontdieych2 quits (~dontdieyc@218.144.158.109) (Remote host closed the connection) |
| 2025-09-16 19:02:24 | <Guest14> | the input to a power becomes negative; |
| 2025-09-16 19:02:24 | <Guest14> | https://paste.tomsmeding.com/txphlln4 |
| 2025-09-16 19:02:38 | <Guest14> | "rectification" input is small and negative just before it breaks |
| 2025-09-16 19:03:14 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 256 seconds) |
| 2025-09-16 19:04:07 | <Guest14> | idk why it gives a negative value.... but now with an abs it seems ok |
| 2025-09-16 19:04:09 | <Guest14> | thanks for the help |
| 2025-09-16 19:04:12 | × | Guest14 quits (~Guest91@2a0a:ef40:50c:3901:79f5:d78f:9aec:1a09) (Quit: Client closed) |
| 2025-09-16 19:04:29 | → | arandombit joins (~arandombi@user/arandombit) |
| 2025-09-16 19:05:24 | tomsmeding | is unsure slapping an abs on something, where you don't understand why, is going to be a good idea in a dynamical system |
| 2025-09-16 19:06:16 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-09-16 19:10:41 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2025-09-16 19:12:01 | → | dontdieych joins (~dontdieyc@132.226.169.184) |
| 2025-09-16 19:12:17 | × | karenw_ quits (~karenw@user/karenw) (Ping timeout: 248 seconds) |
| 2025-09-16 19:13:58 | → | OftenFaded30 joins (~OftenFade@user/tisktisk) |
| 2025-09-16 19:21:06 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-09-16 19:25:37 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 2025-09-16 19:38:59 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-09-16 19:45:44 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2025-09-16 19:47:22 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 2025-09-16 19:48:42 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 2025-09-16 19:49:03 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
| 2025-09-16 19:49:46 | → | peterbecich joins (~Thunderbi@syn-172-222-149-049.res.spectrum.com) |
All times are in UTC.