Average Error: 31.1 → 0.0
Time: 1.7min
Precision: binary64
Cost: 1346
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.03192922868605998:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \log \left(e^{0.009642857142857142 \cdot {x}^{4}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\ \end{array}\]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -0.02561464791998105:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\

\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
 :precision binary64
 (if (<= x -0.02561464791998105)
   (cbrt (pow (/ (- x (sin x)) (- x (tan x))) 3.0))
   (if (<= x 0.03192922868605998)
     (-
      (- (* (* x x) 0.225) 0.5)
      (log (exp (* 0.009642857142857142 (pow x 4.0)))))
     (/ 1.0 (/ (- x (tan x)) (- x (sin x)))))))
double code(double x) {
	return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
	double tmp;
	if (x <= -0.02561464791998105) {
		tmp = cbrt(pow(((x - sin(x)) / (x - tan(x))), 3.0));
	} else if (x <= 0.03192922868605998) {
		tmp = (((x * x) * 0.225) - 0.5) - log(exp(0.009642857142857142 * pow(x, 4.0)));
	} else {
		tmp = 1.0 / ((x - tan(x)) / (x - sin(x)));
	}
	return tmp;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs
Alternative 1
Accuracy0.0
Cost1346
\[\begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.03192922868605998:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \log \left(e^{0.009642857142857142 \cdot {x}^{4}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]
Alternative 2
Accuracy0.0
Cost1922
\[\begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.03192922868605998:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \sqrt[3]{{x}^{4}} \cdot \left(0.009642857142857142 \cdot \left(\sqrt[3]{{x}^{4}} \cdot \sqrt[3]{{x}^{4}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]
Alternative 3
Accuracy0.0
Cost1860
\[\begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105 \lor \neg \left(x \leq 0.03192922868605998\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \sqrt[3]{{x}^{4}} \cdot \left(0.009642857142857142 \cdot \left(\sqrt[3]{{x}^{4}} \cdot \sqrt[3]{{x}^{4}}\right)\right)\\ \end{array}\]
Alternative 4
Accuracy0.0
Cost1156
\[\begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105 \lor \neg \left(x \leq 0.03192922868605998\right):\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot 0.225 - \left(0.5 + 0.009642857142857142 \cdot {x}^{4}\right)\\ \end{array}\]
Alternative 5
Accuracy31.1
Cost576
\[\frac{x - \sin x}{x - \tan x}\]

Derivation

  1. Split input into 3 regimes
  2. if x < -0.0256146479199810505

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube_binary640.1

      \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{x - \sin x}{x - \tan x} \cdot \frac{x - \sin x}{x - \tan x}\right) \cdot \frac{x - \sin x}{x - \tan x}}}\]
    4. Simplified0.1

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

    if -0.0256146479199810505 < x < 0.031929228686059977

    1. Initial program 63.3

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

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

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

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

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

    if 0.031929228686059977 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied clear-num_binary640.0

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.02561464791998105:\\ \;\;\;\;\sqrt[3]{{\left(\frac{x - \sin x}{x - \tan x}\right)}^{3}}\\ \mathbf{elif}\;x \leq 0.03192922868605998:\\ \;\;\;\;\left(\left(x \cdot x\right) \cdot 0.225 - 0.5\right) - \log \left(e^{0.009642857142857142 \cdot {x}^{4}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\ \end{array}\]

Reproduce

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