Average Error: 32.1 → 0.0
Time: 16.7s
Precision: binary64
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -0.025787172413692064 \lor \neg \left(x \leq 0.022487938951425535\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log \left({\left(e^{x}\right)}^{0.225}\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -0.025787172413692064 \lor \neg \left(x \leq 0.022487938951425535\right):\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \log \left({\left(e^{x}\right)}^{0.225}\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\

\end{array}
double code(double x) {
	return (((double) (x - ((double) sin(x)))) / ((double) (x - ((double) tan(x)))));
}
double code(double x) {
	double VAR;
	if (((x <= -0.025787172413692064) || !(x <= 0.022487938951425535))) {
		VAR = (((double) (x - ((double) sin(x)))) / ((double) (x - ((double) tan(x)))));
	} else {
		VAR = ((double) (((double) (x * ((double) log(((double) pow(((double) exp(x)), 0.225)))))) + ((double) (-0.5 + ((double) (((double) pow(x, 4.0)) * -0.009642857142857142))))));
	}
	return VAR;
}

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.025787172413692064 or 0.02248793895142553 < x

    1. Initial program 0.1

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

    if -0.025787172413692064 < x < 0.02248793895142553

    1. Initial program 63.2

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

      \[\leadsto \color{blue}{0.225 \cdot {x}^{2} - \left(0.009642857142857142 \cdot {x}^{4} + 0.5\right)}\]
    3. Simplified0.0

      \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)}\]
    4. Using strategy rm
    5. Applied add-log-exp0.0

      \[\leadsto x \cdot \color{blue}{\log \left(e^{x \cdot 0.225}\right)} + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\]
    6. Simplified0.0

      \[\leadsto x \cdot \log \color{blue}{\left({\left(e^{x}\right)}^{0.225}\right)} + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.025787172413692064 \lor \neg \left(x \leq 0.022487938951425535\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log \left({\left(e^{x}\right)}^{0.225}\right) + \left(-0.5 + {x}^{4} \cdot -0.009642857142857142\right)\\ \end{array}\]

Reproduce

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