e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -5.305313852292152365229972038607186846093 \cdot 10^{-6}:\\
\;\;\;\;\sqrt[3]{\frac{{\left(\mathsf{fma}\left(1, e^{a \cdot x} + 1, e^{2 \cdot \left(a \cdot x\right)}\right) \cdot \left(e^{a \cdot x} - 1\right)\right)}^{3}}{\sqrt{{\left(\mathsf{fma}\left(1, e^{a \cdot x} + 1, e^{a \cdot x + a \cdot x}\right)\right)}^{3}} \cdot \sqrt{{\left(\mathsf{fma}\left(1, e^{a \cdot x} + 1, e^{a \cdot x + a \cdot x}\right)\right)}^{3}}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, {a}^{2} \cdot {x}^{2}, \mathsf{fma}\left(0.1666666666666665186369300499791279435158, {a}^{3} \cdot {x}^{3}, 1 \cdot \left(a \cdot x\right)\right)\right)\\
\end{array}double f(double a, double x) {
double r89681 = a;
double r89682 = x;
double r89683 = r89681 * r89682;
double r89684 = exp(r89683);
double r89685 = 1.0;
double r89686 = r89684 - r89685;
return r89686;
}
double f(double a, double x) {
double r89687 = a;
double r89688 = x;
double r89689 = r89687 * r89688;
double r89690 = -5.305313852292152e-06;
bool r89691 = r89689 <= r89690;
double r89692 = 1.0;
double r89693 = exp(r89689);
double r89694 = r89693 + r89692;
double r89695 = 2.0;
double r89696 = r89695 * r89689;
double r89697 = exp(r89696);
double r89698 = fma(r89692, r89694, r89697);
double r89699 = r89693 - r89692;
double r89700 = r89698 * r89699;
double r89701 = 3.0;
double r89702 = pow(r89700, r89701);
double r89703 = r89689 + r89689;
double r89704 = exp(r89703);
double r89705 = fma(r89692, r89694, r89704);
double r89706 = pow(r89705, r89701);
double r89707 = sqrt(r89706);
double r89708 = r89707 * r89707;
double r89709 = r89702 / r89708;
double r89710 = cbrt(r89709);
double r89711 = 0.5;
double r89712 = pow(r89687, r89695);
double r89713 = pow(r89688, r89695);
double r89714 = r89712 * r89713;
double r89715 = 0.16666666666666652;
double r89716 = pow(r89687, r89701);
double r89717 = pow(r89688, r89701);
double r89718 = r89716 * r89717;
double r89719 = r89692 * r89689;
double r89720 = fma(r89715, r89718, r89719);
double r89721 = fma(r89711, r89714, r89720);
double r89722 = r89691 ? r89710 : r89721;
return r89722;
}




Bits error versus a




Bits error versus x
| Original | 28.7 |
|---|---|
| Target | 0.2 |
| Herbie | 9.7 |
if (* a x) < -5.305313852292152e-06Initial program 0.1
rmApplied add-cbrt-cube0.1
Simplified0.1
rmApplied flip3--0.1
Applied cube-div0.1
Simplified0.1
rmApplied add-sqr-sqrt0.1
rmApplied difference-cubes0.1
Simplified0.1
if -5.305313852292152e-06 < (* a x) Initial program 44.2
rmApplied add-cbrt-cube44.2
Simplified44.2
rmApplied flip3--44.2
Applied cube-div44.3
Simplified44.3
rmApplied add-sqr-sqrt44.3
Taylor expanded around 0 14.9
Simplified14.9
Final simplification9.7
herbie shell --seed 2019344 +o rules:numerics
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6)))) (- (exp (* a x)) 1))
(- (exp (* a x)) 1))