Average Error: 31.2 → 0.1
Time: 37.3s
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}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}} \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}{x - \tan x}}\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^{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\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}{\sqrt[3]{\left(\left(x - \tan x\right) \cdot \left(x - \tan x\right)\right) \cdot \left(x - \tan x\right)}}} \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}{x - \tan x}}\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^{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\right)\\

\end{array}
double f(double x) {
        double r834031 = x;
        double r834032 = sin(r834031);
        double r834033 = r834031 - r834032;
        double r834034 = tan(r834031);
        double r834035 = r834031 - r834034;
        double r834036 = r834033 / r834035;
        return r834036;
}

double f(double x) {
        double r834037 = x;
        double r834038 = -0.030429044600799128;
        bool r834039 = r834037 <= r834038;
        double r834040 = tan(r834037);
        double r834041 = r834037 - r834040;
        double r834042 = r834037 / r834041;
        double r834043 = sin(r834037);
        double r834044 = r834041 * r834041;
        double r834045 = r834044 * r834041;
        double r834046 = cbrt(r834045);
        double r834047 = r834043 / r834046;
        double r834048 = r834042 - r834047;
        double r834049 = cbrt(r834048);
        double r834050 = r834043 / r834041;
        double r834051 = r834042 - r834050;
        double r834052 = cbrt(r834051);
        double r834053 = r834052 * r834052;
        double r834054 = r834049 * r834053;
        double r834055 = exp(r834054);
        double r834056 = log(r834055);
        double r834057 = 0.031237931746953045;
        bool r834058 = r834037 <= r834057;
        double r834059 = 0.225;
        double r834060 = r834037 * r834037;
        double r834061 = r834059 * r834060;
        double r834062 = r834060 * r834060;
        double r834063 = 0.009642857142857142;
        double r834064 = r834062 * r834063;
        double r834065 = 0.5;
        double r834066 = r834064 + r834065;
        double r834067 = r834061 - r834066;
        double r834068 = exp(r834051);
        double r834069 = log(r834068);
        double r834070 = r834058 ? r834067 : r834069;
        double r834071 = r834039 ? r834056 : r834070;
        return r834071;
}

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.030429044600799128

    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 \frac{x}{x - \tan x} - \color{blue}{\log \left(e^{\frac{\sin x}{x - \tan x}}\right)}\]
    6. Applied add-log-exp0.1

      \[\leadsto \color{blue}{\log \left(e^{\frac{x}{x - \tan x}}\right)} - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)\]
    7. Applied diff-log0.1

      \[\leadsto \color{blue}{\log \left(\frac{e^{\frac{x}{x - \tan x}}}{e^{\frac{\sin x}{x - \tan x}}}\right)}\]
    8. Simplified0.1

      \[\leadsto \log \color{blue}{\left(e^{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\right)}\]
    9. Using strategy rm
    10. 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)\]
    11. Using strategy rm
    12. 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}{x - \tan x}}\right) \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)\]

    if -0.030429044600799128 < x < 0.031237931746953045

    1. Initial program 62.7

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

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. 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)}\]
    5. 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)}\]

    if 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 \frac{x}{x - \tan x} - \color{blue}{\log \left(e^{\frac{\sin x}{x - \tan x}}\right)}\]
    6. Applied add-log-exp0.1

      \[\leadsto \color{blue}{\log \left(e^{\frac{x}{x - \tan x}}\right)} - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)\]
    7. Applied diff-log0.1

      \[\leadsto \color{blue}{\log \left(\frac{e^{\frac{x}{x - \tan x}}}{e^{\frac{\sin x}{x - \tan x}}}\right)}\]
    8. Simplified0.1

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

Reproduce

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