Average Error: 31.3 → 0.1
Time: 10.7s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.5623918316578669:\\ \;\;\;\;\sqrt[3]{{\left({\left(\frac{x - \sin x}{x - \tan x}\right)}^{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)}\right)}^{\left(\sqrt[3]{3}\right)}}\\ \mathbf{elif}\;x \le 0.024314219703607573:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -1.5623918316578669:\\
\;\;\;\;\sqrt[3]{{\left({\left(\frac{x - \sin x}{x - \tan x}\right)}^{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)}\right)}^{\left(\sqrt[3]{3}\right)}}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\

\end{array}
double f(double x) {
        double r20303 = x;
        double r20304 = sin(r20303);
        double r20305 = r20303 - r20304;
        double r20306 = tan(r20303);
        double r20307 = r20303 - r20306;
        double r20308 = r20305 / r20307;
        return r20308;
}

double f(double x) {
        double r20309 = x;
        double r20310 = -1.5623918316578669;
        bool r20311 = r20309 <= r20310;
        double r20312 = sin(r20309);
        double r20313 = r20309 - r20312;
        double r20314 = tan(r20309);
        double r20315 = r20309 - r20314;
        double r20316 = r20313 / r20315;
        double r20317 = 3.0;
        double r20318 = cbrt(r20317);
        double r20319 = r20318 * r20318;
        double r20320 = pow(r20316, r20319);
        double r20321 = pow(r20320, r20318);
        double r20322 = cbrt(r20321);
        double r20323 = 0.024314219703607573;
        bool r20324 = r20309 <= r20323;
        double r20325 = 0.225;
        double r20326 = 2.0;
        double r20327 = pow(r20309, r20326);
        double r20328 = r20325 * r20327;
        double r20329 = 0.009642857142857142;
        double r20330 = 4.0;
        double r20331 = pow(r20309, r20330);
        double r20332 = r20329 * r20331;
        double r20333 = 0.5;
        double r20334 = r20332 + r20333;
        double r20335 = r20328 - r20334;
        double r20336 = pow(r20316, r20317);
        double r20337 = cbrt(r20336);
        double r20338 = r20324 ? r20335 : r20337;
        double r20339 = r20311 ? r20322 : r20338;
        return r20339;
}

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 < -1.5623918316578669

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube41.9

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}}\]
    4. Applied add-cbrt-cube43.1

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}}}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}\]
    5. Applied cbrt-undiv43.1

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

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt0.0

      \[\leadsto \sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{\color{blue}{\left(\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}\right)}}}\]
    9. Applied pow-unpow0.0

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

    if -1.5623918316578669 < x < 0.024314219703607573

    1. Initial program 62.9

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

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

    if 0.024314219703607573 < x

    1. Initial program 0.1

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

      \[\leadsto \frac{x - \sin x}{\color{blue}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}}\]
    4. Applied add-cbrt-cube42.1

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x - \sin x\right) \cdot \left(x - \sin x\right)\right) \cdot \left(x - \sin x\right)}}}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}\]
    5. Applied cbrt-undiv42.1

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

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.1

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

Reproduce

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