Average Error: 31.5 → 0.0
Time: 49.3s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.029116187280256105:\\ \;\;\;\;\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{elif}\;x \le 0.03078436997544294:\\ \;\;\;\;\frac{-1}{2} + \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.029116187280256105:\\
\;\;\;\;\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{elif}\;x \le 0.03078436997544294:\\
\;\;\;\;\frac{-1}{2} + \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) \cdot \left(x \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\

\end{array}
double f(double x) {
        double r1533114 = x;
        double r1533115 = sin(r1533114);
        double r1533116 = r1533114 - r1533115;
        double r1533117 = tan(r1533114);
        double r1533118 = r1533114 - r1533117;
        double r1533119 = r1533116 / r1533118;
        return r1533119;
}

double f(double x) {
        double r1533120 = x;
        double r1533121 = -0.029116187280256105;
        bool r1533122 = r1533120 <= r1533121;
        double r1533123 = sin(r1533120);
        double r1533124 = r1533120 - r1533123;
        double r1533125 = tan(r1533120);
        double r1533126 = r1533120 - r1533125;
        double r1533127 = r1533124 / r1533126;
        double r1533128 = cbrt(r1533127);
        double r1533129 = r1533128 * r1533128;
        double r1533130 = r1533129 * r1533128;
        double r1533131 = 0.03078436997544294;
        bool r1533132 = r1533120 <= r1533131;
        double r1533133 = -0.5;
        double r1533134 = 0.225;
        double r1533135 = r1533120 * r1533120;
        double r1533136 = 0.009642857142857142;
        double r1533137 = r1533135 * r1533136;
        double r1533138 = r1533134 - r1533137;
        double r1533139 = r1533138 * r1533135;
        double r1533140 = r1533133 + r1533139;
        double r1533141 = r1533120 / r1533126;
        double r1533142 = r1533123 / r1533126;
        double r1533143 = r1533141 - r1533142;
        double r1533144 = r1533132 ? r1533140 : r1533143;
        double r1533145 = r1533122 ? r1533130 : r1533144;
        return r1533145;
}

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

    1. Initial program 0.0

      \[\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.029116187280256105 < x < 0.03078436997544294

    1. Initial program 62.7

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

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

    if 0.03078436997544294 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub0.0

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.029116187280256105:\\ \;\;\;\;\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{elif}\;x \le 0.03078436997544294:\\ \;\;\;\;\frac{-1}{2} + \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array}\]

Reproduce

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