Average Error: 31.5 → 0.1
Time: 9.8s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0289521418860340281 \lor \neg \left(x \le 0.0280055017289512036\right):\\ \;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{9}{40} \cdot {x}^{2} - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.0289521418860340281 \lor \neg \left(x \le 0.0280055017289512036\right):\\
\;\;\;\;\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x - \sin x}{x - \tan x}}\\

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

\end{array}
double f(double x) {
        double r10552 = x;
        double r10553 = sin(r10552);
        double r10554 = r10552 - r10553;
        double r10555 = tan(r10552);
        double r10556 = r10552 - r10555;
        double r10557 = r10554 / r10556;
        return r10557;
}

double f(double x) {
        double r10558 = x;
        double r10559 = -0.028952141886034028;
        bool r10560 = r10558 <= r10559;
        double r10561 = 0.028005501728951204;
        bool r10562 = r10558 <= r10561;
        double r10563 = !r10562;
        bool r10564 = r10560 || r10563;
        double r10565 = sin(r10558);
        double r10566 = r10558 - r10565;
        double r10567 = tan(r10558);
        double r10568 = r10558 - r10567;
        double r10569 = r10566 / r10568;
        double r10570 = cbrt(r10569);
        double r10571 = r10570 * r10570;
        double r10572 = r10571 * r10570;
        double r10573 = 0.225;
        double r10574 = 2.0;
        double r10575 = pow(r10558, r10574);
        double r10576 = r10573 * r10575;
        double r10577 = 0.009642857142857142;
        double r10578 = 4.0;
        double r10579 = pow(r10558, r10578);
        double r10580 = r10577 * r10579;
        double r10581 = r10576 - r10580;
        double r10582 = 0.5;
        double r10583 = r10581 - r10582;
        double r10584 = r10564 ? r10572 : r10583;
        return r10584;
}

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.028952141886034028 or 0.028005501728951204 < x

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.1

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

    if -0.028952141886034028 < x < 0.028005501728951204

    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 associate--r+0.0

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

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

Reproduce

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