[go: up one dir, main page]

Technical Reference · v2.0

Calculation Methodology

Algebraic proofs, metric definitions, float protections, precision standards, and validation protocols behind every SeeCalc calculator.

Verified Proofs

Every formula is derived from first principles and cross-checked algebraically.

7 Spec Sections

Covering float safety, precision, definitions, coverage, validation, and QA.

Industry-Standard

All metric definitions follow IAB, MMA, and SaaS industry accepted standards.

Section 01

Floating Point Guards & Division-by-Zero Protection

JavaScript/TypeScript numbers are double-precision binary floats (IEEE 754). Without guards, dividing by zero returns Infinity or NaN, causing layout crashes or silently wrong outputs.

Guard Type

Non-zero denominator check before every division operation.

Safe Return

Returns structured zero object — never throws, never renders NaN.

UI Signal

Red inline warning text is surfaced to the user when inputs are invalid.

TypeScript — CPM Guard Implementation

// Guard: impressions must be a positive number
if (!impressions || impressions <= 0) {
  return { cpm: 0, perImpression: 0 };
}

// Guard: cost must be non-negative
if (cost < 0) {
  return { cpm: 0, perImpression: 0 };
}

const cpm           = (cost / impressions) * 1000;
const perImpression = cost / impressions;
return { cpm, perImpression };

This pattern is applied uniformly across every solver function. The return shape is always typed — no undefined values propagate to the UI layer.

Section 02

Algebraic Multi-Way Reverse Solving

Traditional marketing tools are strictly one-directional. SeeCalc derives all rearrangements of each formula algebraically so every variable is solvable — not just the canonical output.

Example: CPM — All Three Directions

A. Solve for CPM

CPM = (Cost ÷ Imp) × 1000

Standard forward direction

B. Solve for Spend

Cost = (Imp × CPM) ÷ 1000

Given target CPM + impressions

C. Solve for Impressions

Imp = (Cost ÷ CPM) × 1000

Given budget + target CPM

Example: ROAS — All Three Directions

A. Solve for ROAS

ROAS = Revenue ÷ AdSpend

Standard forward direction

B. Solve for Revenue

Revenue = ROAS × AdSpend

Given target ROAS + budget

C. Solve for Spend

AdSpend = Revenue ÷ ROAS

Given revenue target + ROAS goal

All derivations are verified to be mathematically reciprocal — substituting any solved value back into the base formula returns the original inputs exactly (subject only to float precision bounds defined in Section 03).

Section 03

Numeric Precision & Rounding Standards

Raw float arithmetic produces trailing precision noise (e.g. 0.1 + 0.2 === 0.30000000000000004). Each metric category applies a fixed rounding rule at the display layer without altering intermediate computation.

Metric CategoryDecimal PlacesRounding MethodExample Output
Currency (CPM, CPA, CPC)2Half-up$12.47
Rate / Ratio (CTR, CVR, Churn)2–4Half-up3.82%
ROAS / ROI multiplier2Half-up4.15×
Integer counts (Impressions)0Floor1,240,000
LTV / Revenue projections2Half-up$284.60
Percentage margins1Half-up67.3%

Rounding is applied only at the display boundary (toFixed / Intl.NumberFormat). All intermediate calculations retain full float precision to prevent compounding rounding error across chained formulas.

Section 04

Metric Definition Registry

All metric definitions follow IAB (Interactive Advertising Bureau), MMA Global, and common SaaS industry standards. Definitions are pinned — they do not change based on platform, campaign type, or geography.

CPMCost Per Mille

Formula

(Ad Spend ÷ Impressions) × 1000

Definition

The cost an advertiser pays per 1,000 ad impressions served. Standard unit for display and programmatic buying.

IAB
CPCCost Per Click

Formula

Ad Spend ÷ Clicks

Definition

Total spend divided by the number of ad clicks received. Primary metric for search and performance campaigns.

IAB
CTRClick-Through Rate

Formula

(Clicks ÷ Impressions) × 100

Definition

The percentage of impressions that result in a user click. Expressed as a percentage.

IAB
ROASReturn on Ad Spend

Formula

