sintan (problem 3.4.5)

Percentage Accurate: 50.9% → 100.0%
Time: 17.3s
Alternatives: 11
Speedup: 67.6×

Specification

?
\[\begin{array}{l} \\ \frac{x - \sin x}{x - \tan x} \end{array} \]
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
double code(double x) {
	return (x - sin(x)) / (x - tan(x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (x - sin(x)) / (x - tan(x))
end function
public static double code(double x) {
	return (x - Math.sin(x)) / (x - Math.tan(x));
}
def code(x):
	return (x - math.sin(x)) / (x - math.tan(x))
function code(x)
	return Float64(Float64(x - sin(x)) / Float64(x - tan(x)))
end
function tmp = code(x)
	tmp = (x - sin(x)) / (x - tan(x));
end
code[x_] := N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x - \sin x}{x - \tan x}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 50.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x - \sin x}{x - \tan x} \end{array} \]
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
double code(double x) {
	return (x - sin(x)) / (x - tan(x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (x - sin(x)) / (x - tan(x))
end function
public static double code(double x) {
	return (x - Math.sin(x)) / (x - Math.tan(x));
}
def code(x):
	return (x - math.sin(x)) / (x - math.tan(x))
function code(x)
	return Float64(Float64(x - sin(x)) / Float64(x - tan(x)))
end
function tmp = code(x)
	tmp = (x - sin(x)) / (x - tan(x));
end
code[x_] := N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x - \sin x}{x - \tan x}
\end{array}

Alternative 1: 100.0% accurate, 0.7× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} t_0 := x - \tan x\\ \mathbf{if}\;x \leq 0.088:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (let* ((t_0 (- x (tan x))))
   (if (<= x 0.088)
     (-
      (+
       (* -0.009642857142857142 (pow x 4.0))
       (+ (* 0.00024107142857142857 (pow x 6.0)) (* 0.225 (pow x 2.0))))
      0.5)
     (- (/ x t_0) (/ (sin x) t_0)))))
x = abs(x);
double code(double x) {
	double t_0 = x - tan(x);
	double tmp;
	if (x <= 0.088) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + ((0.00024107142857142857 * pow(x, 6.0)) + (0.225 * pow(x, 2.0)))) - 0.5;
	} else {
		tmp = (x / t_0) - (sin(x) / t_0);
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x - tan(x)
    if (x <= 0.088d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + ((0.00024107142857142857d0 * (x ** 6.0d0)) + (0.225d0 * (x ** 2.0d0)))) - 0.5d0
    else
        tmp = (x / t_0) - (sin(x) / t_0)
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double t_0 = x - Math.tan(x);
	double tmp;
	if (x <= 0.088) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + ((0.00024107142857142857 * Math.pow(x, 6.0)) + (0.225 * Math.pow(x, 2.0)))) - 0.5;
	} else {
		tmp = (x / t_0) - (Math.sin(x) / t_0);
	}
	return tmp;
}
x = abs(x)
def code(x):
	t_0 = x - math.tan(x)
	tmp = 0
	if x <= 0.088:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + ((0.00024107142857142857 * math.pow(x, 6.0)) + (0.225 * math.pow(x, 2.0)))) - 0.5
	else:
		tmp = (x / t_0) - (math.sin(x) / t_0)
	return tmp
x = abs(x)
function code(x)
	t_0 = Float64(x - tan(x))
	tmp = 0.0
	if (x <= 0.088)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(Float64(0.00024107142857142857 * (x ^ 6.0)) + Float64(0.225 * (x ^ 2.0)))) - 0.5);
	else
		tmp = Float64(Float64(x / t_0) - Float64(sin(x) / t_0));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	t_0 = x - tan(x);
	tmp = 0.0;
	if (x <= 0.088)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + ((0.00024107142857142857 * (x ^ 6.0)) + (0.225 * (x ^ 2.0)))) - 0.5;
	else
		tmp = (x / t_0) - (sin(x) / t_0);
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := Block[{t$95$0 = N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.088], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.00024107142857142857 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision] + N[(0.225 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
t_0 := x - \tan x\\
\mathbf{if}\;x \leq 0.088:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.087999999999999995

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5} \]

    if 0.087999999999999995 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Step-by-step derivation
      1. div-sub100.0%

        \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.088:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array} \]

