C#,数值计算——指数分布(Expondist)的计算方法与源程序

using System;

namespace Legalsoft.Truffer

{

public class Expondist

{

private double bet { get; set; }

public Expondist(double bbet)

{

this.bet = bbet;

if (bet <= 0.0)

{

throw new Exception("bad bet in Expondist");

}

}

public double p(double x)

{

if (x < 0.0)

{

throw new Exception("bad x in Expondist");

}

return bet * Math.Exp(-bet * x);

}

public double cdf(double x)

{

if (x < 0.0)

{

throw new Exception("bad x in Expondist");

}

return 1.0 - Math.Exp(-bet * x);

}

public double invcdf(double p)

{

if (p < 0.0 || p >= 1.0)

{

throw new Exception("bad p in Expondist");

}

return -Math.Log(1.0 - p) / bet;

}

}

}

相关推荐
地平线开发者19 小时前
【模型轻量化专题】衡量模型轻量性的指标
算法
学习星球1 天前
OFDM技术精讲:正交性推导、循环前缀原理与80行Python链路仿真(附实测数据)
算法·面试·前端框架
JustCheng1 天前
Dispacher(1/2)深入解析-详细使用
c#
alphaTao1 天前
LeetCode 每日一题 2026/8/24-2026/8/30
python·算法·leetcode
Interview Aid1121 天前
TikTok OA 四题分享|半小时内 AC,题目基本都是实现题
java·开发语言·算法·面试·职场和发展
CoderIsArt1 天前
C#中UI 线程与 Dispatcher
开发语言·ui·c#
顶点多余2 天前
那些在算法中适合巩固的知识点---1
java·前端·算法
罗西的思考2 天前
【Agentic RL / 强化学习框架】Molt 设计解读
人工智能·算法·机器学习
hahaha60162 天前
HLS高层次综合设计技巧--C++类和模板
图像处理·人工智能·算法·计算机视觉
不正经的码狗2 天前
数学建模入门
数学建模