Average Error: 2.4 → 0.1
Time: 15.3s
Precision: 64
Internal Precision: 576
\[\frac{inflow}{lam} + \left(1.0 - \frac{outflow}{lam}\right) \cdot p\]
\[\begin{array}{l} \mathbf{if}\;p \le -9.435390504479849 \cdot 10^{-35} \lor \neg \left(p \le 59947.37659807981\right):\\ \;\;\;\;\left(p \cdot 1.0 + \frac{inflow}{lam}\right) - \frac{1}{\frac{\frac{lam}{outflow}}{p}}\\ \mathbf{else}:\\ \;\;\;\;\left(p \cdot 1.0 + \frac{inflow}{lam}\right) - \frac{outflow \cdot p}{lam}\\ \end{array}\]

Error

Bits error versus inflow

Bits error versus lam

Bits error versus outflow

Bits error versus p

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if p < -9.435390504479849e-35 or 59947.37659807981 < p

    1. Initial program 0.1

      \[\frac{inflow}{lam} + \left(1.0 - \frac{outflow}{lam}\right) \cdot p\]
    2. Initial simplification0.1

      \[\leadsto \left(\frac{inflow}{lam} + p \cdot 1.0\right) - \frac{p}{\frac{lam}{outflow}}\]
    3. Using strategy rm
    4. Applied clear-num0.1

      \[\leadsto \left(\frac{inflow}{lam} + p \cdot 1.0\right) - \color{blue}{\frac{1}{\frac{\frac{lam}{outflow}}{p}}}\]

    if -9.435390504479849e-35 < p < 59947.37659807981

    1. Initial program 4.3

      \[\frac{inflow}{lam} + \left(1.0 - \frac{outflow}{lam}\right) \cdot p\]
    2. Taylor expanded around -inf 0.1

      \[\leadsto \color{blue}{\left(\frac{inflow}{lam} + 1.0 \cdot p\right) - \frac{outflow \cdot p}{lam}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;p \le -9.435390504479849 \cdot 10^{-35} \lor \neg \left(p \le 59947.37659807981\right):\\ \;\;\;\;\left(p \cdot 1.0 + \frac{inflow}{lam}\right) - \frac{1}{\frac{\frac{lam}{outflow}}{p}}\\ \mathbf{else}:\\ \;\;\;\;\left(p \cdot 1.0 + \frac{inflow}{lam}\right) - \frac{outflow \cdot p}{lam}\\ \end{array}\]

Runtime

Time bar (total: 15.3s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (inflow lam outflow p)
  :name "inflow / lam + (1.0 - outflow / lam) * p"
  (+ (/ inflow lam) (* (- 1.0 (/ outflow lam)) p)))