Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5

Percentage Accurate: 44.6% → 57.9%
Time: 14.3s
Alternatives: 10
Speedup: 211.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y \cdot 2}\\ \frac{\tan t\_0}{\sin t\_0} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (* y 2.0)))) (/ (tan t_0) (sin t_0))))
double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	return tan(t_0) / sin(t_0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = x / (y * 2.0d0)
    code = tan(t_0) / sin(t_0)
end function
public static double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	return Math.tan(t_0) / Math.sin(t_0);
}
def code(x, y):
	t_0 = x / (y * 2.0)
	return math.tan(t_0) / math.sin(t_0)
function code(x, y)
	t_0 = Float64(x / Float64(y * 2.0))
	return Float64(tan(t_0) / sin(t_0))
end
function tmp = code(x, y)
	t_0 = x / (y * 2.0);
	tmp = tan(t_0) / sin(t_0);
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Tan[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
\frac{\tan t\_0}{\sin t\_0}
\end{array}
\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 10 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: 44.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y \cdot 2}\\ \frac{\tan t\_0}{\sin t\_0} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (* y 2.0)))) (/ (tan t_0) (sin t_0))))
double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	return tan(t_0) / sin(t_0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = x / (y * 2.0d0)
    code = tan(t_0) / sin(t_0)
end function
public static double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	return Math.tan(t_0) / Math.sin(t_0);
}
def code(x, y):
	t_0 = x / (y * 2.0)
	return math.tan(t_0) / math.sin(t_0)
function code(x, y)
	t_0 = Float64(x / Float64(y * 2.0))
	return Float64(tan(t_0) / sin(t_0))