Alternative 2: 100.0% accurate, 0.7× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} t_0 := x - \tan x\\ \mathbf{if}\;x \leq 0.088:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (let* ((t_0 (- x (tan x))))
   (if (<= x 0.088)
     (-
      (+
       (* -0.009642857142857142 (pow x 4.0))
       (+
        (* 0.00024107142857142857 (pow x 6.0))
        (+ (+ 1.0 (* x (* x 0.225))) -1.0)))
      0.5)
     (- (/ x t_0) (/ (sin x) t_0)))))
x = abs(x);
double code(double x) {
	double t_0 = x - tan(x);
	double tmp;
	if (x <= 0.088) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + ((0.00024107142857142857 * pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	} else {
		tmp = (x / t_0) - (sin(x) / t_0);
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x - tan(x)
    if (x <= 0.088d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + ((0.00024107142857142857d0 * (x ** 6.0d0)) + ((1.0d0 + (x * (x * 0.225d0))) + (-1.0d0)))) - 0.5d0
    else
        tmp = (x / t_0) - (sin(x) / t_0)
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double t_0 = x - Math.tan(x);
	double tmp;
	if (x <= 0.088) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + ((0.00024107142857142857 * Math.pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	} else {
		tmp = (x / t_0) - (Math.sin(x) / t_0);
	}
	return tmp;
}
x = abs(x)
def code(x):
	t_0 = x - math.tan(x)
	tmp = 0
	if x <= 0.088:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + ((0.00024107142857142857 * math.pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5
	else:
		tmp = (x / t_0) - (math.sin(x) / t_0)
	return tmp
x = abs(x)
function code(x)
	t_0 = Float64(x - tan(x))
	tmp = 0.0
	if (x <= 0.088)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(Float64(0.00024107142857142857 * (x ^ 6.0)) + Float64(Float64(1.0 + Float64(x * Float64(x * 0.225))) + -1.0))) - 0.5);
	else
		tmp = Float64(Float64(x / t_0) - Float64(sin(x) / t_0));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	t_0 = x - tan(x);
	tmp = 0.0;
	if (x <= 0.088)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + ((0.00024107142857142857 * (x ^ 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	else
		tmp = (x / t_0) - (sin(x) / t_0);
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := Block[{t$95$0 = N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.088], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.00024107142857142857 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
t_0 := x - \tan x\\
\mathbf{if}\;x \leq 0.088:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.087999999999999995

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5} \]
    3. Step-by-step derivation
      1. pow264.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) - 0.5 \]
      2. *-commutative64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(x \cdot x\right) \cdot 0.225}\right)\right) - 0.5 \]
      3. associate-*r*64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{x \cdot \left(x \cdot 0.225\right)}\right)\right) - 0.5 \]
      4. expm1-log1p-u64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \left(x \cdot 0.225\right)\right)\right)}\right)\right) - 0.5 \]
      5. expm1-def64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \left(x \cdot 0.225\right)\right)} - 1\right)}\right)\right) - 0.5 \]
      6. log1p-udef64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(e^{\color{blue}{\log \left(1 + x \cdot \left(x \cdot 0.225\right)\right)}} - 1\right)\right)\right) - 0.5 \]
      7. add-exp-log64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\color{blue}{\left(1 + x \cdot \left(x \cdot 0.225\right)\right)} - 1\right)\right)\right) - 0.5 \]
    4. Applied egg-rr64.6%

      \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) - 1\right)}\right)\right) - 0.5 \]

    if 0.087999999999999995 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Step-by-step derivation
      1. div-sub100.0%

        \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.088:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array} \]

