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

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

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

\end{array}
double f(double x) {
        double r834445 = x;
        double r834446 = sin(r834445);
        double r834447 = r834445 - r834446;
        double r834448 = tan(r834445);
        double r834449 = r834445 - r834448;
        double r834450 = r834447 / r834449;
        return r834450;
}

double f(double x) {
        double r834451 = x;
        double r834452 = -0.030429044600799128;
        bool r834453 = r834451 <= r834452;
        double r834454 = tan(r834451);
        double r834455 = r834451 - r834454;
        double r834456 = r834451 / r834455;
        double r834457 = sin(r834451);
        double r834458 = r834457 / r834455;
        double r834459 = r834456 - r834458;
        double r834460 = cbrt(r834459);
        double r834461 = r834455 * r834455;
        double r834462 = r834455 * r834461;
        double r834463 = cbrt(r834462);
        double r834464 = r834457 / r834463;
        double r834465 = r834456 - r834464;
        double r834466 = cbrt(r834465);
        double r834467 = r834460 * r834466;
        double r834468 = r834460 * r834467;
        double r834469 = exp(r834468);
        double r834470 = log(r834469);
        double r834471 = 0.031237931746953045;
        bool r834472 = r834451 <= r834471;
        double r834473 = 0.225;
        double r834474 = r834451 * r834451;
        double r834475 = r834473 * r834474;
        double r834476 = r834474 * r834474;
        double r834477 = 0.009642857142857142;
        double r834478 = r834476 * r834477;
        double r834479 = 0.5;
        double r834480 = r834478 + r834479;
        double r834481 = r834475 - r834480;
        double r834482 = r834472 ? r834481 : r834470;
        double r834483 = r834453 ? r834470 : r834482;
        return r834483;
}

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.030429044600799128 or 0.031237931746953045 < x

    1. Initial program 0.1

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

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied add-log-exp0.1

      \[\leadsto \color{blue}{\log \left(e^{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\right)}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt0.1

      \[\leadsto \log \left(e^{\color{blue}{\left(\sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\right) \cdot \sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}}}\right)\]
    8. Using strategy rm
    9. Applied add-cbrt-cube0.1

      \[\leadsto \log \left(e^{\left(\sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \cdot \sqrt[3]{\frac{x}{x - \tan x} - \frac{\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)}}}}\right) \cdot \sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}}\right)\]

    if -0.030429044600799128 < x < 0.031237931746953045

    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 \frac{9}{40} - \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800} + \frac{1}{2}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

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

Reproduce

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