end
function tmp = code(x, y)
	t_0 = x / (y * 2.0);
	tmp = tan(t_0) / sin(t_0);
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Tan[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
\frac{\tan t\_0}{\sin t\_0}
\end{array}
\end{array}

Alternative 1: 57.9% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} t_0 := \sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x\_m}{y\_m}}}\\ \mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 4 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{\cos \left({\left(t\_0 \cdot {t\_0}^{2}\right)}^{3}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (let* ((t_0 (cbrt (cbrt (* 0.5 (/ x_m y_m))))))
   (if (<= (/ x_m (* y_m 2.0)) 4e+33)
     (/ 1.0 (cos (pow (* t_0 (pow t_0 2.0)) 3.0)))
     (/ -0.5 (sqrt (cbrt 0.015625))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double t_0 = cbrt(cbrt((0.5 * (x_m / y_m))));
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 4e+33) {
		tmp = 1.0 / cos(pow((t_0 * pow(t_0, 2.0)), 3.0));
	} else {
		tmp = -0.5 / sqrt(cbrt(0.015625));
	}
	return tmp;
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	double t_0 = Math.cbrt(Math.cbrt((0.5 * (x_m / y_m))));
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 4e+33) {
		tmp = 1.0 / Math.cos(Math.pow((t_0 * Math.pow(t_0, 2.0)), 3.0));
	} else {
		tmp = -0.5 / Math.sqrt(Math.cbrt(0.015625));
	}
	return tmp;
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	t_0 = cbrt(cbrt(Float64(0.5 * Float64(x_m / y_m))))
	tmp = 0.0
	if (Float64(x_m / Float64(y_m * 2.0)) <= 4e+33)
		tmp = Float64(1.0 / cos((Float64(t_0 * (t_0 ^ 2.0)) ^ 3.0)));
	else
		tmp = Float64(-0.5 / sqrt(cbrt(0.015625)));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := Block[{t$95$0 = N[Power[N[Power[N[(0.5 * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(x$95$m / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], 4e+33], N[(1.0 / N[Cos[N[Power[N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[Sqrt[N[Power[0.015625, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x\_m}{y\_m}}}\\
\mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 4 \cdot 10^{+33}:\\
\;\;\;\;\frac{1}{\cos \left({\left(t\_0 \cdot {t\_0}^{2}\right)}^{3}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 3.9999999999999998e33

    1. Initial program 52.9%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Step-by-step derivation
      1. remove-double-neg52.9%

        \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
      2. distribute-frac-neg52.9%

        \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      3. tan-neg52.9%

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg252.9%

        \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      5. distribute-lft-neg-out52.9%

        \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      6. distribute-frac-neg252.9%

        \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      7. distribute-lft-neg-out52.9%

        \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      8. distribute-frac-neg252.9%

        \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      9. distribute-frac-neg52.9%

        \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      10. neg-mul-152.9%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative52.9%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      12. associate-/l*52.7%

        \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      13. *-commutative52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      14. associate-/r*52.7%

        \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      15. metadata-eval52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      16. sin-neg52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
      17. distribute-frac-neg52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
    3. Simplified52.9%

      \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 68.2%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
    6. Step-by-step derivation
      1. associate-*r/68.2%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
      2. *-commutative68.2%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
      3. associate-*r/68.3%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
    7. Simplified68.3%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
    8. Step-by-step derivation
      1. add-cube-cbrt68.1%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\left(\sqrt[3]{x \cdot \frac{-0.5}{y}} \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right) \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}} \]
      2. pow368.3%

        \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    9. Applied egg-rr68.3%

      \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    10. Applied egg-rr68.6%

      \[\leadsto \frac{1}{\cos \left({\color{blue}{\left({\left(\sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x}{y}}}\right)}^{2} \cdot \sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x}{y}}}\right)}}^{3}\right)} \]

    if 3.9999999999999998e33 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 6.4%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube2.8%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left(\sqrt[3]{\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}}\right)}} \]
      2. pow1/32.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left(\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}\right)}^{0.3333333333333333}\right)}} \]
      3. pow31.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\color{blue}{\left({\left(\frac{x}{y \cdot 2}\right)}^{3}\right)}}^{0.3333333333333333}\right)} \]
      4. *-un-lft-identity1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{\color{blue}{1 \cdot x}}{y \cdot 2}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      5. *-commutative1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{1 \cdot x}{\color{blue}{2 \cdot y}}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      6. times-frac1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{y}\right)}}^{3}\right)}^{0.3333333333333333}\right)} \]
      7. metadata-eval1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\color{blue}{0.5} \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
    4. Applied egg-rr1.4%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left({\left(0.5 \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)}} \]
    5. Taylor expanded in y around -inf 9.3%

      \[\leadsto \color{blue}{\frac{-0.5}{\sqrt[3]{-0.125}}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125}} \cdot \sqrt{\sqrt[3]{-0.125}}}} \]
      2. sqrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125} \cdot \sqrt[3]{-0.125}}}} \]
      3. cbrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\color{blue}{\sqrt[3]{-0.125 \cdot -0.125}}}} \]
      4. metadata-eval13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\sqrt[3]{\color{blue}{0.015625}}}} \]
    7. Applied egg-rr13.5%

      \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{0.015625}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y \cdot 2} \leq 4 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{\cos \left({\left(\sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x}{y}}} \cdot {\left(\sqrt[3]{\sqrt[3]{0.5 \cdot \frac{x}{y}}}\right)}^{2}\right)}^{3}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 57.9% accurate, 0.7× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 4 \cdot 10^{+37}:\\ \;\;\;\;\frac{1}{\cos \left(e^{\log \left(0.5 \cdot \frac{x\_m}{y\_m}\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (if (<= (/ x_m (* y_m 2.0)) 4e+37)
   (/ 1.0 (cos (exp (log (* 0.5 (/ x_m y_m))))))
   (/ -0.5 (sqrt (cbrt 0.015625)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 4e+37) {
		tmp = 1.0 / cos(exp(log((0.5 * (x_m / y_m)))));
	} else {
		tmp = -0.5 / sqrt(cbrt(0.015625));
	}
	return tmp;
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 4e+37) {
		tmp = 1.0 / Math.cos(Math.exp(Math.log((0.5 * (x_m / y_m)))));
	} else {
		tmp = -0.5 / Math.sqrt(Math.cbrt(0.015625));
	}
	return tmp;
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	tmp = 0.0
	if (Float64(x_m / Float64(y_m * 2.0)) <= 4e+37)
		tmp = Float64(1.0 / cos(exp(log(Float64(0.5 * Float64(x_m / y_m))))));
	else
		tmp = Float64(-0.5 / sqrt(cbrt(0.015625)));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := If[LessEqual[N[(x$95$m / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], 4e+37], N[(1.0 / N[Cos[N[Exp[N[Log[N[(0.5 * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[Sqrt[N[Power[0.015625, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 4 \cdot 10^{+37}:\\
\;\;\;\;\frac{1}{\cos \left(e^{\log \left(0.5 \cdot \frac{x\_m}{y\_m}\right)}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 3.99999999999999982e37

    1. Initial program 52.6%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Step-by-step derivation
      1. remove-double-neg52.6%

        \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
      2. distribute-frac-neg52.6%

        \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      3. tan-neg52.6%

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg252.6%

        \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      5. distribute-lft-neg-out52.6%

        \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      6. distribute-frac-neg252.6%

        \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      7. distribute-lft-neg-out52.6%

        \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      8. distribute-frac-neg252.6%

        \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      9. distribute-frac-neg52.6%

        \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      10. neg-mul-152.6%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative52.6%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      12. associate-/l*52.5%

        \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      13. *-commutative52.5%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      14. associate-/r*52.5%

        \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      15. metadata-eval52.5%

        \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      16. sin-neg52.5%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
      17. distribute-frac-neg52.5%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
    3. Simplified52.7%

      \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.9%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
    6. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
      2. *-commutative67.9%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
      3. associate-*r/67.9%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
    7. Simplified67.9%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
    8. Step-by-step derivation
      1. add-cube-cbrt67.8%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\left(\sqrt[3]{x \cdot \frac{-0.5}{y}} \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right) \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}} \]
      2. pow368.0%

        \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    9. Applied egg-rr68.0%

      \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    10. Step-by-step derivation
      1. rem-cube-cbrt67.9%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
      2. add-sqr-sqrt43.0%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{x \cdot \frac{-0.5}{y}} \cdot \sqrt{x \cdot \frac{-0.5}{y}}\right)}} \]
      3. sqrt-unprod66.8%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{\left(x \cdot \frac{-0.5}{y}\right) \cdot \left(x \cdot \frac{-0.5}{y}\right)}\right)}} \]
      4. swap-sqr56.5%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(\frac{-0.5}{y} \cdot \frac{-0.5}{y}\right)}}\right)} \]
      5. frac-times56.6%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \color{blue}{\frac{-0.5 \cdot -0.5}{y \cdot y}}}\right)} \]
      6. metadata-eval56.6%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \frac{\color{blue}{0.25}}{y \cdot y}}\right)} \]
      7. unpow256.6%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \frac{0.25}{\color{blue}{{y}^{2}}}}\right)} \]
      8. add-sqr-sqrt56.5%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{0.25}{{y}^{2}}} \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}}\right)} \]
      9. swap-sqr62.7%

        \[\leadsto \frac{1}{\cos \left(\sqrt{\color{blue}{\left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right) \cdot \left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}}\right)} \]
      10. sqrt-unprod47.6%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{x \cdot \sqrt{\frac{0.25}{{y}^{2}}}} \cdot \sqrt{x \cdot \sqrt{\frac{0.25}{{y}^{2}}}}\right)}} \]
      11. add-sqr-sqrt63.6%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}} \]
      12. sqrt-div64.1%

        \[\leadsto \frac{1}{\cos \left(x \cdot \color{blue}{\frac{\sqrt{0.25}}{\sqrt{{y}^{2}}}}\right)} \]
      13. metadata-eval64.1%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\color{blue}{0.5}}{\sqrt{{y}^{2}}}\right)} \]
      14. metadata-eval64.1%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\color{blue}{\frac{1}{2}}}{\sqrt{{y}^{2}}}\right)} \]
      15. sqrt-pow167.9%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{\color{blue}{{y}^{\left(\frac{2}{2}\right)}}}\right)} \]
      16. metadata-eval67.9%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{{y}^{\color{blue}{1}}}\right)} \]
      17. pow167.9%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{\color{blue}{y}}\right)} \]
      18. associate-/r*67.9%

        \[\leadsto \frac{1}{\cos \left(x \cdot \color{blue}{\frac{1}{2 \cdot y}}\right)} \]
      19. *-commutative67.9%

        \[\leadsto \frac{1}{\cos \left(x \cdot \frac{1}{\color{blue}{y \cdot 2}}\right)} \]
      20. add-exp-log40.2%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(e^{\log \left(x \cdot \frac{1}{y \cdot 2}\right)}\right)}} \]
      21. div-inv40.2%

        \[\leadsto \frac{1}{\cos \left(e^{\log \color{blue}{\left(\frac{x}{y \cdot 2}\right)}}\right)} \]
    11. Applied egg-rr40.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(e^{\log \left(0.5 \cdot \frac{x}{y}\right)}\right)}} \]

    if 3.99999999999999982e37 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 6.5%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube2.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left(\sqrt[3]{\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}}\right)}} \]
      2. pow1/32.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left(\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}\right)}^{0.3333333333333333}\right)}} \]
      3. pow31.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\color{blue}{\left({\left(\frac{x}{y \cdot 2}\right)}^{3}\right)}}^{0.3333333333333333}\right)} \]
      4. *-un-lft-identity1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{\color{blue}{1 \cdot x}}{y \cdot 2}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      5. *-commutative1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{1 \cdot x}{\color{blue}{2 \cdot y}}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      6. times-frac1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{y}\right)}}^{3}\right)}^{0.3333333333333333}\right)} \]
      7. metadata-eval1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\color{blue}{0.5} \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
    4. Applied egg-rr1.4%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left({\left(0.5 \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)}} \]
    5. Taylor expanded in y around -inf 9.5%

      \[\leadsto \color{blue}{\frac{-0.5}{\sqrt[3]{-0.125}}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125}} \cdot \sqrt{\sqrt[3]{-0.125}}}} \]
      2. sqrt-unprod13.2%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125} \cdot \sqrt[3]{-0.125}}}} \]
      3. cbrt-unprod13.2%

        \[\leadsto \frac{-0.5}{\sqrt{\color{blue}{\sqrt[3]{-0.125 \cdot -0.125}}}} \]
      4. metadata-eval13.2%

        \[\leadsto \frac{-0.5}{\sqrt{\sqrt[3]{\color{blue}{0.015625}}}} \]
    7. Applied egg-rr13.2%

      \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{0.015625}}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 58.0% accurate, 0.7× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 2.2 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x\_m}{y\_m} \cdot -0.5\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (if (<= (/ x_m (* y_m 2.0)) 2.2e+33)
   (log1p (expm1 (/ 1.0 (cos (* (/ x_m y_m) -0.5)))))
   (/ -0.5 (sqrt (cbrt 0.015625)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 2.2e+33) {
		tmp = log1p(expm1((1.0 / cos(((x_m / y_m) * -0.5)))));
	} else {
		tmp = -0.5 / sqrt(cbrt(0.015625));
	}
	return tmp;
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 2.2e+33) {
		tmp = Math.log1p(Math.expm1((1.0 / Math.cos(((x_m / y_m) * -0.5)))));
	} else {
		tmp = -0.5 / Math.sqrt(Math.cbrt(0.015625));
	}
	return tmp;
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	tmp = 0.0
	if (Float64(x_m / Float64(y_m * 2.0)) <= 2.2e+33)
		tmp = log1p(expm1(Float64(1.0 / cos(Float64(Float64(x_m / y_m) * -0.5)))));
	else
		tmp = Float64(-0.5 / sqrt(cbrt(0.015625)));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := If[LessEqual[N[(x$95$m / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], 2.2e+33], N[Log[1 + N[(Exp[N[(1.0 / N[Cos[N[(N[(x$95$m / y$95$m), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(-0.5 / N[Sqrt[N[Power[0.015625, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 2.2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x\_m}{y\_m} \cdot -0.5\right)}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 2.19999999999999994e33

    1. Initial program 52.9%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Step-by-step derivation
      1. remove-double-neg52.9%

        \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
      2. distribute-frac-neg52.9%

        \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      3. tan-neg52.9%

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg252.9%

        \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      5. distribute-lft-neg-out52.9%

        \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      6. distribute-frac-neg252.9%

        \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
      7. distribute-lft-neg-out52.9%

        \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      8. distribute-frac-neg252.9%

        \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      9. distribute-frac-neg52.9%

        \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      10. neg-mul-152.9%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative52.9%

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      12. associate-/l*52.7%

        \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      13. *-commutative52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      14. associate-/r*52.7%

        \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      15. metadata-eval52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      16. sin-neg52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
      17. distribute-frac-neg52.7%

        \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
    3. Simplified52.9%

      \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 68.2%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
    6. Step-by-step derivation
      1. associate-*r/68.2%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
      2. *-commutative68.2%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
      3. associate-*r/68.3%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
    7. Simplified68.3%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
    8. Applied egg-rr68.2%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}\right)\right)} \]

    if 2.19999999999999994e33 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 6.4%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube2.8%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left(\sqrt[3]{\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}}\right)}} \]
      2. pow1/32.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left(\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}\right)}^{0.3333333333333333}\right)}} \]
      3. pow31.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\color{blue}{\left({\left(\frac{x}{y \cdot 2}\right)}^{3}\right)}}^{0.3333333333333333}\right)} \]
      4. *-un-lft-identity1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{\color{blue}{1 \cdot x}}{y \cdot 2}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      5. *-commutative1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{1 \cdot x}{\color{blue}{2 \cdot y}}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      6. times-frac1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{y}\right)}}^{3}\right)}^{0.3333333333333333}\right)} \]
      7. metadata-eval1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\color{blue}{0.5} \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
    4. Applied egg-rr1.4%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left({\left(0.5 \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)}} \]
    5. Taylor expanded in y around -inf 9.3%

      \[\leadsto \color{blue}{\frac{-0.5}{\sqrt[3]{-0.125}}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125}} \cdot \sqrt{\sqrt[3]{-0.125}}}} \]
      2. sqrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125} \cdot \sqrt[3]{-0.125}}}} \]
      3. cbrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\color{blue}{\sqrt[3]{-0.125 \cdot -0.125}}}} \]
      4. metadata-eval13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\sqrt[3]{\color{blue}{0.015625}}}} \]
    7. Applied egg-rr13.5%

      \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{0.015625}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y \cdot 2} \leq 2.2 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x}{y} \cdot -0.5\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 56.3% accurate, 0.7× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \frac{1}{\cos \left(\frac{x\_m \cdot {\left(\sqrt[3]{-0.5}\right)}^{3}}{y\_m}\right)} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (/ 1.0 (cos (/ (* x_m (pow (cbrt -0.5) 3.0)) y_m))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos(((x_m * pow(cbrt(-0.5), 3.0)) / y_m));
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return 1.0 / Math.cos(((x_m * Math.pow(Math.cbrt(-0.5), 3.0)) / y_m));
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return Float64(1.0 / cos(Float64(Float64(x_m * (cbrt(-0.5) ^ 3.0)) / y_m)))
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := N[(1.0 / N[Cos[N[(N[(x$95$m * N[Power[N[Power[-0.5, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\frac{1}{\cos \left(\frac{x\_m \cdot {\left(\sqrt[3]{-0.5}\right)}^{3}}{y\_m}\right)}
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Step-by-step derivation
    1. remove-double-neg44.3%

      \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
    2. distribute-frac-neg44.3%

      \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    3. tan-neg44.3%

      \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. distribute-frac-neg244.3%

      \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. distribute-lft-neg-out44.3%

      \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. distribute-frac-neg244.3%

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    7. distribute-lft-neg-out44.3%

      \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    8. distribute-frac-neg244.3%

      \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    9. distribute-frac-neg44.3%

      \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    10. neg-mul-144.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    11. *-commutative44.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    12. associate-/l*44.5%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    14. associate-/r*44.5%

      \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    15. metadata-eval44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
    17. distribute-frac-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
  3. Simplified44.7%

    \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 56.8%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
  6. Step-by-step derivation
    1. associate-*r/56.8%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
    2. *-commutative56.8%

      \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
    3. associate-*r/57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
  7. Simplified57.2%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
  8. Step-by-step derivation
    1. add-cube-cbrt57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\left(\sqrt[3]{x \cdot \frac{-0.5}{y}} \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right) \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}} \]
    2. pow357.4%

      \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
  9. Applied egg-rr57.4%

    \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
  10. Taylor expanded in x around inf 57.9%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(\frac{x \cdot {\left(\sqrt[3]{-0.5}\right)}^{3}}{y}\right)}} \]
  11. Add Preprocessing

Alternative 5: 58.0% accurate, 1.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 2.2 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{\cos \left(0.5 \cdot \frac{x\_m}{y\_m}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (if (<= (/ x_m (* y_m 2.0)) 2.2e+33)
   (/ 1.0 (cos (* 0.5 (/ x_m y_m))))
   (/ -0.5 (sqrt (cbrt 0.015625)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 2.2e+33) {
		tmp = 1.0 / cos((0.5 * (x_m / y_m)));
	} else {
		tmp = -0.5 / sqrt(cbrt(0.015625));
	}
	return tmp;
}
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	double tmp;
	if ((x_m / (y_m * 2.0)) <= 2.2e+33) {
		tmp = 1.0 / Math.cos((0.5 * (x_m / y_m)));
	} else {
		tmp = -0.5 / Math.sqrt(Math.cbrt(0.015625));
	}
	return tmp;
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	tmp = 0.0
	if (Float64(x_m / Float64(y_m * 2.0)) <= 2.2e+33)
		tmp = Float64(1.0 / cos(Float64(0.5 * Float64(x_m / y_m))));
	else
		tmp = Float64(-0.5 / sqrt(cbrt(0.015625)));
	end
	return tmp
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := If[LessEqual[N[(x$95$m / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], 2.2e+33], N[(1.0 / N[Cos[N[(0.5 * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 / N[Sqrt[N[Power[0.015625, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 2.2 \cdot 10^{+33}:\\
\;\;\;\;\frac{1}{\cos \left(0.5 \cdot \frac{x\_m}{y\_m}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\sqrt{\sqrt[3]{0.015625}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 y #s(literal 2 binary64))) < 2.19999999999999994e33

    1. Initial program 52.9%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.2%

      \[\leadsto \color{blue}{\frac{1}{\cos \left(0.5 \cdot \frac{x}{y}\right)}} \]

    if 2.19999999999999994e33 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 6.4%

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube2.8%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left(\sqrt[3]{\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}}\right)}} \]
      2. pow1/32.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left(\left(\frac{x}{y \cdot 2} \cdot \frac{x}{y \cdot 2}\right) \cdot \frac{x}{y \cdot 2}\right)}^{0.3333333333333333}\right)}} \]
      3. pow31.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\color{blue}{\left({\left(\frac{x}{y \cdot 2}\right)}^{3}\right)}}^{0.3333333333333333}\right)} \]
      4. *-un-lft-identity1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{\color{blue}{1 \cdot x}}{y \cdot 2}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      5. *-commutative1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\frac{1 \cdot x}{\color{blue}{2 \cdot y}}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
      6. times-frac1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{y}\right)}}^{3}\right)}^{0.3333333333333333}\right)} \]
      7. metadata-eval1.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left({\left({\left(\color{blue}{0.5} \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)} \]
    4. Applied egg-rr1.4%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \color{blue}{\left({\left({\left(0.5 \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)}} \]
    5. Taylor expanded in y around -inf 9.3%

      \[\leadsto \color{blue}{\frac{-0.5}{\sqrt[3]{-0.125}}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125}} \cdot \sqrt{\sqrt[3]{-0.125}}}} \]
      2. sqrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{-0.125} \cdot \sqrt[3]{-0.125}}}} \]
      3. cbrt-unprod13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\color{blue}{\sqrt[3]{-0.125 \cdot -0.125}}}} \]
      4. metadata-eval13.5%

        \[\leadsto \frac{-0.5}{\sqrt{\sqrt[3]{\color{blue}{0.015625}}}} \]
    7. Applied egg-rr13.5%

      \[\leadsto \frac{-0.5}{\color{blue}{\sqrt{\sqrt[3]{0.015625}}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 56.5% accurate, 1.9× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \frac{1}{\cos \left(\frac{1}{y\_m \cdot \frac{2}{x\_m}}\right)} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (/ 1.0 (cos (/ 1.0 (* y_m (/ 2.0 x_m))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos((1.0 / (y_m * (2.0 / x_m))));
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    code = 1.0d0 / cos((1.0d0 / (y_m * (2.0d0 / x_m))))
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return 1.0 / Math.cos((1.0 / (y_m * (2.0 / x_m))));
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return 1.0 / math.cos((1.0 / (y_m * (2.0 / x_m))))
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return Float64(1.0 / cos(Float64(1.0 / Float64(y_m * Float64(2.0 / x_m)))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0 / cos((1.0 / (y_m * (2.0 / x_m))));
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := N[(1.0 / N[Cos[N[(1.0 / N[(y$95$m * N[(2.0 / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\frac{1}{\cos \left(\frac{1}{y\_m \cdot \frac{2}{x\_m}}\right)}
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Step-by-step derivation
    1. remove-double-neg44.3%

      \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
    2. distribute-frac-neg44.3%

      \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    3. tan-neg44.3%

      \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. distribute-frac-neg244.3%

      \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. distribute-lft-neg-out44.3%

      \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. distribute-frac-neg244.3%

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    7. distribute-lft-neg-out44.3%

      \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    8. distribute-frac-neg244.3%

      \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    9. distribute-frac-neg44.3%

      \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    10. neg-mul-144.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    11. *-commutative44.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    12. associate-/l*44.5%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    14. associate-/r*44.5%

      \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    15. metadata-eval44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
    17. distribute-frac-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
  3. Simplified44.7%

    \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 56.8%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
  6. Step-by-step derivation
    1. associate-*r/56.8%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
    2. *-commutative56.8%

      \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
    3. associate-*r/57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
  7. Simplified57.2%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
  8. Step-by-step derivation
    1. add-cube-cbrt57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\left(\sqrt[3]{x \cdot \frac{-0.5}{y}} \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right) \cdot \sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}} \]
    2. pow357.4%

      \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
  9. Applied egg-rr57.4%

    \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
  10. Step-by-step derivation
    1. rem-cube-cbrt57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
    2. add-sqr-sqrt35.3%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{x \cdot \frac{-0.5}{y}} \cdot \sqrt{x \cdot \frac{-0.5}{y}}\right)}} \]
    3. sqrt-unprod55.3%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{\left(x \cdot \frac{-0.5}{y}\right) \cdot \left(x \cdot \frac{-0.5}{y}\right)}\right)}} \]
    4. swap-sqr46.5%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot \left(\frac{-0.5}{y} \cdot \frac{-0.5}{y}\right)}}\right)} \]
    5. frac-times46.6%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \color{blue}{\frac{-0.5 \cdot -0.5}{y \cdot y}}}\right)} \]
    6. metadata-eval46.6%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \frac{\color{blue}{0.25}}{y \cdot y}}\right)} \]
    7. unpow246.6%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \frac{0.25}{\color{blue}{{y}^{2}}}}\right)} \]
    8. add-sqr-sqrt46.5%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\left(x \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{0.25}{{y}^{2}}} \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}}\right)} \]
    9. swap-sqr51.7%

      \[\leadsto \frac{1}{\cos \left(\sqrt{\color{blue}{\left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right) \cdot \left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}}\right)} \]
    10. sqrt-unprod39.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt{x \cdot \sqrt{\frac{0.25}{{y}^{2}}}} \cdot \sqrt{x \cdot \sqrt{\frac{0.25}{{y}^{2}}}}\right)}} \]
    11. add-sqr-sqrt52.9%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \sqrt{\frac{0.25}{{y}^{2}}}\right)}} \]
    12. sqrt-div53.3%

      \[\leadsto \frac{1}{\cos \left(x \cdot \color{blue}{\frac{\sqrt{0.25}}{\sqrt{{y}^{2}}}}\right)} \]
    13. metadata-eval53.3%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\color{blue}{0.5}}{\sqrt{{y}^{2}}}\right)} \]
    14. metadata-eval53.3%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\color{blue}{\frac{1}{2}}}{\sqrt{{y}^{2}}}\right)} \]
    15. sqrt-pow157.2%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{\color{blue}{{y}^{\left(\frac{2}{2}\right)}}}\right)} \]
    16. metadata-eval57.2%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{{y}^{\color{blue}{1}}}\right)} \]
    17. pow157.2%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{\frac{1}{2}}{\color{blue}{y}}\right)} \]
    18. associate-/r*57.2%

      \[\leadsto \frac{1}{\cos \left(x \cdot \color{blue}{\frac{1}{2 \cdot y}}\right)} \]
    19. *-commutative57.2%

      \[\leadsto \frac{1}{\cos \left(x \cdot \frac{1}{\color{blue}{y \cdot 2}}\right)} \]
    20. div-inv56.8%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{x}{y \cdot 2}\right)}} \]
    21. clear-num56.9%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{1}{\frac{y \cdot 2}{x}}\right)}} \]
    22. associate-/l*57.2%

      \[\leadsto \frac{1}{\cos \left(\frac{1}{\color{blue}{y \cdot \frac{2}{x}}}\right)} \]
  11. Applied egg-rr57.2%

    \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{1}{y \cdot \frac{2}{x}}\right)}} \]
  12. Add Preprocessing