Alternative 3: 100.0% accurate, 0.9× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 0.08:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 0.08)
   (-
    (+
     (* -0.009642857142857142 (pow x 4.0))
     (+
      (* 0.00024107142857142857 (pow x 6.0))
      (+ (+ 1.0 (* x (* x 0.225))) -1.0)))
    0.5)
   (/ (- x (sin x)) (- x (tan x)))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 0.08) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + ((0.00024107142857142857 * pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	} else {
		tmp = (x - sin(x)) / (x - tan(x));
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 0.08d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + ((0.00024107142857142857d0 * (x ** 6.0d0)) + ((1.0d0 + (x * (x * 0.225d0))) + (-1.0d0)))) - 0.5d0
    else
        tmp = (x - sin(x)) / (x - tan(x))
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 0.08) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + ((0.00024107142857142857 * Math.pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	} else {
		tmp = (x - Math.sin(x)) / (x - Math.tan(x));
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 0.08:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + ((0.00024107142857142857 * math.pow(x, 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5
	else:
		tmp = (x - math.sin(x)) / (x - math.tan(x))
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 0.08)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(Float64(0.00024107142857142857 * (x ^ 6.0)) + Float64(Float64(1.0 + Float64(x * Float64(x * 0.225))) + -1.0))) - 0.5);
	else
		tmp = Float64(Float64(x - sin(x)) / Float64(x - tan(x)));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 0.08)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + ((0.00024107142857142857 * (x ^ 6.0)) + ((1.0 + (x * (x * 0.225))) + -1.0))) - 0.5;
	else
		tmp = (x - sin(x)) / (x - tan(x));
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 0.08], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.00024107142857142857 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision], N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.08:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.0800000000000000017

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot {x}^{2}\right)\right) - 0.5} \]
    3. Step-by-step derivation
      1. pow264.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + 0.225 \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) - 0.5 \]
      2. *-commutative64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(x \cdot x\right) \cdot 0.225}\right)\right) - 0.5 \]
      3. associate-*r*64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{x \cdot \left(x \cdot 0.225\right)}\right)\right) - 0.5 \]
      4. expm1-log1p-u64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \left(x \cdot 0.225\right)\right)\right)}\right)\right) - 0.5 \]
      5. expm1-def64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \left(x \cdot 0.225\right)\right)} - 1\right)}\right)\right) - 0.5 \]
      6. log1p-udef64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(e^{\color{blue}{\log \left(1 + x \cdot \left(x \cdot 0.225\right)\right)}} - 1\right)\right)\right) - 0.5 \]
      7. add-exp-log64.6%

        \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\color{blue}{\left(1 + x \cdot \left(x \cdot 0.225\right)\right)} - 1\right)\right)\right) - 0.5 \]
    4. Applied egg-rr64.6%

      \[\leadsto \left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \color{blue}{\left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) - 1\right)}\right)\right) - 0.5 \]

    if 0.0800000000000000017 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.08:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + \left(0.00024107142857142857 \cdot {x}^{6} + \left(\left(1 + x \cdot \left(x \cdot 0.225\right)\right) + -1\right)\right)\right) - 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array} \]

