Average Error: 31.1 → 0.0
Time: 13.8s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03213985651385341951735696852665569167584 \lor \neg \left(x \le 0.03145838240094550597447664586070459336042\right):\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\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 -0.03213985651385341951735696852665569167584 \lor \neg \left(x \le 0.03145838240094550597447664586070459336042\right):\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\

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

\end{array}
double f(double x) {
        double r23252 = x;
        double r23253 = sin(r23252);
        double r23254 = r23252 - r23253;
        double r23255 = tan(r23252);
        double r23256 = r23252 - r23255;
        double r23257 = r23254 / r23256;
        return r23257;
}

double f(double x) {
        double r23258 = x;
        double r23259 = -0.03213985651385342;
        bool r23260 = r23258 <= r23259;
        double r23261 = 0.031458382400945506;
        bool r23262 = r23258 <= r23261;
        double r23263 = !r23262;
        bool r23264 = r23260 || r23263;
        double r23265 = sin(r23258);
        double r23266 = r23258 - r23265;
        double r23267 = tan(r23258);
        double r23268 = r23258 - r23267;
        double r23269 = r23266 / r23268;
        double r23270 = 3.0;
        double r23271 = pow(r23269, r23270);
        double r23272 = cbrt(r23271);
        double r23273 = 0.225;
        double r23274 = 2.0;
        double r23275 = pow(r23258, r23274);
        double r23276 = r23273 * r23275;
        double r23277 = 0.009642857142857142;
        double r23278 = 4.0;
        double r23279 = pow(r23258, r23278);
        double r23280 = r23277 * r23279;
        double r23281 = 0.5;
        double r23282 = r23280 + r23281;
        double r23283 = r23276 - r23282;
        double r23284 = r23264 ? r23272 : r23283;
        return r23284;
}

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.03213985651385342 or 0.031458382400945506 < x

    1. Initial program 0.1

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

      \[\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-cube41.8

      \[\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-undiv41.8

      \[\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}}}\]

    if -0.03213985651385342 < x < 0.031458382400945506

    1. Initial program 63.3

      \[\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. Recombined 2 regimes into one program.
  4. Final simplification0.0

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

Reproduce

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