Alternative 7: 56.5% accurate, 2.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \frac{1}{\cos \left(x\_m \cdot \frac{-0.5}{y\_m}\right)} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m) :precision binary64 (/ 1.0 (cos (* x_m (/ -0.5 y_m)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos((x_m * (-0.5 / y_m)));
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    code = 1.0d0 / cos((x_m * ((-0.5d0) / y_m)))
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return 1.0 / Math.cos((x_m * (-0.5 / y_m)));
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return 1.0 / math.cos((x_m * (-0.5 / y_m)))
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return Float64(1.0 / cos(Float64(x_m * Float64(-0.5 / y_m))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0 / cos((x_m * (-0.5 / y_m)));
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := N[(1.0 / N[Cos[N[(x$95$m * N[(-0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\frac{1}{\cos \left(x\_m \cdot \frac{-0.5}{y\_m}\right)}
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Step-by-step derivation
    1. remove-double-neg44.3%

      \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
    2. distribute-frac-neg44.3%

      \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    3. tan-neg44.3%

      \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. distribute-frac-neg244.3%

      \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. distribute-lft-neg-out44.3%

      \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. distribute-frac-neg244.3%

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    7. distribute-lft-neg-out44.3%

      \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    8. distribute-frac-neg244.3%

      \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    9. distribute-frac-neg44.3%

      \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    10. neg-mul-144.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    11. *-commutative44.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    12. associate-/l*44.5%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    14. associate-/r*44.5%

      \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    15. metadata-eval44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
    17. distribute-frac-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
  3. Simplified44.7%

    \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 56.8%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)}} \]
  6. Step-by-step derivation
    1. associate-*r/56.8%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{-0.5 \cdot x}{y}\right)}} \]
    2. *-commutative56.8%

      \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot -0.5}}{y}\right)} \]
    3. associate-*r/57.2%

      \[\leadsto \frac{1}{\cos \color{blue}{\left(x \cdot \frac{-0.5}{y}\right)}} \]
  7. Simplified57.2%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
  8. Add Preprocessing