Alternative 4: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 2.6:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\sin x - \tan x}{x}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 2.6)
   (+ (+ (* -0.009642857142857142 (pow x 4.0)) (* x (* x 0.225))) -0.5)
   (- 1.0 (/ (- (sin x) (tan x)) x))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 2.6) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = 1.0 - ((sin(x) - tan(x)) / x);
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.6d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + (x * (x * 0.225d0))) + (-0.5d0)
    else
        tmp = 1.0d0 - ((sin(x) - tan(x)) / x)
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 2.6) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = 1.0 - ((Math.sin(x) - Math.tan(x)) / x);
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 2.6:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5
	else:
		tmp = 1.0 - ((math.sin(x) - math.tan(x)) / x)
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 2.6)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(x * Float64(x * 0.225))) + -0.5);
	else
		tmp = Float64(1.0 - Float64(Float64(sin(x) - tan(x)) / x));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.6)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + (x * (x * 0.225))) + -0.5;
	else
		tmp = 1.0 - ((sin(x) - tan(x)) / x);
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 2.6], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], N[(1.0 - N[(N[(N[Sin[x], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.6:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.60000000000000009

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) - 0.5} \]
    3. Step-by-step derivation
      1. sub-neg64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) + \left(-0.5\right)} \]
      2. fma-def64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot {x}^{2}\right)} + \left(-0.5\right) \]
      3. unpow264.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \color{blue}{\left(x \cdot x\right)}\right) + \left(-0.5\right) \]
      4. metadata-eval64.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + \color{blue}{-0.5} \]
    4. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + -0.5} \]
    5. Step-by-step derivation
      1. fma-udef64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot \left(x \cdot x\right)\right)} + -0.5 \]
      2. +-commutative64.1%

        \[\leadsto \color{blue}{\left(0.225 \cdot \left(x \cdot x\right) + -0.009642857142857142 \cdot {x}^{4}\right)} + -0.5 \]
      3. *-commutative64.1%

        \[\leadsto \left(\color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
      4. associate-*l*64.1%

        \[\leadsto \left(\color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
    6. Applied egg-rr64.1%

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

    if 2.60000000000000009 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Taylor expanded in x around inf 99.7%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{\sin x}{x}\right) - -1 \cdot \frac{\sin x}{x \cdot \cos x}} \]
    3. Step-by-step derivation
      1. associate--l+99.7%

        \[\leadsto \color{blue}{1 + \left(-1 \cdot \frac{\sin x}{x} - -1 \cdot \frac{\sin x}{x \cdot \cos x}\right)} \]
      2. sub-neg99.7%

        \[\leadsto 1 + \color{blue}{\left(-1 \cdot \frac{\sin x}{x} + \left(--1 \cdot \frac{\sin x}{x \cdot \cos x}\right)\right)} \]
      3. *-lft-identity99.7%

        \[\leadsto 1 + \left(-1 \cdot \frac{\sin x}{x} + \color{blue}{1 \cdot \left(--1 \cdot \frac{\sin x}{x \cdot \cos x}\right)}\right) \]
      4. metadata-eval99.7%

        \[\leadsto 1 + \left(-1 \cdot \frac{\sin x}{x} + \color{blue}{\left(--1\right)} \cdot \left(--1 \cdot \frac{\sin x}{x \cdot \cos x}\right)\right) \]
      5. cancel-sign-sub-inv99.7%

        \[\leadsto 1 + \color{blue}{\left(-1 \cdot \frac{\sin x}{x} - -1 \cdot \left(--1 \cdot \frac{\sin x}{x \cdot \cos x}\right)\right)} \]
      6. distribute-lft-out--99.7%

        \[\leadsto 1 + \color{blue}{-1 \cdot \left(\frac{\sin x}{x} - \left(--1 \cdot \frac{\sin x}{x \cdot \cos x}\right)\right)} \]
      7. mul-1-neg99.7%

        \[\leadsto 1 + -1 \cdot \left(\frac{\sin x}{x} - \left(-\color{blue}{\left(-\frac{\sin x}{x \cdot \cos x}\right)}\right)\right) \]
      8. remove-double-neg99.7%

        \[\leadsto 1 + -1 \cdot \left(\frac{\sin x}{x} - \color{blue}{\frac{\sin x}{x \cdot \cos x}}\right) \]
      9. *-commutative99.7%

        \[\leadsto 1 + -1 \cdot \left(\frac{\sin x}{x} - \frac{\sin x}{\color{blue}{\cos x \cdot x}}\right) \]
      10. associate-/r*99.7%

        \[\leadsto 1 + -1 \cdot \left(\frac{\sin x}{x} - \color{blue}{\frac{\frac{\sin x}{\cos x}}{x}}\right) \]
      11. div-sub99.7%

        \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\sin x - \frac{\sin x}{\cos x}}{x}} \]
    4. Simplified99.7%

      \[\leadsto \color{blue}{1 - \frac{\sin x - \frac{\sin x}{\cos x}}{x}} \]
    5. Step-by-step derivation
      1. tan-quot99.7%

        \[\leadsto 1 - \frac{\sin x - \color{blue}{\tan x}}{x} \]
      2. sub-neg99.7%

        \[\leadsto 1 - \frac{\color{blue}{\sin x + \left(-\tan x\right)}}{x} \]
    6. Applied egg-rr99.7%

      \[\leadsto 1 - \frac{\color{blue}{\sin x + \left(-\tan x\right)}}{x} \]
    7. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto 1 - \frac{\color{blue}{\sin x - \tan x}}{x} \]
    8. Simplified99.7%

      \[\leadsto 1 - \frac{\color{blue}{\sin x - \tan x}}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.9%

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

Alternative 5: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 0.03:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 0.03)
   (+ (+ (* -0.009642857142857142 (pow x 4.0)) (* x (* x 0.225))) -0.5)
   (/ (- x (sin x)) (- x (tan x)))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 0.03) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = (x - sin(x)) / (x - tan(x));
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 0.03d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + (x * (x * 0.225d0))) + (-0.5d0)
    else
        tmp = (x - sin(x)) / (x - tan(x))
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 0.03) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = (x - Math.sin(x)) / (x - Math.tan(x));
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 0.03:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5
	else:
		tmp = (x - math.sin(x)) / (x - math.tan(x))
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 0.03)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(x * Float64(x * 0.225))) + -0.5);
	else
		tmp = Float64(Float64(x - sin(x)) / Float64(x - tan(x)));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 0.03)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + (x * (x * 0.225))) + -0.5;
	else
		tmp = (x - sin(x)) / (x - tan(x));
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 0.03], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.03:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.029999999999999999

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) - 0.5} \]
    3. Step-by-step derivation
      1. sub-neg64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) + \left(-0.5\right)} \]
      2. fma-def64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot {x}^{2}\right)} + \left(-0.5\right) \]
      3. unpow264.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \color{blue}{\left(x \cdot x\right)}\right) + \left(-0.5\right) \]
      4. metadata-eval64.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + \color{blue}{-0.5} \]
    4. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + -0.5} \]
    5. Step-by-step derivation
      1. fma-udef64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot \left(x \cdot x\right)\right)} + -0.5 \]
      2. +-commutative64.1%

        \[\leadsto \color{blue}{\left(0.225 \cdot \left(x \cdot x\right) + -0.009642857142857142 \cdot {x}^{4}\right)} + -0.5 \]
      3. *-commutative64.1%

        \[\leadsto \left(\color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
      4. associate-*l*64.1%

        \[\leadsto \left(\color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
    6. Applied egg-rr64.1%

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

    if 0.029999999999999999 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.0%

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

Alternative 6: 98.9% accurate, 1.8× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{\frac{x}{x - \tan x}}}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 2.8)
   (+ (+ (* -0.009642857142857142 (pow x 4.0)) (* x (* x 0.225))) -0.5)
   (/ 1.0 (/ 1.0 (/ x (- x (tan x)))))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 2.8) {
		tmp = ((-0.009642857142857142 * pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = 1.0 / (1.0 / (x / (x - tan(x))));
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.8d0) then
        tmp = (((-0.009642857142857142d0) * (x ** 4.0d0)) + (x * (x * 0.225d0))) + (-0.5d0)
    else
        tmp = 1.0d0 / (1.0d0 / (x / (x - tan(x))))
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 2.8) {
		tmp = ((-0.009642857142857142 * Math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5;
	} else {
		tmp = 1.0 / (1.0 / (x / (x - Math.tan(x))));
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 2.8:
		tmp = ((-0.009642857142857142 * math.pow(x, 4.0)) + (x * (x * 0.225))) + -0.5
	else:
		tmp = 1.0 / (1.0 / (x / (x - math.tan(x))))
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 2.8)
		tmp = Float64(Float64(Float64(-0.009642857142857142 * (x ^ 4.0)) + Float64(x * Float64(x * 0.225))) + -0.5);
	else
		tmp = Float64(1.0 / Float64(1.0 / Float64(x / Float64(x - tan(x)))));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.8)
		tmp = ((-0.009642857142857142 * (x ^ 4.0)) + (x * (x * 0.225))) + -0.5;
	else
		tmp = 1.0 / (1.0 / (x / (x - tan(x))));
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 2.8], N[(N[(N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], N[(1.0 / N[(1.0 / N[(x / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8:\\
\;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.7999999999999998

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) - 0.5} \]
    3. Step-by-step derivation
      1. sub-neg64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot {x}^{2}\right) + \left(-0.5\right)} \]
      2. fma-def64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot {x}^{2}\right)} + \left(-0.5\right) \]
      3. unpow264.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \color{blue}{\left(x \cdot x\right)}\right) + \left(-0.5\right) \]
      4. metadata-eval64.1%

        \[\leadsto \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + \color{blue}{-0.5} \]
    4. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.225 \cdot \left(x \cdot x\right)\right) + -0.5} \]
    5. Step-by-step derivation
      1. fma-udef64.1%

        \[\leadsto \color{blue}{\left(-0.009642857142857142 \cdot {x}^{4} + 0.225 \cdot \left(x \cdot x\right)\right)} + -0.5 \]
      2. +-commutative64.1%

        \[\leadsto \color{blue}{\left(0.225 \cdot \left(x \cdot x\right) + -0.009642857142857142 \cdot {x}^{4}\right)} + -0.5 \]
      3. *-commutative64.1%

        \[\leadsto \left(\color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
      4. associate-*l*64.1%

        \[\leadsto \left(\color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.009642857142857142 \cdot {x}^{4}\right) + -0.5 \]
    6. Applied egg-rr64.1%

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

    if 2.7999999999999998 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
      2. inv-pow100.0%

        \[\leadsto \color{blue}{{\left(\frac{x - \tan x}{x - \sin x}\right)}^{-1}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{x - \tan x}{x - \sin x}\right)}^{-1}} \]
    4. Step-by-step derivation
      1. unpow-1100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \frac{1}{\frac{x - \tan x}{\color{blue}{x}}} \]
    7. Step-by-step derivation
      1. clear-num98.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
      2. inv-pow98.4%

        \[\leadsto \frac{1}{\color{blue}{{\left(\frac{x}{x - \tan x}\right)}^{-1}}} \]
    8. Applied egg-rr98.4%

      \[\leadsto \frac{1}{\color{blue}{{\left(\frac{x}{x - \tan x}\right)}^{-1}}} \]
    9. Step-by-step derivation
      1. unpow-198.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
    10. Simplified98.4%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;\left(-0.009642857142857142 \cdot {x}^{4} + x \cdot \left(x \cdot 0.225\right)\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{\frac{x}{x - \tan x}}}\\ \end{array} \]

