Average Error: 33.0 → 0.1
Time: 18.7s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.703456140208716 \cdot 10^{-07}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{if}\;x \le 7.800068334552656 \cdot 10^{+23}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes.
  2. if x < -4.703456140208716e-07 or 7.800068334552656e+23 < x

    1. Initial program 0.2

      \[\frac{x - \sin x}{x - \tan x}\]

    if -4.703456140208716e-07 < x < 7.800068334552656e+23

    1. Initial program 63.2

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Applied taylor 0.0

      \[\leadsto \frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\]
    3. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 18.7s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1065033997 2389885643 4100569014 2620012693 26800780 3144211646)'
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))