Average Error: 30.7 → 0.0
Time: 29.5s
Precision: 64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02581010450665607:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\ \mathbf{elif}\;x \le 0.028004662405730834:\\ \;\;\;\;\left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) \cdot \left(x \cdot x\right) + \frac{-1}{2}\\ \mathbf{else}:\\ \;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \le -0.02581010450665607:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\

\end{array}
double f(double x) {
        double r445062 = x;
        double r445063 = sin(r445062);
        double r445064 = r445062 - r445063;
        double r445065 = tan(r445062);
        double r445066 = r445062 - r445065;
        double r445067 = r445064 / r445066;
        return r445067;
}

double f(double x) {
        double r445068 = x;
        double r445069 = -0.02581010450665607;
        bool r445070 = r445068 <= r445069;
        double r445071 = sin(r445068);
        double r445072 = r445068 - r445071;
        double r445073 = tan(r445068);
        double r445074 = r445068 - r445073;
        double r445075 = r445072 / r445074;
        double r445076 = exp(r445075);
        double r445077 = log(r445076);
        double r445078 = 0.028004662405730834;
        bool r445079 = r445068 <= r445078;
        double r445080 = 0.225;
        double r445081 = r445068 * r445068;
        double r445082 = 0.009642857142857142;
        double r445083 = r445081 * r445082;
        double r445084 = r445080 - r445083;
        double r445085 = r445084 * r445081;
        double r445086 = -0.5;
        double r445087 = r445085 + r445086;
        double r445088 = r445079 ? r445087 : r445077;
        double r445089 = r445070 ? r445077 : r445088;
        return r445089;
}

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.02581010450665607 or 0.028004662405730834 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-log-exp0.0

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

    if -0.02581010450665607 < x < 0.028004662405730834

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

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

Reproduce

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