Alternative 7: 98.8% accurate, 1.9× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 2.25:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{\frac{x}{x - \tan x}}}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 2.25)
   (+ (* x (* x 0.225)) -0.5)
   (/ 1.0 (/ 1.0 (/ x (- x (tan x)))))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 2.25) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = 1.0 / (1.0 / (x / (x - tan(x))));
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.25d0) then
        tmp = (x * (x * 0.225d0)) + (-0.5d0)
    else
        tmp = 1.0d0 / (1.0d0 / (x / (x - tan(x))))
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 2.25) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = 1.0 / (1.0 / (x / (x - Math.tan(x))));
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 2.25:
		tmp = (x * (x * 0.225)) + -0.5
	else:
		tmp = 1.0 / (1.0 / (x / (x - math.tan(x))))
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 2.25)
		tmp = Float64(Float64(x * Float64(x * 0.225)) + -0.5);
	else
		tmp = Float64(1.0 / Float64(1.0 / Float64(x / Float64(x - tan(x)))));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.25)
		tmp = (x * (x * 0.225)) + -0.5;
	else
		tmp = 1.0 / (1.0 / (x / (x - tan(x))));
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 2.25], N[(N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], N[(1.0 / N[(1.0 / N[(x / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.25:\\
\;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.25

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{0.225 \cdot {x}^{2} - 0.5} \]
    3. Step-by-step derivation
      1. fma-neg65.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, {x}^{2}, -0.5\right)} \]
      2. unpow265.2%

        \[\leadsto \mathsf{fma}\left(0.225, \color{blue}{x \cdot x}, -0.5\right) \]
      3. metadata-eval65.2%

        \[\leadsto \mathsf{fma}\left(0.225, x \cdot x, \color{blue}{-0.5}\right) \]
    4. Simplified65.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, x \cdot x, -0.5\right)} \]
    5. Step-by-step derivation
      1. fma-udef65.2%

        \[\leadsto \color{blue}{0.225 \cdot \left(x \cdot x\right) + -0.5} \]
      2. *-commutative65.2%

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.5 \]
      3. associate-*l*65.2%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.5 \]
    6. Applied egg-rr65.2%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right) + -0.5} \]

    if 2.25 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
      2. inv-pow100.0%

        \[\leadsto \color{blue}{{\left(\frac{x - \tan x}{x - \sin x}\right)}^{-1}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{x - \tan x}{x - \sin x}\right)}^{-1}} \]
    4. Step-by-step derivation
      1. unpow-1100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{x - \tan x}{x - \sin x}}} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \frac{1}{\frac{x - \tan x}{\color{blue}{x}}} \]
    7. Step-by-step derivation
      1. clear-num98.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
      2. inv-pow98.4%

        \[\leadsto \frac{1}{\color{blue}{{\left(\frac{x}{x - \tan x}\right)}^{-1}}} \]
    8. Applied egg-rr98.4%

      \[\leadsto \frac{1}{\color{blue}{{\left(\frac{x}{x - \tan x}\right)}^{-1}}} \]
    9. Step-by-step derivation
      1. unpow-198.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
    10. Simplified98.4%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{x}{x - \tan x}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.25:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{\frac{x}{x - \tan x}}}\\ \end{array} \]

