Average Error: 31.1 → 0.0
Time: 26.4s
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 r23614 = x;
        double r23615 = sin(r23614);
        double r23616 = r23614 - r23615;
        double r23617 = tan(r23614);
        double r23618 = r23614 - r23617;
        double r23619 = r23616 / r23618;
        return r23619;
}

double f(double x) {
        double r23620 = x;
        double r23621 = -0.03213985651385342;
        bool r23622 = r23620 <= r23621;
        double r23623 = 0.031458382400945506;
        bool r23624 = r23620 <= r23623;
        double r23625 = !r23624;
        bool r23626 = r23622 || r23625;
        double r23627 = sin(r23620);
        double r23628 = r23620 - r23627;
        double r23629 = tan(r23620);
        double r23630 = r23620 - r23629;
        double r23631 = r23628 / r23630;
        double r23632 = 3.0;
        double r23633 = pow(r23631, r23632);
        double r23634 = cbrt(r23633);
        double r23635 = 0.225;
        double r23636 = 2.0;
        double r23637 = pow(r23620, r23636);
        double r23638 = r23635 * r23637;
        double r23639 = 0.009642857142857142;
        double r23640 = 4.0;
        double r23641 = pow(r23620, r23640);
        double r23642 = r23639 * r23641;
        double r23643 = 0.5;
        double r23644 = r23642 + r23643;
        double r23645 = r23638 - r23644;
        double r23646 = r23626 ? r23634 : r23645;
        return r23646;
}

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