Average Error: 29.7 → 18.0
Time: 16.6s
Precision: 64
\[e^{\left(-\gamma\right) \cdot x} - 1\]
\[\begin{array}{l} \mathbf{if}\;x \le -62237230777949027182875479601089347584 \lor \neg \left(x \le 1.383322459921772769318712611937456277577 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{\frac{{\left(e^{\left(x \cdot \gamma\right) \cdot -3}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{{1}^{3} \cdot \left(e^{\left(x \cdot \gamma\right) \cdot -3} + {1}^{3}\right) + {\left(e^{x \cdot \gamma}\right)}^{-6}}}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{\gamma}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2} - \left(\frac{1}{6} \cdot {x}^{3}\right) \cdot \gamma\right) - x \cdot \gamma\\ \end{array}\]
e^{\left(-\gamma\right) \cdot x} - 1
\begin{array}{l}
\mathbf{if}\;x \le -62237230777949027182875479601089347584 \lor \neg \left(x \le 1.383322459921772769318712611937456277577 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{\frac{{\left(e^{\left(x \cdot \gamma\right) \cdot -3}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{{1}^{3} \cdot \left(e^{\left(x \cdot \gamma\right) \cdot -3} + {1}^{3}\right) + {\left(e^{x \cdot \gamma}\right)}^{-6}}}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;{\gamma}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2} - \left(\frac{1}{6} \cdot {x}^{3}\right) \cdot \gamma\right) - x \cdot \gamma\\

\end{array}
double f(double gamma, double x) {
        double r545229 = gamma;
        double r545230 = -r545229;
        double r545231 = x;
        double r545232 = r545230 * r545231;
        double r545233 = exp(r545232);
        double r545234 = 1.0;
        double r545235 = r545233 - r545234;
        return r545235;
}

double f(double gamma, double x) {
        double r545236 = x;
        double r545237 = -6.223723077794903e+37;
        bool r545238 = r545236 <= r545237;
        double r545239 = 1.3833224599217728e-42;
        bool r545240 = r545236 <= r545239;
        double r545241 = !r545240;
        bool r545242 = r545238 || r545241;
        double r545243 = gamma;
        double r545244 = r545236 * r545243;
        double r545245 = -3.0;
        double r545246 = r545244 * r545245;
        double r545247 = exp(r545246);
        double r545248 = 3.0;
        double r545249 = pow(r545247, r545248);
        double r545250 = 1.0;
        double r545251 = pow(r545250, r545248);
        double r545252 = pow(r545251, r545248);
        double r545253 = r545249 - r545252;
        double r545254 = r545247 + r545251;
        double r545255 = r545251 * r545254;
        double r545256 = exp(r545244);
        double r545257 = -6.0;
        double r545258 = pow(r545256, r545257);
        double r545259 = r545255 + r545258;
        double r545260 = r545253 / r545259;
        double r545261 = -2.0;
        double r545262 = r545244 * r545261;
        double r545263 = exp(r545262);
        double r545264 = -r545243;
        double r545265 = r545264 * r545236;
        double r545266 = exp(r545265);
        double r545267 = r545266 + r545250;
        double r545268 = r545250 * r545267;
        double r545269 = r545263 + r545268;
        double r545270 = r545260 / r545269;
        double r545271 = 2.0;
        double r545272 = pow(r545243, r545271);
        double r545273 = 0.5;
        double r545274 = pow(r545236, r545271);
        double r545275 = r545273 * r545274;
        double r545276 = 0.16666666666666666;
        double r545277 = pow(r545236, r545248);
        double r545278 = r545276 * r545277;
        double r545279 = r545278 * r545243;
        double r545280 = r545275 - r545279;
        double r545281 = r545272 * r545280;
        double r545282 = r545281 - r545244;
        double r545283 = r545242 ? r545270 : r545282;
        return r545283;
}

Error

Bits error versus gamma

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -6.223723077794903e+37 or 1.3833224599217728e-42 < x

    1. Initial program 23.1

      \[e^{\left(-\gamma\right) \cdot x} - 1\]
    2. Using strategy rm
    3. Applied flip3--23.1

      \[\leadsto \color{blue}{\frac{{\left(e^{\left(-\gamma\right) \cdot x}\right)}^{3} - {1}^{3}}{e^{\left(-\gamma\right) \cdot x} \cdot e^{\left(-\gamma\right) \cdot x} + \left(1 \cdot 1 + e^{\left(-\gamma\right) \cdot x} \cdot 1\right)}}\]
    4. Simplified23.0

      \[\leadsto \frac{\color{blue}{e^{\left(x \cdot \gamma\right) \cdot -3} - {1}^{3}}}{e^{\left(-\gamma\right) \cdot x} \cdot e^{\left(-\gamma\right) \cdot x} + \left(1 \cdot 1 + e^{\left(-\gamma\right) \cdot x} \cdot 1\right)}\]
    5. Simplified23.0

      \[\leadsto \frac{e^{\left(x \cdot \gamma\right) \cdot -3} - {1}^{3}}{\color{blue}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}}\]
    6. Using strategy rm
    7. Applied flip3--23.1

      \[\leadsto \frac{\color{blue}{\frac{{\left(e^{\left(x \cdot \gamma\right) \cdot -3}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{e^{\left(x \cdot \gamma\right) \cdot -3} \cdot e^{\left(x \cdot \gamma\right) \cdot -3} + \left({1}^{3} \cdot {1}^{3} + e^{\left(x \cdot \gamma\right) \cdot -3} \cdot {1}^{3}\right)}}}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}\]
    8. Simplified23.1

      \[\leadsto \frac{\frac{{\left(e^{\left(x \cdot \gamma\right) \cdot -3}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{\color{blue}{{1}^{3} \cdot \left(e^{\left(x \cdot \gamma\right) \cdot -3} + {1}^{3}\right) + {\left(e^{x \cdot \gamma}\right)}^{-6}}}}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}\]

    if -6.223723077794903e+37 < x < 1.3833224599217728e-42

    1. Initial program 34.5

      \[e^{\left(-\gamma\right) \cdot x} - 1\]
    2. Taylor expanded around 0 18.0

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({x}^{2} \cdot {\gamma}^{2}\right) - \left(x \cdot \gamma + \frac{1}{6} \cdot \left({x}^{3} \cdot {\gamma}^{3}\right)\right)}\]
    3. Simplified14.4

      \[\leadsto \color{blue}{{\gamma}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2} - \left(\frac{1}{6} \cdot {x}^{3}\right) \cdot \gamma\right) - x \cdot \gamma}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification18.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -62237230777949027182875479601089347584 \lor \neg \left(x \le 1.383322459921772769318712611937456277577 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{\frac{{\left(e^{\left(x \cdot \gamma\right) \cdot -3}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{{1}^{3} \cdot \left(e^{\left(x \cdot \gamma\right) \cdot -3} + {1}^{3}\right) + {\left(e^{x \cdot \gamma}\right)}^{-6}}}{e^{\left(x \cdot \gamma\right) \cdot -2} + 1 \cdot \left(e^{\left(-\gamma\right) \cdot x} + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{\gamma}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2} - \left(\frac{1}{6} \cdot {x}^{3}\right) \cdot \gamma\right) - x \cdot \gamma\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (gamma x)
  :name "exp(-gamma*x) - 1"
  :precision binary64
  (- (exp (* (- gamma) x)) 1))