Alternative 8: 98.8% accurate, 1.9× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 2.25:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x}\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (if (<= x 2.25) (+ (* x (* x 0.225)) -0.5) (/ x (- x (tan x)))))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 2.25) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = x / (x - tan(x));
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.25d0) then
        tmp = (x * (x * 0.225d0)) + (-0.5d0)
    else
        tmp = x / (x - tan(x))
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 2.25) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = x / (x - Math.tan(x));
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 2.25:
		tmp = (x * (x * 0.225)) + -0.5
	else:
		tmp = x / (x - math.tan(x))
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 2.25)
		tmp = Float64(Float64(x * Float64(x * 0.225)) + -0.5);
	else
		tmp = Float64(x / Float64(x - tan(x)));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.25)
		tmp = (x * (x * 0.225)) + -0.5;
	else
		tmp = x / (x - tan(x));
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 2.25], N[(N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], N[(x / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.25:\\
\;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.25

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{0.225 \cdot {x}^{2} - 0.5} \]
    3. Step-by-step derivation
      1. fma-neg65.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, {x}^{2}, -0.5\right)} \]
      2. unpow265.2%

        \[\leadsto \mathsf{fma}\left(0.225, \color{blue}{x \cdot x}, -0.5\right) \]
      3. metadata-eval65.2%

        \[\leadsto \mathsf{fma}\left(0.225, x \cdot x, \color{blue}{-0.5}\right) \]
    4. Simplified65.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, x \cdot x, -0.5\right)} \]
    5. Step-by-step derivation
      1. fma-udef65.2%

        \[\leadsto \color{blue}{0.225 \cdot \left(x \cdot x\right) + -0.5} \]
      2. *-commutative65.2%

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.5 \]
      3. associate-*l*65.2%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.5 \]
    6. Applied egg-rr65.2%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right) + -0.5} \]

    if 2.25 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Taylor expanded in x around inf 98.4%

      \[\leadsto \frac{\color{blue}{x}}{x - \tan x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.25:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x}\\ \end{array} \]

