-> a -- ^ The \"right\" endpoint, @b@
-> b
trapezoid_1 f a b =
- (((f a) + (f b)) / 2) * (fromRational' $ toRational (b - a))
-
+ (((f a) + (f b)) / 2) * coerced_interval_length
+ where
+ coerced_interval_length = fromRational' $ toRational (b - a)
-- | Use the composite trapezoid rule to numerically integrate @f@
-- over @n@ subintervals of [@a@, @b@].