Alternative 8: 56.5% accurate, 2.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \frac{1}{\cos \left(0.5 \cdot \frac{x\_m}{y\_m}\right)} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m) :precision binary64 (/ 1.0 (cos (* 0.5 (/ x_m y_m)))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos((0.5 * (x_m / y_m)));
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    code = 1.0d0 / cos((0.5d0 * (x_m / y_m)))
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return 1.0 / Math.cos((0.5 * (x_m / y_m)));
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return 1.0 / math.cos((0.5 * (x_m / y_m)))
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return Float64(1.0 / cos(Float64(0.5 * Float64(x_m / y_m))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0 / cos((0.5 * (x_m / y_m)));
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := N[(1.0 / N[Cos[N[(0.5 * N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\frac{1}{\cos \left(0.5 \cdot \frac{x\_m}{y\_m}\right)}
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 56.8%

    \[\leadsto \color{blue}{\frac{1}{\cos \left(0.5 \cdot \frac{x}{y}\right)}} \]
  4. Add Preprocessing

Alternative 9: 56.3% accurate, 211.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ 1 \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m) :precision binary64 1.0)
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    code = 1.0d0
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return 1.0;
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return 1.0
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return 1.0
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0;
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := 1.0
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
1
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Step-by-step derivation
    1. remove-double-neg44.3%

      \[\leadsto \color{blue}{-\left(-\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)} \]
    2. distribute-frac-neg44.3%

      \[\leadsto -\color{blue}{\frac{-\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    3. tan-neg44.3%

      \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. distribute-frac-neg244.3%

      \[\leadsto -\frac{\tan \color{blue}{\left(\frac{x}{-y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. distribute-lft-neg-out44.3%

      \[\leadsto -\frac{\tan \left(\frac{x}{\color{blue}{\left(-y\right) \cdot 2}}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. distribute-frac-neg244.3%

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{\left(-y\right) \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)}} \]
    7. distribute-lft-neg-out44.3%

      \[\leadsto \frac{\tan \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    8. distribute-frac-neg244.3%

      \[\leadsto \frac{\tan \color{blue}{\left(-\frac{x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    9. distribute-frac-neg44.3%

      \[\leadsto \frac{\tan \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    10. neg-mul-144.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    11. *-commutative44.3%

      \[\leadsto \frac{\tan \left(\frac{\color{blue}{x \cdot -1}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    12. associate-/l*44.5%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-1}{\color{blue}{2 \cdot y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    14. associate-/r*44.5%

      \[\leadsto \frac{\tan \left(x \cdot \color{blue}{\frac{\frac{-1}{2}}{y}}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    15. metadata-eval44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\color{blue}{\sin \left(-\frac{x}{y \cdot 2}\right)}} \]
    17. distribute-frac-neg44.5%

      \[\leadsto \frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \color{blue}{\left(\frac{-x}{y \cdot 2}\right)}} \]
  3. Simplified44.7%

    \[\leadsto \color{blue}{\frac{\tan \left(x \cdot \frac{-0.5}{y}\right)}{\sin \left(x \cdot \frac{-0.5}{y}\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 56.7%

    \[\leadsto \color{blue}{1} \]
  6. Add Preprocessing

Alternative 10: 6.5% accurate, 211.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ -1 \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m) :precision binary64 -1.0)
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return -1.0;
}
x_m = abs(x)
y_m = abs(y)
real(8) function code(x_m, y_m)
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    code = -1.0d0
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	return -1.0;
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return -1.0
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return -1.0
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = -1.0;
end
x_m = N[Abs[x], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
code[x$95$m_, y$95$m_] := -1.0
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
-1
\end{array}
Derivation
  1. Initial program 44.3%

    \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 44.1%

    \[\leadsto \frac{\color{blue}{\frac{\sin \left(0.5 \cdot \frac{x}{y}\right)}{\cos \left(0.5 \cdot \frac{x}{y}\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  4. Step-by-step derivation
    1. *-commutative44.1%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left(\frac{x}{y} \cdot 0.5\right)}}{\cos \left(0.5 \cdot \frac{x}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. associate-*l/44.3%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left(\frac{x \cdot 0.5}{y}\right)}}{\cos \left(0.5 \cdot \frac{x}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    3. associate-*r/44.4%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left(x \cdot \frac{0.5}{y}\right)}}{\cos \left(0.5 \cdot \frac{x}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. *-commutative44.4%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \frac{0.5}{y}\right)}{\cos \color{blue}{\left(\frac{x}{y} \cdot 0.5\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. associate-*l/44.4%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \frac{0.5}{y}\right)}{\cos \color{blue}{\left(\frac{x \cdot 0.5}{y}\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. associate-*r/44.5%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \frac{0.5}{y}\right)}{\cos \color{blue}{\left(x \cdot \frac{0.5}{y}\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  5. Simplified44.5%

    \[\leadsto \frac{\color{blue}{\frac{\sin \left(x \cdot \frac{0.5}{y}\right)}{\cos \left(x \cdot \frac{0.5}{y}\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  6. Step-by-step derivation
    1. metadata-eval44.5%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \frac{\color{blue}{\frac{1}{2}}}{y}\right)}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    2. associate-/r*44.5%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \color{blue}{\frac{1}{2 \cdot y}}\right)}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    3. *-commutative44.5%

      \[\leadsto \frac{\frac{\sin \left(x \cdot \frac{1}{\color{blue}{y \cdot 2}}\right)}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    4. div-inv44.7%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left(\frac{x}{y \cdot 2}\right)}}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    5. add-cube-cbrt43.5%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y \cdot 2}} \cdot \sqrt[3]{\frac{x}{y \cdot 2}}\right) \cdot \sqrt[3]{\frac{x}{y \cdot 2}}\right)}}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
    6. pow344.0%

      \[\leadsto \frac{\frac{\sin \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y \cdot 2}}\right)}^{3}\right)}}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  7. Applied egg-rr3.8%

    \[\leadsto \frac{\frac{\sin \color{blue}{\left({\left(\sqrt[3]{-0.5 \cdot \frac{x}{y}}\right)}^{3}\right)}}{\cos \left(x \cdot \frac{0.5}{y}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
  8. Taylor expanded in x around 0 6.8%

    \[\leadsto \color{blue}{2 \cdot {\left(\sqrt[3]{-0.5}\right)}^{3}} \]
  9. Step-by-step derivation
    1. rem-cube-cbrt6.8%

      \[\leadsto 2 \cdot \color{blue}{-0.5} \]
    2. metadata-eval6.8%

      \[\leadsto \color{blue}{-1} \]
  10. Simplified6.8%

    \[\leadsto \color{blue}{-1} \]
  11. Add Preprocessing

Developer Target 1: 56.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y \cdot 2}\\ t_1 := \sin t\_0\\ \mathbf{if}\;y < -1.2303690911306994 \cdot 10^{+114}:\\ \;\;\;\;1\\ \mathbf{elif}\;y < -9.102852406811914 \cdot 10^{-222}:\\ \;\;\;\;\frac{t\_1}{t\_1 \cdot \log \left(e^{\cos t\_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (* y 2.0))) (t_1 (sin t_0)))
   (if (< y -1.2303690911306994e+114)
     1.0
     (if (< y -9.102852406811914e-222)
       (/ t_1 (* t_1 (log (exp (cos t_0)))))
       1.0))))
double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	double t_1 = sin(t_0);
	double tmp;
	if (y < -1.2303690911306994e+114) {
		tmp = 1.0;
	} else if (y < -9.102852406811914e-222) {
		tmp = t_1 / (t_1 * log(exp(cos(t_0))));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / (y * 2.0d0)
    t_1 = sin(t_0)
    if (y < (-1.2303690911306994d+114)) then
        tmp = 1.0d0
    else if (y < (-9.102852406811914d-222)) then
        tmp = t_1 / (t_1 * log(exp(cos(t_0))))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (y * 2.0);
	double t_1 = Math.sin(t_0);
	double tmp;
	if (y < -1.2303690911306994e+114) {
		tmp = 1.0;
	} else if (y < -9.102852406811914e-222) {
		tmp = t_1 / (t_1 * Math.log(Math.exp(Math.cos(t_0))));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (y * 2.0)
	t_1 = math.sin(t_0)
	tmp = 0
	if y < -1.2303690911306994e+114:
		tmp = 1.0
	elif y < -9.102852406811914e-222:
		tmp = t_1 / (t_1 * math.log(math.exp(math.cos(t_0))))
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(y * 2.0))
	t_1 = sin(t_0)
	tmp = 0.0
	if (y < -1.2303690911306994e+114)
		tmp = 1.0;
	elseif (y < -9.102852406811914e-222)
		tmp = Float64(t_1 / Float64(t_1 * log(exp(cos(t_0)))));
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (y * 2.0);
	t_1 = sin(t_0);
	tmp = 0.0;
	if (y < -1.2303690911306994e+114)
		tmp = 1.0;
	elseif (y < -9.102852406811914e-222)
		tmp = t_1 / (t_1 * log(exp(cos(t_0))));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[Less[y, -1.2303690911306994e+114], 1.0, If[Less[y, -9.102852406811914e-222], N[(t$95$1 / N[(t$95$1 * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 2}\\
t_1 := \sin t\_0\\
\mathbf{if}\;y < -1.2303690911306994 \cdot 10^{+114}:\\
\;\;\;\;1\\

\mathbf{elif}\;y < -9.102852406811914 \cdot 10^{-222}:\\
\;\;\;\;\frac{t\_1}{t\_1 \cdot \log \left(e^{\cos t\_0}\right)}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024133 
(FPCore (x y)
  :name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -1230369091130699400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) 1 (if (< y -4551426203405957/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1)))

  (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))