Average Error: 58.7 → 0.3
Time: 55.7s
Precision: binary64
Cost: 33920
\[-0.00017 < x\]
\[e^{x} - 1\]
\[\left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \log \left(e^{x \cdot 0.00043402777777777775}\right)\right)}{0.125 - x \cdot 0.020833333333333332}\right)\right)\]
e^{x} - 1
\left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \log \left(e^{x \cdot 0.00043402777777777775}\right)\right)}{0.125 - x \cdot 0.020833333333333332}\right)\right)
(FPCore (x) :precision binary64 (- (exp x) 1.0))
(FPCore (x)
 :precision binary64
 (*
  (+ 1.0 (sqrt (exp x)))
  (+
   (* x 0.5)
   (+
    (* 0.0026041666666666665 (pow x 4.0))
    (/
     (* (* x x) (- 0.015625 (* x (log (exp (* x 0.00043402777777777775))))))
     (- 0.125 (* x 0.020833333333333332)))))))
double code(double x) {
	return exp(x) - 1.0;
}
double code(double x) {
	return (1.0 + sqrt(exp(x))) * ((x * 0.5) + ((0.0026041666666666665 * pow(x, 4.0)) + (((x * x) * (0.015625 - (x * log(exp(x * 0.00043402777777777775))))) / (0.125 - (x * 0.020833333333333332)))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original58.7
Target0.4
Herbie0.3
\[x \cdot \left(\left(1 + \frac{x}{2}\right) + \frac{x \cdot x}{6}\right)\]

Alternatives

Alternative 1
Error0.3
Cost21120
\[\left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \left(x \cdot 0.00043402777777777775\right)\right)}{0.125 - x \cdot 0.020833333333333332}\right)\right)\]
Alternative 2
Error0.3
Cost20608
\[\left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \left(x \cdot x\right) \cdot \left(0.125 + x \cdot 0.020833333333333332\right)\right)\right)\]
Alternative 3
Error0.3
Cost20480
\[\left(1 + \sqrt{e^{x}}\right) \cdot \left(0.0026041666666666665 \cdot {x}^{4} + x \cdot \left(0.5 + x \cdot \left(0.125 + x \cdot 0.020833333333333332\right)\right)\right)\]
Alternative 4
Error0.3
Cost9216
\[x + x \cdot \frac{x \cdot \left(0.125 + {\left(x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right)}^{3}\right)}{0.25 + \left(\left(x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right) \cdot \left(x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right) - 0.5 \cdot \left(x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right)\right)}\]
Alternative 5
Error0.3
Cost960
\[x + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(0.16666666666666666 + x \cdot 0.041666666666666664\right)\right)\]
Alternative 6
Error0.4
Cost704
\[x + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\]
Alternative 7
Error0.6
Cost448
\[x + 0.5 \cdot \left(x \cdot x\right)\]
Alternative 8
Error1.3
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 58.7

    \[e^{x} - 1\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary64_112358.7

    \[\leadsto \color{blue}{\sqrt{e^{x}} \cdot \sqrt{e^{x}}} - 1\]
  4. Applied difference-of-sqr-1_binary64_107158.7

    \[\leadsto \color{blue}{\left(\sqrt{e^{x}} + 1\right) \cdot \left(\sqrt{e^{x}} - 1\right)}\]
  5. Simplified58.7

    \[\leadsto \color{blue}{\left(1 + \sqrt{e^{x}}\right)} \cdot \left(\sqrt{e^{x}} - 1\right)\]
  6. Simplified58.7

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \color{blue}{\left(-1 + \sqrt{e^{x}}\right)}\]
  7. Taylor expanded around 0 0.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \color{blue}{\left(0.5 \cdot x + \left(0.125 \cdot {x}^{2} + \left(0.020833333333333332 \cdot {x}^{3} + 0.0026041666666666665 \cdot {x}^{4}\right)\right)\right)}\]
  8. Simplified0.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \color{blue}{\left(x \cdot 0.5 + \left(\left(x \cdot x\right) \cdot \left(0.125 + x \cdot 0.020833333333333332\right) + 0.0026041666666666665 \cdot {x}^{4}\right)\right)}\]
  9. Using strategy rm
  10. Applied flip-+_binary64_10750.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(\left(x \cdot x\right) \cdot \color{blue}{\frac{0.125 \cdot 0.125 - \left(x \cdot 0.020833333333333332\right) \cdot \left(x \cdot 0.020833333333333332\right)}{0.125 - x \cdot 0.020833333333333332}} + 0.0026041666666666665 \cdot {x}^{4}\right)\right)\]
  11. Applied associate-*r/_binary64_10430.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(\color{blue}{\frac{\left(x \cdot x\right) \cdot \left(0.125 \cdot 0.125 - \left(x \cdot 0.020833333333333332\right) \cdot \left(x \cdot 0.020833333333333332\right)\right)}{0.125 - x \cdot 0.020833333333333332}} + 0.0026041666666666665 \cdot {x}^{4}\right)\right)\]
  12. Simplified0.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(\frac{\color{blue}{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \left(0.00043402777777777775 \cdot x\right)\right)}}{0.125 - x \cdot 0.020833333333333332} + 0.0026041666666666665 \cdot {x}^{4}\right)\right)\]
  13. Using strategy rm
  14. Applied add-log-exp_binary64_11400.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(\frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \color{blue}{\log \left(e^{0.00043402777777777775 \cdot x}\right)}\right)}{0.125 - x \cdot 0.020833333333333332} + 0.0026041666666666665 \cdot {x}^{4}\right)\right)\]
  15. Simplified0.3

    \[\leadsto \color{blue}{\left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \log \left(e^{x \cdot 0.00043402777777777775}\right)\right)}{0.125 - x \cdot 0.020833333333333332}\right)\right)}\]
  16. Final simplification0.3

    \[\leadsto \left(1 + \sqrt{e^{x}}\right) \cdot \left(x \cdot 0.5 + \left(0.0026041666666666665 \cdot {x}^{4} + \frac{\left(x \cdot x\right) \cdot \left(0.015625 - x \cdot \log \left(e^{x \cdot 0.00043402777777777775}\right)\right)}{0.125 - x \cdot 0.020833333333333332}\right)\right)\]

Reproduce

herbie shell --seed 2021040 
(FPCore (x)
  :name "expm1 (example 3.7)"
  :precision binary64
  :pre (< -0.00017 x)

  :herbie-target
  (* x (+ (+ 1.0 (/ x 2.0)) (/ (* x x) 6.0)))

  (- (exp x) 1.0))