Average Error: 31.6 → 0.0
Time: 9.1s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0266096722673715806 \lor \neg \left(x \le 0.0284410596258715502\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.0266096722673715806 \lor \neg \left(x \le 0.0284410596258715502\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 r8626 = x;
        double r8627 = sin(r8626);
        double r8628 = r8626 - r8627;
        double r8629 = tan(r8626);
        double r8630 = r8626 - r8629;
        double r8631 = r8628 / r8630;
        return r8631;
}

double f(double x) {
        double r8632 = x;
        double r8633 = -0.02660967226737158;
        bool r8634 = r8632 <= r8633;
        double r8635 = 0.02844105962587155;
        bool r8636 = r8632 <= r8635;
        double r8637 = !r8636;
        bool r8638 = r8634 || r8637;
        double r8639 = sin(r8632);
        double r8640 = r8632 - r8639;
        double r8641 = tan(r8632);
        double r8642 = r8632 - r8641;
        double r8643 = r8640 / r8642;
        double r8644 = 3.0;
        double r8645 = pow(r8643, r8644);
        double r8646 = cbrt(r8645);
        double r8647 = 0.225;
        double r8648 = 2.0;
        double r8649 = pow(r8632, r8648);
        double r8650 = r8647 * r8649;
        double r8651 = 0.009642857142857142;
        double r8652 = 4.0;
        double r8653 = pow(r8632, r8652);
        double r8654 = r8651 * r8653;
        double r8655 = 0.5;
        double r8656 = r8654 + r8655;
        double r8657 = r8650 - r8656;
        double r8658 = r8638 ? r8646 : r8657;
        return r8658;
}

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.02660967226737158 or 0.02844105962587155 < x

    1. Initial program 0.0

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

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

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

      \[\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.02660967226737158 < x < 0.02844105962587155

    1. Initial program 63.0

      \[\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.0266096722673715806 \lor \neg \left(x \le 0.0284410596258715502\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 2020046 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))