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;

}

}

}

相关推荐
殷色玫瑰2 小时前
C语言编译和链接:从 .c到 .exe,程序到底经历了什么?
linux·c语言·c++·算法
keep intensify3 小时前
C++20线程池
c++·算法·c++20
奋发向前wcx3 小时前
CSP-J复赛模拟赛2 王晨旭补题 2026.10.3
算法
All for pursuit.3 小时前
【回溯-5】78.子集
数据结构·c++·算法·leetcode
蒲公英eric3 小时前
Python工具链与LaTeX排版:把兵器配齐
人工智能·python·算法·数学建模·数学建模工具
别动我齐刘海4 小时前
简历技术栈全面复习总结
c++·人工智能·深度学习·学习·tcp/ip·算法·rpc
hetao17338374 小时前
2026-10-03 hetao1733837 的刷题记录
c++·算法
当时皓月4 小时前
Spur Generation and Modulation(杂散的产生与调制)
数学建模·芯片
UIU1144 小时前
-7 / 2 在 C 里是 -3,在 Python 里是 -4,谁算错了?
c++·学习·c#
这张生成的图像能检测吗4 小时前
(论文速读)Object-Driven Multi-Layer Scene Decomposition:从单张图像恢复遮挡后的多层场景
人工智能·算法·计算机视觉·rgb-d·场景分解