Average Error: 32.0 → 0.0
Time: 22.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03488869783196479196218930951545189600438 \lor \neg \left(x \le 0.03735179155868628697589883813634514808655\right):\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\frac{x - \tan x}{\sqrt[3]{\sin x}}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{2} \cdot \left(\frac{9}{40} - {x}^{2} \cdot \frac{27}{2800}\right) - \frac{1}{2}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.03488869783196479196218930951545189600438 \lor \neg \left(x \le 0.03735179155868628697589883813634514808655\right):\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\frac{x - \tan x}{\sqrt[3]{\sin x}}}\\

\mathbf{else}:\\
\;\;\;\;{x}^{2} \cdot \left(\frac{9}{40} - {x}^{2} \cdot \frac{27}{2800}\right) - \frac{1}{2}\\

\end{array}
double f(double x) {
        double r22499 = x;
        double r22500 = sin(r22499);
        double r22501 = r22499 - r22500;
        double r22502 = tan(r22499);
        double r22503 = r22499 - r22502;
        double r22504 = r22501 / r22503;
        return r22504;
}

double f(double x) {
        double r22505 = x;
        double r22506 = -0.03488869783196479;
        bool r22507 = r22505 <= r22506;
        double r22508 = 0.03735179155868629;
        bool r22509 = r22505 <= r22508;
        double r22510 = !r22509;
        bool r22511 = r22507 || r22510;
        double r22512 = tan(r22505);
        double r22513 = r22505 - r22512;
        double r22514 = r22505 / r22513;
        double r22515 = sin(r22505);
        double r22516 = cbrt(r22515);
        double r22517 = r22516 * r22516;
        double r22518 = r22513 / r22516;
        double r22519 = r22517 / r22518;
        double r22520 = r22514 - r22519;
        double r22521 = 2.0;
        double r22522 = pow(r22505, r22521);
        double r22523 = 0.225;
        double r22524 = 0.009642857142857142;
        double r22525 = r22522 * r22524;
        double r22526 = r22523 - r22525;
        double r22527 = r22522 * r22526;
        double r22528 = 0.5;
        double r22529 = r22527 - r22528;
        double r22530 = r22511 ? r22520 : r22529;
        return r22530;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -0.03488869783196479 or 0.03735179155868629 < x

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.1

      \[\leadsto \frac{x}{x - \tan x} - \frac{\color{blue}{\left(\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}\right) \cdot \sqrt[3]{\sin x}}}{x - \tan x}\]
    6. Applied associate-/l*0.1

      \[\leadsto \frac{x}{x - \tan x} - \color{blue}{\frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\frac{x - \tan x}{\sqrt[3]{\sin x}}}}\]

    if -0.03488869783196479 < x < 0.03735179155868629

    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{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
    3. Simplified0.0

      \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{9}{40} - {x}^{2} \cdot \frac{27}{2800}\right) - \frac{1}{2}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

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

Reproduce

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