Average Error: 31.6 → 0.0
Time: 2.3m
Precision: 64
Ground Truth: 128
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0006447367512968273:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\ \mathbf{if}\;x \le 63.10180000091707:\\ \;\;\;\;\frac{{\left(\frac{9}{40} \cdot {x}^2\right)}^3 - {\left({x}^{4} \cdot \frac{27}{2800} + \frac{1}{2}\right)}^3}{{\left(\frac{9}{40} \cdot {x}^2\right)}^2 + \left({\left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}^2 + \left(\frac{9}{40} \cdot {x}^2\right) \cdot \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes.
  2. if x < -0.0006447367512968273 or 63.10180000091707 < x

    1. Initial program 0.1

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

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

    if -0.0006447367512968273 < x < 63.10180000091707

    1. Initial program 62.8

      \[\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)}\]
    4. Using strategy rm
    5. Applied flip3-- 0.0

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

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

Runtime

Total time: 2.3m Debug log

Please include this information when filing a bug report:

herbie --seed '#(1678779530 1558603309 2181871656 3813673467 3845458450 1505327104)'
(FPCore (x)
  :name "NMSE problem 3.4.5"
  (/ (- x (sin x)) (- x (tan x))))