Average Error: 31.2 → 0.0
Time: 18.8s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le \frac{-7640098872172261}{288230376151711744} \lor \neg \left(x \le \frac{2330914048531883}{72057594037927936}\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\left(\sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}}\right) \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} + \frac{1}{2}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le \frac{-7640098872172261}{288230376151711744} \lor \neg \left(x \le \frac{2330914048531883}{72057594037927936}\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{else}:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\left(\sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}}\right) \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} + \frac{1}{2}\right)\\

\end{array}
double f(double x) {
        double r23542 = x;
        double r23543 = sin(r23542);
        double r23544 = r23542 - r23543;
        double r23545 = tan(r23542);
        double r23546 = r23542 - r23545;
        double r23547 = r23544 / r23546;
        return r23547;
}

double f(double x) {
        double r23548 = x;
        double r23549 = -7640098872172261.0;
        double r23550 = 2.8823037615171174e+17;
        double r23551 = r23549 / r23550;
        bool r23552 = r23548 <= r23551;
        double r23553 = 2330914048531883.0;
        double r23554 = 7.205759403792794e+16;
        double r23555 = r23553 / r23554;
        bool r23556 = r23548 <= r23555;
        double r23557 = !r23556;
        bool r23558 = r23552 || r23557;
        double r23559 = sin(r23548);
        double r23560 = r23548 - r23559;
        double r23561 = tan(r23548);
        double r23562 = r23548 - r23561;
        double r23563 = r23560 / r23562;
        double r23564 = 0.225;
        double r23565 = 2.0;
        double r23566 = pow(r23548, r23565);
        double r23567 = r23564 * r23566;
        double r23568 = 0.009642857142857142;
        double r23569 = 4.0;
        double r23570 = pow(r23548, r23569);
        double r23571 = r23568 * r23570;
        double r23572 = cbrt(r23571);
        double r23573 = r23572 * r23572;
        double r23574 = r23573 * r23572;
        double r23575 = 0.5;
        double r23576 = r23574 + r23575;
        double r23577 = r23567 - r23576;
        double r23578 = r23558 ? r23563 : r23577;
        return r23578;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -0.026506917744682296

    1. Initial program 0.1

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

    if -0.026506917744682296 < x < 0.0323479305637792

    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. Using strategy rm
    4. Applied add-cube-cbrt0.0

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

    if 0.0323479305637792 < x

    1. Initial program 0.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le \frac{-7640098872172261}{288230376151711744} \lor \neg \left(x \le \frac{2330914048531883}{72057594037927936}\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\left(\sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}}\right) \cdot \sqrt[3]{\frac{27}{2800} \cdot {x}^{4}} + \frac{1}{2}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 197574269 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))