Average Error: 30.9 → 0.3
Time: 38.5s
Precision: 64
Internal Precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.0845564942913211 \cdot 10^{-10}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{if}\;x \le 41773.77440307341:\\ \;\;\;\;\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 < -1.0845564942913211e-10 or 41773.77440307341 < x

    1. Initial program 0.6

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

    if -1.0845564942913211e-10 < x < 41773.77440307341

    1. Initial program 63.2

      \[\frac{x - \sin x}{x - \tan x}\]
    2. 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: 38.5s)Debug log

herbie shell --seed '#(151349756 408087815 228312487 2538703040 1980610373 1250971417)' 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))