Average Error: 29.5 → 1.6
Time: 13.5s
Precision: 64
Internal Precision: 1344
\[e^{\sin x} - 1\]
\[\begin{array}{l} \mathbf{if}\;\sin x \le -0.12014515666984021:\\ \;\;\;\;\frac{1 + e^{\sin x}}{\frac{1 + e^{\sin x}}{e^{\sin x} - 1}}\\ \mathbf{elif}\;\sin x \le 1.198484680558077 \cdot 10^{-06}:\\ \;\;\;\;\left(x + \frac{1}{2} \cdot {x}^{2}\right) - \frac{1}{8} \cdot {x}^{4}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\sin x + \sin x} - 1}{1 + e^{\sin x}}\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (sin x) < -0.12014515666984021

    1. Initial program 0.4

      \[e^{\sin x} - 1\]
    2. Initial simplification0.4

      \[\leadsto e^{\sin x} - 1\]
    3. Using strategy rm
    4. Applied flip--0.5

      \[\leadsto \color{blue}{\frac{e^{\sin x} \cdot e^{\sin x} - 1 \cdot 1}{e^{\sin x} + 1}}\]
    5. Using strategy rm
    6. Applied difference-of-squares0.4

      \[\leadsto \frac{\color{blue}{\left(e^{\sin x} + 1\right) \cdot \left(e^{\sin x} - 1\right)}}{e^{\sin x} + 1}\]
    7. Applied associate-/l*0.4

      \[\leadsto \color{blue}{\frac{e^{\sin x} + 1}{\frac{e^{\sin x} + 1}{e^{\sin x} - 1}}}\]

    if -0.12014515666984021 < (sin x) < 1.198484680558077e-06

    1. Initial program 56.8

      \[e^{\sin x} - 1\]
    2. Initial simplification56.8

      \[\leadsto e^{\sin x} - 1\]
    3. Using strategy rm
    4. Applied flip--56.8

      \[\leadsto \color{blue}{\frac{e^{\sin x} \cdot e^{\sin x} - 1 \cdot 1}{e^{\sin x} + 1}}\]
    5. Taylor expanded around 0 2.5

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {x}^{2} + x\right) - \frac{1}{8} \cdot {x}^{4}}\]

    if 1.198484680558077e-06 < (sin x)

    1. Initial program 1.0

      \[e^{\sin x} - 1\]
    2. Initial simplification1.0

      \[\leadsto e^{\sin x} - 1\]
    3. Using strategy rm
    4. Applied flip--1.1

      \[\leadsto \color{blue}{\frac{e^{\sin x} \cdot e^{\sin x} - 1 \cdot 1}{e^{\sin x} + 1}}\]
    5. Using strategy rm
    6. Applied prod-exp0.8

      \[\leadsto \frac{\color{blue}{e^{\sin x + \sin x}} - 1 \cdot 1}{e^{\sin x} + 1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sin x \le -0.12014515666984021:\\ \;\;\;\;\frac{1 + e^{\sin x}}{\frac{1 + e^{\sin x}}{e^{\sin x} - 1}}\\ \mathbf{elif}\;\sin x \le 1.198484680558077 \cdot 10^{-06}:\\ \;\;\;\;\left(x + \frac{1}{2} \cdot {x}^{2}\right) - \frac{1}{8} \cdot {x}^{4}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\sin x + \sin x} - 1}{1 + e^{\sin x}}\\ \end{array}\]

Runtime

Time bar (total: 13.5s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "exp(sin(x))-1"
  (- (exp (sin x)) 1))