Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ At the heart of DeepCausality is the **Causal Monad** pattern, implemented throu
| `PropagatingEffect<T>` | Stateless effect propagation | Value + Error + Log |
| `PropagatingProcess<T>` | Stateful effect propagation | Value + State + Context + Error + Log |

These monads enable **composable causal computations** where effects flow through a pipeline of transformations wth the following key properties:
- **Error propagation**: Errors short-circuit the chain automatically
- **Logging**: Each step can append to an audit trail
- **Counterfactuals**: `bind` supports hypothetical "what-if" reasoning
These monads enable **composable causal computations** where effects flow through a pipeline of transformations with the following key properties:
- **Error propagation**: Errors short-circuit the chain automatically.
- **Logging**: Each step can append to an audit trail.
- **Counterfactuals**: `bind` supports hypothetical "what-if" reasoning.

### The Three Pillars

Expand Down
23 changes: 23 additions & 0 deletions deep_causality_num/src/algebra/field_real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ pub trait RealField:
/// ```
fn tanh(self) -> Self;

/// Computes the arctangent of a number. Return value is in radians in the
/// range [-pi/2, pi/2];
///
/// ```
/// use deep_causality_num::Float;
///
/// let f = 1.0;
///
/// // atan(tan(1))
/// let abs_difference = (f.tan().atan() - 1.0).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
fn atan(self) -> Self;

/// Computes the four-quadrant arctangent of `self` (y) and `other` (x).
/// # Example
/// ```
Expand Down Expand Up @@ -399,6 +414,10 @@ impl RealField for f32 {
fn epsilon() -> Self {
f32::EPSILON
}

fn atan(self) -> Self {
Comment thread
marvin-hansen marked this conversation as resolved.
f32::atan(self)
}
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -578,4 +597,8 @@ impl RealField for f64 {
fn epsilon() -> Self {
f64::EPSILON
}

fn atan(self) -> Self {
f64::atan(self)
}
}
4 changes: 4 additions & 0 deletions deep_causality_num/src/float_double/traits_algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,8 @@ impl RealField for DoubleFloat {
fn epsilon() -> Self {
Self::EPSILON
}

fn atan(self) -> Self {
<Self as Float>::atan(self)
}
}
Loading