Revenue ÷ Ad Spend

Definition

Revenue generated per dollar of ad spend. A multiplier: ROAS of 4 means $4 returned per $1 spent.

MMA
CPACost Per Acquisition

Formula

Ad Spend ÷ Conversions

Definition

The cost to acquire one converting customer or completed action. Also called Cost Per Conversion.

IAB
CVRConversion Rate

Formula

(Conversions ÷ Clicks) × 100

Definition

Percentage of clicks that result in a defined conversion event (purchase, signup, form fill, etc.).

IAB
LTVCustomer Lifetime Value

Formula

ARPU × Gross Margin ÷ Churn Rate

Definition

Predicted total revenue a customer generates over their full relationship with the business.

SaaS
CACCustomer Acquisition Cost

Formula

Total Sales & Marketing Spend ÷ New Customers

Definition

Total cost to acquire one new paying customer, including all sales and marketing expenses.

SaaS
MRRMonthly Recurring Revenue

Formula

Active Customers × Average Monthly Revenue

Definition

Predictable, normalized monthly revenue from all active subscriptions.

SaaS
ChurnCustomer Churn Rate

Formula

(Customers Lost ÷ Customers at Start) × 100

Definition

Percentage of customers who cancel or do not renew within a given period.

SaaS

Section 05

Input Validation Protocol

All user inputs pass through a staged validation pipeline before reaching any solver function. Validation is non-blocking — invalid inputs surface contextual error text rather than preventing further interaction.

Stage 1 · Type Check

Input is parsed through parseFloat(). Non-numeric strings (letters, symbols) return NaN and are caught immediately.

Stage 2 · Range Check

Values are tested against domain constraints: percentages must be 0–100, rates must be ≥ 0, denominators must be > 0.

Stage 3 · Coherence Check

Inter-field relationships are validated: Clicks cannot exceed Impressions; Conversions cannot exceed Clicks.

Stage 4 · Solver Gate

Only after all three checks pass does the solver execute. Partial passes return partial results with inline warnings.

Section 06

Edge Case Handling

Marketing data frequently contains values that are technically valid inputs but produce mathematically degenerate results. Each edge case below has a defined handling contract.

Edge CaseAffected MetricHandling Contract
0 impressions with non-zero spendCPM, CTRReturn 0. Display: 'Impressions must be greater than zero.'
CTR > 100%CTRFlag as incoherent. Warn: 'Clicks cannot exceed Impressions.'
100% churn rateLTV, MRR retentionLTV returns 0 (no customer survives). Warning shown.
Negative ad spendAll spend-based metricsTreat as invalid. Return 0 with type error warning.
ROAS < 1×ROAS, ProfitValid — a losing campaign. No warning. Result displayed normally.
CAC > LTVLTV:CAC ratioValid and common. Ratio displayed; no correction applied.
CVR > 100%CVRFlag as incoherent. Warn: 'Conversions cannot exceed Clicks.'
Churn rate of 0%Churn, LTVLTV approaches infinity. Cap display and note infinite retention.

Section 07

Quality Assurance & Verification Process

Every formula on SeeCalc passes a four-stage review before deployment. No calculator ships without completing all four stages.

01

Algebraic Derivation Review

Each formula and all its reverse derivations are written out in symbolic notation and verified by hand before any code is written. Derivations are checked for mathematical equivalence and completeness.

02

Reference Cross-Check

The formula definition is compared against at least two independent authoritative sources (IAB standards, MMA Global guidelines, academic marketing textbooks, or platform documentation from Google Ads / Meta).

03

Known-Value Smoke Tests

Each solver function is run against a set of manually calculated known-value pairs (e.g. cost=$500, impressions=100,000 → CPM=$5.00). Any discrepancy fails the calculator.

04

Edge Case Regression Suite

All edge cases defined in Section 06 are run against every relevant calculator. New edge cases discovered during production are immediately added to the suite and used to regression-test all affected calculators.

Methodology Integrity Commitment

If you identify an error in any formula, definition, or edge case contract on this page, contact us at info@seecalc.com. Formula errors are treated as critical bugs — reviewed and corrected within one business day.