Average Error: 31.6 → 0.9
Time: 1.4m
Precision: 64
Internal Precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.979550813088296 \cdot 10^{-22}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{if}\;x \le 0.802860764679358:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\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 < -3.979550813088296e-22 or 0.802860764679358 < x

    1. Initial program 1.7

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

    if -3.979550813088296e-22 < x < 0.802860764679358

    1. Initial program 63.1

      \[\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{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 1.4m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))