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;

}

}

}

相关推荐
xiaoshuaishuai829 分钟前
C# AI实现PR处理、单元测试
开发语言·c#·log4j
LONGZHIQIN32 分钟前
C#基础复习笔记
开发语言·笔记·c#
可靠的仙人掌1 小时前
SAC(Soft Actor-Critic)算法底座
开发语言·算法·php
海石2 小时前
单调栈复健,顺便,牺牲一下吧,空间复杂度!一切献给AC
算法·leetcode
海石2 小时前
JS击败94%,Hard题想不到动态规划,那就用数组和栈试试
算法·leetcode
品尚公益团队3 小时前
C#在asp.net网页开发中的带cookie登录实现
前端·c#·asp.net
吴可可1233 小时前
C#自定义CAD多段线零件实体
c#
CallmeFoureyes3 小时前
使用 C# 提取 Word 文档中的表格数据
开发语言·c#·word
思麟呀4 小时前
在C++基础上理解CSharp-7
java·jvm·c++·c#
alphaTao4 小时前
LeetCode 每日一题 2026/7/6-2026/7/12
算法·leetcode