Alternative 9: 98.8% accurate, 22.8× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 2.5:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 (if (<= x 2.5) (+ (* x (* x 0.225)) -0.5) 1.0))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 2.5) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.5d0) then
        tmp = (x * (x * 0.225d0)) + (-0.5d0)
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 2.5) {
		tmp = (x * (x * 0.225)) + -0.5;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 2.5:
		tmp = (x * (x * 0.225)) + -0.5
	else:
		tmp = 1.0
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 2.5)
		tmp = Float64(Float64(x * Float64(x * 0.225)) + -0.5);
	else
		tmp = 1.0;
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.5)
		tmp = (x * (x * 0.225)) + -0.5;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 2.5], N[(N[(x * N[(x * 0.225), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], 1.0]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.5

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{0.225 \cdot {x}^{2} - 0.5} \]
    3. Step-by-step derivation
      1. fma-neg65.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, {x}^{2}, -0.5\right)} \]
      2. unpow265.2%

        \[\leadsto \mathsf{fma}\left(0.225, \color{blue}{x \cdot x}, -0.5\right) \]
      3. metadata-eval65.2%

        \[\leadsto \mathsf{fma}\left(0.225, x \cdot x, \color{blue}{-0.5}\right) \]
    4. Simplified65.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.225, x \cdot x, -0.5\right)} \]
    5. Step-by-step derivation
      1. fma-udef65.2%

        \[\leadsto \color{blue}{0.225 \cdot \left(x \cdot x\right) + -0.5} \]
      2. *-commutative65.2%

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 0.225} + -0.5 \]
      3. associate-*l*65.2%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right)} + -0.5 \]
    6. Applied egg-rr65.2%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot 0.225\right) + -0.5} \]

    if 2.5 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Taylor expanded in x around inf 98.4%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.5:\\ \;\;\;\;x \cdot \left(x \cdot 0.225\right) + -0.5\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 10: 98.5% accurate, 67.6× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 1.55:\\ \;\;\;\;-0.5\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 (if (<= x 1.55) -0.5 1.0))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 1.55) {
		tmp = -0.5;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 1.55d0) then
        tmp = -0.5d0
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 1.55) {
		tmp = -0.5;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 1.55:
		tmp = -0.5
	else:
		tmp = 1.0
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 1.55)
		tmp = -0.5;
	else
		tmp = 1.0;
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 1.55)
		tmp = -0.5;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 1.55], -0.5, 1.0]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55:\\
\;\;\;\;-0.5\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.55000000000000004

    1. Initial program 37.8%

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

      \[\leadsto \color{blue}{-0.5} \]

    if 1.55000000000000004 < x

    1. Initial program 100.0%

      \[\frac{x - \sin x}{x - \tan x} \]
    2. Taylor expanded in x around inf 98.4%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.55:\\ \;\;\;\;-0.5\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 11: 50.3% accurate, 207.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ -0.5 \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 -0.5)
x = abs(x);
double code(double x) {
	return -0.5;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    code = -0.5d0
end function
x = Math.abs(x);
public static double code(double x) {
	return -0.5;
}
x = abs(x)
def code(x):
	return -0.5
x = abs(x)
function code(x)
	return -0.5
end
x = abs(x)
function tmp = code(x)
	tmp = -0.5;
end
NOTE: x should be positive before calling this function
code[x_] := -0.5
\begin{array}{l}
x = |x|\\
\\
-0.5
\end{array}
Derivation
  1. Initial program 56.7%

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

    \[\leadsto \color{blue}{-0.5} \]
  3. Final simplification44.5%

    \[\leadsto -0.5 \]

Reproduce

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