Average Error: 30.0 → 30.1
Time: 5.6s
Precision: binary64
\[e^{a \cdot x} - 1\]
\[\log \left(e^{e^{a \cdot x} - 1}\right)\]
e^{a \cdot x} - 1
\log \left(e^{e^{a \cdot x} - 1}\right)
(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x) :precision binary64 (log (exp (- (exp (* a x)) 1.0))))
double code(double a, double x) {
	return exp(a * x) - 1.0;
}
double code(double a, double x) {
	return log(exp(exp(a * x) - 1.0));
}

Error

Bits error versus a

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original30.0
Target0.2
Herbie30.1
\[\begin{array}{l} \mathbf{if}\;\left|a \cdot x\right| < 0.1:\\ \;\;\;\;\left(a \cdot x\right) \cdot \left(1 + \left(\frac{a \cdot x}{2} + \frac{{\left(a \cdot x\right)}^{2}}{6}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{a \cdot x} - 1\\ \end{array}\]

Derivation

  1. Initial program 30.0

    \[e^{a \cdot x} - 1\]
  2. Using strategy rm
  3. Applied add-log-exp_binary6430.0

    \[\leadsto e^{a \cdot x} - \color{blue}{\log \left(e^{1}\right)}\]
  4. Applied add-log-exp_binary6430.1

    \[\leadsto \color{blue}{\log \left(e^{e^{a \cdot x}}\right)} - \log \left(e^{1}\right)\]
  5. Applied diff-log_binary6430.1

    \[\leadsto \color{blue}{\log \left(\frac{e^{e^{a \cdot x}}}{e^{1}}\right)}\]
  6. Simplified30.1

    \[\leadsto \log \color{blue}{\left(e^{e^{a \cdot x} - 1}\right)}\]
  7. Final simplification30.1

    \[\leadsto \log \left(e^{e^{a \cdot x} - 1}\right)\]

Reproduce

herbie shell --seed 2020270 
(FPCore (a x)
  :name "expax (section 3.5)"
  :precision binary64
  :herbie-expected 14

  :herbie-target
  (if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1.0 (+ (/ (* a x) 2.0) (/ (pow (* a x) 2.0) 6.0)))) (- (exp (* a x)) 1.0))

  (- (exp (* a x)) 1.0))