Average Error: 31.8 → 0.0
Time: 23.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03354637559076366348786990556618547998369 \lor \neg \left(x \le 0.03372325990928042721561652683703869115561\right):\\ \;\;\;\;\frac{x - \sin x}{x - \left(\sqrt[3]{\frac{\sin x}{\cos x}} \cdot \sqrt[3]{\frac{\sin x}{\cos x}}\right) \cdot \sqrt[3]{\frac{\sin x}{\cos x}}}\\ \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.03354637559076366348786990556618547998369 \lor \neg \left(x \le 0.03372325990928042721561652683703869115561\right):\\
\;\;\;\;\frac{x - \sin x}{x - \left(\sqrt[3]{\frac{\sin x}{\cos x}} \cdot \sqrt[3]{\frac{\sin x}{\cos x}}\right) \cdot \sqrt[3]{\frac{\sin x}{\cos x}}}\\

\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 r22067 = x;
        double r22068 = sin(r22067);
        double r22069 = r22067 - r22068;
        double r22070 = tan(r22067);
        double r22071 = r22067 - r22070;
        double r22072 = r22069 / r22071;
        return r22072;
}

double f(double x) {
        double r22073 = x;
        double r22074 = -0.033546375590763663;
        bool r22075 = r22073 <= r22074;
        double r22076 = 0.03372325990928043;
        bool r22077 = r22073 <= r22076;
        double r22078 = !r22077;
        bool r22079 = r22075 || r22078;
        double r22080 = sin(r22073);
        double r22081 = r22073 - r22080;
        double r22082 = cos(r22073);
        double r22083 = r22080 / r22082;
        double r22084 = cbrt(r22083);
        double r22085 = r22084 * r22084;
        double r22086 = r22085 * r22084;
        double r22087 = r22073 - r22086;
        double r22088 = r22081 / r22087;
        double r22089 = 0.225;
        double r22090 = 2.0;
        double r22091 = pow(r22073, r22090);
        double r22092 = r22089 * r22091;
        double r22093 = 0.009642857142857142;
        double r22094 = 4.0;
        double r22095 = pow(r22073, r22094);
        double r22096 = r22093 * r22095;
        double r22097 = 0.5;
        double r22098 = r22096 + r22097;
        double r22099 = r22092 - r22098;
        double r22100 = r22079 ? r22088 : r22099;
        return r22100;
}

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.033546375590763663 or 0.03372325990928043 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \frac{x - \sin x}{\color{blue}{x - \frac{\sin x}{\cos x}}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt0.0

      \[\leadsto \frac{x - \sin x}{x - \color{blue}{\left(\sqrt[3]{\frac{\sin x}{\cos x}} \cdot \sqrt[3]{\frac{\sin x}{\cos x}}\right) \cdot \sqrt[3]{\frac{\sin x}{\cos x}}}}\]

    if -0.033546375590763663 < x < 0.03372325990928043

    1. Initial program 63.2

      \[\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.03354637559076366348786990556618547998369 \lor \neg \left(x \le 0.03372325990928042721561652683703869115561\right):\\ \;\;\;\;\frac{x - \sin x}{x - \left(\sqrt[3]{\frac{\sin x}{\cos x}} \cdot \sqrt[3]{\frac{\sin x}{\cos x}}\right) \cdot \sqrt[3]{\frac{\sin x}{\cos x}}}\\ \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 2019235 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  :precision binary64
  (/ (- x (sin x)) (- x (tan x))))