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

Percentage Accurate: 44.4% → 57.2%
Time: 16.7s
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.4% 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.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := {\left({\left(x\_m \cdot \frac{0.5}{y\_m}\right)}^{1.5}\right)}^{0.3333333333333333}\\
\mathbf{if}\;\frac{x\_m}{y\_m \cdot 2} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\frac{1}{\cos \left(t\_0 \cdot t\_0\right)}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\


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

    1. Initial program 52.5%

      \[\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.5%

        \[\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.5%

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

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

        \[\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.5%

        \[\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.5%

        \[\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.5%

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

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

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

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

        \[\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.2%

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

        \[\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.2%

        \[\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.2%

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

        \[\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.2%

        \[\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 61.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{y}}\right)}} \]
    10. Step-by-step derivation
      1. associate-/l/33.2%

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{\sqrt{\left(x \cdot x\right) \cdot \color{blue}{0.25}}}{y}\right)} \]
      7. metadata-eval51.5%

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \color{blue}{\left(0.5 \cdot \frac{x}{y}\right)}} \]
      13. rem-cbrt-cube59.4%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\sqrt[3]{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}}\right)}} \]
      14. unpow1/347.3%

        \[\leadsto \frac{1}{\cos \color{blue}{\left({\left({\left(0.5 \cdot \frac{x}{y}\right)}^{3}\right)}^{0.3333333333333333}\right)}} \]
      15. add-sqr-sqrt47.4%

        \[\leadsto \frac{1}{\cos \left({\color{blue}{\left(\sqrt{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}} \cdot \sqrt{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}}\right)}}^{0.3333333333333333}\right)} \]
      16. unpow-prod-down47.6%

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

        \[\leadsto \frac{1}{\cos \left({\color{blue}{\left({\left(0.5 \cdot \frac{x}{y}\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} \cdot {\left(\sqrt{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}}\right)}^{0.3333333333333333}\right)} \]
      18. associate-*r/36.5%

        \[\leadsto \frac{1}{\cos \left({\left({\color{blue}{\left(\frac{0.5 \cdot x}{y}\right)}}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} \cdot {\left(\sqrt{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}}\right)}^{0.3333333333333333}\right)} \]
      19. *-commutative36.5%

        \[\leadsto \frac{1}{\cos \left({\left({\left(\frac{\color{blue}{x \cdot 0.5}}{y}\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} \cdot {\left(\sqrt{{\left(0.5 \cdot \frac{x}{y}\right)}^{3}}\right)}^{0.3333333333333333}\right)} \]
      20. associate-/l*36.5%

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

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

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

    if 4.99999999999999977e170 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 5.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-cube-cbrt4.8%

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{{\left(\sqrt[3]{y \cdot 2}\right)}^{3}}}\right)} \]
    5. Taylor expanded in x around 0 10.6%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 56.8% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} t_0 := \sqrt[3]{x\_m \cdot \frac{0.5}{y\_m}}\\ t_1 := \frac{x\_m}{y\_m \cdot 2}\\ \mathbf{if}\;\frac{\tan t\_1}{\sin t\_1} \leq 1.05:\\ \;\;\;\;\frac{1}{\cos \left(t\_0 \cdot {t\_0}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \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 (* x_m (/ 0.5 y_m)))) (t_1 (/ x_m (* y_m 2.0))))
   (if (<= (/ (tan t_1) (sin t_1)) 1.05)
     (/ 1.0 (cos (* t_0 (pow t_0 2.0))))
     1.0)))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double t_0 = cbrt((x_m * (0.5 / y_m)));
	double t_1 = x_m / (y_m * 2.0);
	double tmp;
	if ((tan(t_1) / sin(t_1)) <= 1.05) {
		tmp = 1.0 / cos((t_0 * pow(t_0, 2.0)));
	} else {
		tmp = 1.0;
	}
	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((x_m * (0.5 / y_m)));
	double t_1 = x_m / (y_m * 2.0);
	double tmp;
	if ((Math.tan(t_1) / Math.sin(t_1)) <= 1.05) {
		tmp = 1.0 / Math.cos((t_0 * Math.pow(t_0, 2.0)));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	t_0 = cbrt(Float64(x_m * Float64(0.5 / y_m)))
	t_1 = Float64(x_m / Float64(y_m * 2.0))
	tmp = 0.0
	if (Float64(tan(t_1) / sin(t_1)) <= 1.05)
		tmp = Float64(1.0 / cos(Float64(t_0 * (t_0 ^ 2.0))));
	else
		tmp = 1.0;
	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[(x$95$m * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(x$95$m / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Tan[t$95$1], $MachinePrecision] / N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], 1.05], N[(1.0 / N[Cos[N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
t_0 := \sqrt[3]{x\_m \cdot \frac{0.5}{y\_m}}\\
t_1 := \frac{x\_m}{y\_m \cdot 2}\\
\mathbf{if}\;\frac{\tan t\_1}{\sin t\_1} \leq 1.05:\\
\;\;\;\;\frac{1}{\cos \left(t\_0 \cdot {t\_0}^{2}\right)}\\

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


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

    1. Initial program 66.7%

      \[\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-neg66.7%

        \[\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-neg66.7%

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

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

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

        \[\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-neg266.7%

        \[\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-out66.7%

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

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

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

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

        \[\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*66.3%

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

        \[\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*66.3%

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

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

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

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

      \[\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 66.7%

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

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

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

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

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

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

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

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

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

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

    if 1.05000000000000004 < (/.f64 (tan.f64 (/.f64 x (*.f64 y #s(literal 2 binary64)))) (sin.f64 (/.f64 x (*.f64 y #s(literal 2 binary64)))))

    1. Initial program 4.1%

      \[\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-neg4.1%

        \[\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-neg4.1%

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

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

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

        \[\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-neg24.1%

        \[\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-out4.1%

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

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

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

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

        \[\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*3.5%

        \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      13. *-commutative3.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*3.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-eval3.5%

        \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      16. sin-neg3.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-neg3.5%

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

      \[\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 30.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \leq 1.05:\\ \;\;\;\;\frac{1}{\cos \left(\sqrt[3]{x \cdot \frac{0.5}{y}} \cdot {\left(\sqrt[3]{x \cdot \frac{0.5}{y}}\right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 55.8% accurate, 0.5× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \frac{1}{\cos \left(\frac{1}{{y\_m}^{0.25}} \cdot \frac{x\_m \cdot \frac{-0.5}{\sqrt{y\_m}}}{{y\_m}^{0.25}}\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 (pow y_m 0.25)) (/ (* x_m (/ -0.5 (sqrt y_m))) (pow y_m 0.25))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos(((1.0 / pow(y_m, 0.25)) * ((x_m * (-0.5 / sqrt(y_m))) / pow(y_m, 0.25))));
}
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 ** 0.25d0)) * ((x_m * ((-0.5d0) / sqrt(y_m))) / (y_m ** 0.25d0))))
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 / Math.pow(y_m, 0.25)) * ((x_m * (-0.5 / Math.sqrt(y_m))) / Math.pow(y_m, 0.25))));
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	return 1.0 / math.cos(((1.0 / math.pow(y_m, 0.25)) * ((x_m * (-0.5 / math.sqrt(y_m))) / math.pow(y_m, 0.25))))
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	return Float64(1.0 / cos(Float64(Float64(1.0 / (y_m ^ 0.25)) * Float64(Float64(x_m * Float64(-0.5 / sqrt(y_m))) / (y_m ^ 0.25)))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0 / cos(((1.0 / (y_m ^ 0.25)) * ((x_m * (-0.5 / sqrt(y_m))) / (y_m ^ 0.25))));
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[(1.0 / N[Power[y$95$m, 0.25], $MachinePrecision]), $MachinePrecision] * N[(N[(x$95$m * N[(-0.5 / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[y$95$m, 0.25], $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}^{0.25}} \cdot \frac{x\_m \cdot \frac{-0.5}{\sqrt{y\_m}}}{{y\_m}^{0.25}}\right)}
\end{array}
Derivation
  1. Initial program 45.1%

    \[\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-neg45.1%

      \[\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-neg45.1%

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

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

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

      \[\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-neg245.1%

      \[\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-out45.1%

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

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

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

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

      \[\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.7%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.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*44.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-eval44.7%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.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-neg44.7%

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

    \[\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 52.6%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{y}}\right)}} \]
  10. Step-by-step derivation
    1. *-un-lft-identity28.5%

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \left(\frac{1}{{y}^{\color{blue}{0.25}}} \cdot \frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{\sqrt{y}}}\right)} \]
    7. associate-/l*28.3%

      \[\leadsto \frac{1}{\cos \left(\frac{1}{{y}^{0.25}} \cdot \frac{\color{blue}{x \cdot \frac{-0.5}{\sqrt{y}}}}{\sqrt{\sqrt{y}}}\right)} \]
    8. pow1/228.3%

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

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

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

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

Alternative 4: 57.4% 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 10^{+187}:\\ \;\;\;\;\frac{1}{\cos \left(\frac{x\_m \cdot \frac{0.5}{\sqrt{y\_m}}}{\sqrt{y\_m}}\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\ \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)) 1e+187)
   (/ 1.0 (cos (/ (* x_m (/ 0.5 (sqrt y_m))) (sqrt y_m))))
   (* 0.5 (pow (cbrt 2.0) 3.0))))
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)) <= 1e+187) {
		tmp = 1.0 / cos(((x_m * (0.5 / sqrt(y_m))) / sqrt(y_m)));
	} else {
		tmp = 0.5 * pow(cbrt(2.0), 3.0);
	}
	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)) <= 1e+187) {
		tmp = 1.0 / Math.cos(((x_m * (0.5 / Math.sqrt(y_m))) / Math.sqrt(y_m)));
	} else {
		tmp = 0.5 * Math.pow(Math.cbrt(2.0), 3.0);
	}
	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)) <= 1e+187)
		tmp = Float64(1.0 / cos(Float64(Float64(x_m * Float64(0.5 / sqrt(y_m))) / sqrt(y_m))));
	else
		tmp = Float64(0.5 * (cbrt(2.0) ^ 3.0));
	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], 1e+187], N[(1.0 / N[Cos[N[(N[(x$95$m * N[(0.5 / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[N[Power[2.0, 1/3], $MachinePrecision], 3.0], $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 10^{+187}:\\
\;\;\;\;\frac{1}{\cos \left(\frac{x\_m \cdot \frac{0.5}{\sqrt{y\_m}}}{\sqrt{y\_m}}\right)}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\


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

    1. Initial program 51.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-neg51.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-neg51.9%

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

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg251.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-out51.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-neg251.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-out51.9%

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

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

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

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative51.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*51.6%

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

        \[\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*51.6%

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

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

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

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

      \[\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 60.6%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{y}}\right)}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt18.4%

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

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{\frac{\sqrt{\left(x \cdot x\right) \cdot \color{blue}{0.25}}}{\sqrt{y}}}{\sqrt{y}}\right)} \]
      5. metadata-eval27.8%

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

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

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{\frac{x \cdot \color{blue}{\left(--0.5\right)}}{\sqrt{y}}}{\sqrt{y}}\right)} \]
      10. distribute-rgt-neg-in32.9%

        \[\leadsto \frac{1}{\cos \left(\frac{\frac{\color{blue}{-x \cdot -0.5}}{\sqrt{y}}}{\sqrt{y}}\right)} \]
      11. distribute-neg-frac32.9%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{-\frac{x \cdot -0.5}{\sqrt{y}}}}{\sqrt{y}}\right)} \]
      12. neg-sub032.9%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{0 - \frac{x \cdot -0.5}{\sqrt{y}}}}{\sqrt{y}}\right)} \]
      13. associate-/l*32.8%

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

      \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{0 - x \cdot \frac{-0.5}{\sqrt{y}}}}{\sqrt{y}}\right)} \]
    12. Step-by-step derivation
      1. neg-sub032.8%

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{-x \cdot \frac{-0.5}{\sqrt{y}}}}{\sqrt{y}}\right)} \]
      2. distribute-rgt-neg-in32.8%

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

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

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

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

    if 9.99999999999999907e186 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 5.2%

      \[\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-cube-cbrt5.1%

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{{\left(\sqrt[3]{y \cdot 2}\right)}^{3}}}\right)} \]
    5. Taylor expanded in x around 0 10.3%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 57.3% 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 10^{+187}:\\ \;\;\;\;\frac{1}{\cos \left(\frac{0.5}{\sqrt{y\_m}} \cdot \frac{x\_m}{\sqrt{y\_m}}\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\ \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)) 1e+187)
   (/ 1.0 (cos (* (/ 0.5 (sqrt y_m)) (/ x_m (sqrt y_m)))))
   (* 0.5 (pow (cbrt 2.0) 3.0))))
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)) <= 1e+187) {
		tmp = 1.0 / cos(((0.5 / sqrt(y_m)) * (x_m / sqrt(y_m))));
	} else {
		tmp = 0.5 * pow(cbrt(2.0), 3.0);
	}
	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)) <= 1e+187) {
		tmp = 1.0 / Math.cos(((0.5 / Math.sqrt(y_m)) * (x_m / Math.sqrt(y_m))));
	} else {
		tmp = 0.5 * Math.pow(Math.cbrt(2.0), 3.0);
	}
	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)) <= 1e+187)
		tmp = Float64(1.0 / cos(Float64(Float64(0.5 / sqrt(y_m)) * Float64(x_m / sqrt(y_m)))));
	else
		tmp = Float64(0.5 * (cbrt(2.0) ^ 3.0));
	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], 1e+187], N[(1.0 / N[Cos[N[(N[(0.5 / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision] * N[(x$95$m / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[N[Power[2.0, 1/3], $MachinePrecision], 3.0], $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 10^{+187}:\\
\;\;\;\;\frac{1}{\cos \left(\frac{0.5}{\sqrt{y\_m}} \cdot \frac{x\_m}{\sqrt{y\_m}}\right)}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\


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

    1. Initial program 51.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-neg51.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-neg51.9%

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

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg251.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-out51.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-neg251.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-out51.9%

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

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

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

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative51.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*51.6%

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

        \[\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*51.6%

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

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

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

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

      \[\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 60.6%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{y}}\right)}} \]
    10. Step-by-step derivation
      1. associate-/l/32.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{\color{blue}{x \cdot 0.5}}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      10. times-frac32.9%

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

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

    if 9.99999999999999907e186 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 5.2%

      \[\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-cube-cbrt5.1%

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{{\left(\sqrt[3]{y \cdot 2}\right)}^{3}}}\right)} \]
    5. Taylor expanded in x around 0 10.3%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.7%

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

Alternative 6: 55.9% accurate, 0.7× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ y_m = \left|y\right| \\ \begin{array}{l} t_0 := \sqrt{\frac{x\_m}{y\_m}}\\ \frac{1}{\cos \left(t\_0 \cdot \left(0.5 \cdot t\_0\right)\right)} \end{array} \end{array} \]
x_m = (fabs.f64 x)
y_m = (fabs.f64 y)
(FPCore (x_m y_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ x_m y_m)))) (/ 1.0 (cos (* t_0 (* 0.5 t_0))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	double t_0 = sqrt((x_m / y_m));
	return 1.0 / cos((t_0 * (0.5 * t_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
    real(8) :: t_0
    t_0 = sqrt((x_m / y_m))
    code = 1.0d0 / cos((t_0 * (0.5d0 * t_0)))
end function
x_m = Math.abs(x);
y_m = Math.abs(y);
public static double code(double x_m, double y_m) {
	double t_0 = Math.sqrt((x_m / y_m));
	return 1.0 / Math.cos((t_0 * (0.5 * t_0)));
}
x_m = math.fabs(x)
y_m = math.fabs(y)
def code(x_m, y_m):
	t_0 = math.sqrt((x_m / y_m))
	return 1.0 / math.cos((t_0 * (0.5 * t_0)))
x_m = abs(x)
y_m = abs(y)
function code(x_m, y_m)
	t_0 = sqrt(Float64(x_m / y_m))
	return Float64(1.0 / cos(Float64(t_0 * Float64(0.5 * t_0))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	t_0 = sqrt((x_m / y_m));
	tmp = 1.0 / cos((t_0 * (0.5 * t_0)));
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[Sqrt[N[(x$95$m / y$95$m), $MachinePrecision]], $MachinePrecision]}, N[(1.0 / N[Cos[N[(t$95$0 * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
y_m = \left|y\right|

\\
\begin{array}{l}
t_0 := \sqrt{\frac{x\_m}{y\_m}}\\
\frac{1}{\cos \left(t\_0 \cdot \left(0.5 \cdot t\_0\right)\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 45.1%

    \[\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-neg45.1%

      \[\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-neg45.1%

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

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

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

      \[\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-neg245.1%

      \[\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-out45.1%

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

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

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

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

      \[\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.7%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.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*44.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-eval44.7%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.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-neg44.7%

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

    \[\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 52.6%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{\frac{x \cdot -0.5}{\sqrt{y}}}{\sqrt{y}}\right)}} \]
  10. Step-by-step derivation
    1. associate-/l/28.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\cos \color{blue}{\left(\left(0.5 \cdot \sqrt{\frac{x}{y}}\right) \cdot \sqrt{\frac{x}{y}}\right)}} \]
  12. Final simplification31.9%

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

Alternative 7: 57.3% 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 10^{+187}:\\ \;\;\;\;\frac{1}{\cos \left(\frac{1}{y\_m \cdot \frac{1}{x\_m \cdot -0.5}}\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\ \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)) 1e+187)
   (/ 1.0 (cos (/ 1.0 (* y_m (/ 1.0 (* x_m -0.5))))))
   (* 0.5 (pow (cbrt 2.0) 3.0))))
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)) <= 1e+187) {
		tmp = 1.0 / cos((1.0 / (y_m * (1.0 / (x_m * -0.5)))));
	} else {
		tmp = 0.5 * pow(cbrt(2.0), 3.0);
	}
	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)) <= 1e+187) {
		tmp = 1.0 / Math.cos((1.0 / (y_m * (1.0 / (x_m * -0.5)))));
	} else {
		tmp = 0.5 * Math.pow(Math.cbrt(2.0), 3.0);
	}
	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)) <= 1e+187)
		tmp = Float64(1.0 / cos(Float64(1.0 / Float64(y_m * Float64(1.0 / Float64(x_m * -0.5))))));
	else
		tmp = Float64(0.5 * (cbrt(2.0) ^ 3.0));
	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], 1e+187], N[(1.0 / N[Cos[N[(1.0 / N[(y$95$m * N[(1.0 / N[(x$95$m * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[N[Power[2.0, 1/3], $MachinePrecision], 3.0], $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 10^{+187}:\\
\;\;\;\;\frac{1}{\cos \left(\frac{1}{y\_m \cdot \frac{1}{x\_m \cdot -0.5}}\right)}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}\\


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

    1. Initial program 51.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-neg51.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-neg51.9%

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

        \[\leadsto -\frac{\color{blue}{\tan \left(-\frac{x}{y \cdot 2}\right)}}{\sin \left(\frac{x}{y \cdot 2}\right)} \]
      4. distribute-frac-neg251.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-out51.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-neg251.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-out51.9%

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

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

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

        \[\leadsto \frac{\tan \left(\frac{\color{blue}{-1 \cdot x}}{y \cdot 2}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
      11. *-commutative51.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*51.6%

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

        \[\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*51.6%

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

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

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

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

      \[\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 60.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{1}{\frac{y}{x \cdot -0.5}}\right)}} \]
    10. Step-by-step derivation
      1. div-inv60.9%

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

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

    if 9.99999999999999907e186 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 5.2%

      \[\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-cube-cbrt5.1%

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{{\left(\sqrt[3]{y \cdot 2}\right)}^{3}}}\right)} \]
    5. Taylor expanded in x around 0 10.3%

      \[\leadsto \color{blue}{0.5 \cdot {\left(\sqrt[3]{2}\right)}^{3}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 55.8% 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{1}{x\_m \cdot -0.5}}\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 (/ 1.0 (* x_m -0.5)))))))
x_m = fabs(x);
y_m = fabs(y);
double code(double x_m, double y_m) {
	return 1.0 / cos((1.0 / (y_m * (1.0 / (x_m * -0.5)))));
}
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 * (1.0d0 / (x_m * (-0.5d0))))))
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 * (1.0 / (x_m * -0.5)))));
}
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 * (1.0 / (x_m * -0.5)))))
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(1.0 / Float64(x_m * -0.5))))))
end
x_m = abs(x);
y_m = abs(y);
function tmp = code(x_m, y_m)
	tmp = 1.0 / cos((1.0 / (y_m * (1.0 / (x_m * -0.5)))));
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[(1.0 / N[(x$95$m * -0.5), $MachinePrecision]), $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{1}{x\_m \cdot -0.5}}\right)}
\end{array}
Derivation
  1. Initial program 45.1%

    \[\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-neg45.1%

      \[\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-neg45.1%

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

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

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

      \[\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-neg245.1%

      \[\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-out45.1%

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

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

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

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

      \[\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.7%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.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*44.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-eval44.7%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.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-neg44.7%

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

    \[\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 52.6%

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{1}{\frac{y}{x \cdot -0.5}}\right)}} \]
  10. Step-by-step derivation
    1. div-inv52.9%

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

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

Alternative 9: 55.9% 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 45.1%

    \[\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-neg45.1%

      \[\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-neg45.1%

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

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

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

      \[\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-neg245.1%

      \[\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-out45.1%

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

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

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

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

      \[\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.7%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.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*44.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-eval44.7%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.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-neg44.7%

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

    \[\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 52.6%

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

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

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

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

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

Alternative 10: 55.7% 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 45.1%

    \[\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-neg45.1%

      \[\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-neg45.1%

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

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

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

      \[\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-neg245.1%

      \[\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-out45.1%

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

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

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

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

      \[\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.7%

      \[\leadsto \frac{\tan \color{blue}{\left(x \cdot \frac{-1}{y \cdot 2}\right)}}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    13. *-commutative44.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*44.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-eval44.7%

      \[\leadsto \frac{\tan \left(x \cdot \frac{\color{blue}{-0.5}}{y}\right)}{-\sin \left(\frac{x}{y \cdot 2}\right)} \]
    16. sin-neg44.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-neg44.7%

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

    \[\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 52.2%

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

Developer Target 1: 55.7% 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 2024116 
(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)))))