Average Error: 31.9 → 0.0
Time: 22.6s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02853292537808117465547574909123795805499 \lor \neg \left(x \le 0.02754085059414950256706511311222129734233\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\left(\log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right) + \log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right)\right) + \frac{1}{2}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.02853292537808117465547574909123795805499 \lor \neg \left(x \le 0.02754085059414950256706511311222129734233\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{else}:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\left(\log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right) + \log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right)\right) + \frac{1}{2}\right)\\

\end{array}
double f(double x) {
        double r24060 = x;
        double r24061 = sin(r24060);
        double r24062 = r24060 - r24061;
        double r24063 = tan(r24060);
        double r24064 = r24060 - r24063;
        double r24065 = r24062 / r24064;
        return r24065;
}

double f(double x) {
        double r24066 = x;
        double r24067 = -0.028532925378081175;
        bool r24068 = r24066 <= r24067;
        double r24069 = 0.027540850594149503;
        bool r24070 = r24066 <= r24069;
        double r24071 = !r24070;
        bool r24072 = r24068 || r24071;
        double r24073 = sin(r24066);
        double r24074 = r24066 - r24073;
        double r24075 = tan(r24066);
        double r24076 = r24066 - r24075;
        double r24077 = r24074 / r24076;
        double r24078 = 0.225;
        double r24079 = 2.0;
        double r24080 = pow(r24066, r24079);
        double r24081 = r24078 * r24080;
        double r24082 = 0.009642857142857142;
        double r24083 = 4.0;
        double r24084 = pow(r24066, r24083);
        double r24085 = r24082 * r24084;
        double r24086 = exp(r24085);
        double r24087 = sqrt(r24086);
        double r24088 = log(r24087);
        double r24089 = r24088 + r24088;
        double r24090 = 0.5;
        double r24091 = r24089 + r24090;
        double r24092 = r24081 - r24091;
        double r24093 = r24072 ? r24077 : r24092;
        return r24093;
}

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.028532925378081175 or 0.027540850594149503 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]

    if -0.028532925378081175 < x < 0.027540850594149503

    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. Using strategy rm
    4. Applied add-log-exp0.0

      \[\leadsto \frac{9}{40} \cdot {x}^{2} - \left(\color{blue}{\log \left(e^{\frac{27}{2800} \cdot {x}^{4}}\right)} + \frac{1}{2}\right)\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt0.0

      \[\leadsto \frac{9}{40} \cdot {x}^{2} - \left(\log \color{blue}{\left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}} \cdot \sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right)} + \frac{1}{2}\right)\]
    7. Applied log-prod0.0

      \[\leadsto \frac{9}{40} \cdot {x}^{2} - \left(\color{blue}{\left(\log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right) + \log \left(\sqrt{e^{\frac{27}{2800} \cdot {x}^{4}}}\right)\right)} + \frac{1}{2}\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

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

Reproduce

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