Average Error: 31.5 → 0.3
Time: 53.9s
Precision: 64
Internal Precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right) \le -0.5906833924321659:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\ \mathbf{if}\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right) \le -0.5:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if (- (* 9/40 (pow x 2)) (+ 1/2 (* 27/2800 (pow x 4)))) < -0.5906833924321659

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-log-exp0.0

      \[\leadsto \color{blue}{\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)}\]

    if -0.5906833924321659 < (- (* 9/40 (pow x 2)) (+ 1/2 (* 27/2800 (pow x 4)))) < -0.5

    1. Initial program 63.6

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around 0 0

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

    if -0.5 < (- (* 9/40 (pow x 2)) (+ 1/2 (* 27/2800 (pow x 4))))

    1. Initial program 1.2

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub1.0

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 53.9s)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))