Average Error: 37.1 → 0.4
Time: 35.5s
Precision: 64
Internal Precision: 2368
\[\sin \left(x + e\right) - \sin x\]
\[\begin{array}{l} \mathbf{if}\;e \le -8.235254616753446 \cdot 10^{-09}:\\ \;\;\;\;\left(\sin x \cdot \cos e + \cos x \cdot \sin e\right) - \sin x\\ \mathbf{if}\;e \le 3.219014701150901 \cdot 10^{-11}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{x + \left(e + x\right)}{2}\right) \cdot \sin \left(\frac{e}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin x \cdot \cos e + \left(\cos x \cdot \sin e - \sin x\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus e

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if e < -8.235254616753446e-09

    1. Initial program 29.6

      \[\sin \left(x + e\right) - \sin x\]
    2. Using strategy rm
    3. Applied sin-sum0.6

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos e + \cos x \cdot \sin e\right)} - \sin x\]

    if -8.235254616753446e-09 < e < 3.219014701150901e-11

    1. Initial program 44.8

      \[\sin \left(x + e\right) - \sin x\]
    2. Using strategy rm
    3. Applied diff-sin44.8

      \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\frac{\left(x + e\right) - x}{2}\right) \cdot \cos \left(\frac{\left(x + e\right) + x}{2}\right)\right)}\]
    4. Applied simplify0.3

      \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(\frac{x + \left(e + x\right)}{2}\right) \cdot \sin \left(\frac{e}{2}\right)\right)}\]

    if 3.219014701150901e-11 < e

    1. Initial program 29.7

      \[\sin \left(x + e\right) - \sin x\]
    2. Using strategy rm
    3. Applied sin-sum0.6

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos e + \cos x \cdot \sin e\right)} - \sin x\]
    4. Applied associate--l+0.6

      \[\leadsto \color{blue}{\sin x \cdot \cos e + \left(\cos x \cdot \sin e - \sin x\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 35.5s)Debug log

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