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

Percentage Accurate: 44.1% → 56.6%
Time: 16.9s
Alternatives: 11
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 11 alternatives:

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

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

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


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

    1. Initial program 49.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-neg49.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-neg49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\cos \left({\color{blue}{\left(\sqrt[3]{\frac{-0.5}{y}} \cdot \sqrt[3]{x}\right)}}^{3}\right)} \]
    12. Step-by-step derivation
      1. add-cube-cbrt60.0%

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

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

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

    if 1.9999999999999999e291 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 1.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-exp-log0.1%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    4. Applied egg-rr0.1%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    5. Step-by-step derivation
      1. rem-exp-log1.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
      18. rem-exp-log1.1%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
      19. add-log-exp0.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{\log \left(e^{e^{\log \left(y \cdot 2\right)}}\right)}}\right)} \]
      20. neg-log0.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{e^{e^{\log \left(y \cdot 2\right)}}}\right)}}\right)} \]
      21. rem-exp-log0.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{y \cdot 2}}}\right)}\right)} \]
      22. *-commutative0.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{2 \cdot y}}}\right)}\right)} \]
      23. exp-prod0.0%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{\color{blue}{{\left(e^{2}\right)}^{y}}}\right)}\right)} \]
    6. Applied egg-rr0.0%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
    7. Taylor expanded in x around 0 3.1%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\log \left(\frac{1}{e^{2 \cdot y}}\right)}{y}} \]
    8. Step-by-step derivation
      1. log-rec3.1%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{-\log \left(e^{2 \cdot y}\right)}}{y} \]
      2. *-commutative3.1%

        \[\leadsto 0.5 \cdot \frac{-\log \left(e^{\color{blue}{y \cdot 2}}\right)}{y} \]
      3. rem-log-exp10.6%

        \[\leadsto 0.5 \cdot \frac{-\color{blue}{y \cdot 2}}{y} \]
      4. distribute-rgt-neg-in10.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot \left(-2\right)}}{y} \]
      5. metadata-eval10.6%

        \[\leadsto 0.5 \cdot \frac{y \cdot \color{blue}{-2}}{y} \]
    9. Simplified10.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot -2}{y}} \]
    10. Step-by-step derivation
      1. add-cube-cbrt10.6%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{y \cdot -2}{y}} \cdot \sqrt[3]{\frac{y \cdot -2}{y}}\right) \cdot \sqrt[3]{\frac{y \cdot -2}{y}}\right)} \]
      2. pow310.6%

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\sqrt[3]{\frac{y \cdot -2}{y}}\right)}^{3}} \]
      3. *-commutative10.6%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{\color{blue}{-2 \cdot y}}{y}}\right)}^{3} \]
      4. *-un-lft-identity10.6%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{-2 \cdot y}{\color{blue}{1 \cdot y}}}\right)}^{3} \]
      5. times-frac10.6%

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

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\color{blue}{-2} \cdot \frac{y}{y}}\right)}^{3} \]
    11. Applied egg-rr10.6%

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

Alternative 2: 56.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x\_m}{y\_m \cdot 2}\\
\mathbf{if}\;\frac{\tan t\_0}{\sin t\_0} \leq 2:\\
\;\;\;\;\frac{1}{\cos \left({\left(\sqrt[3]{\frac{x\_m}{y\_m}} \cdot \sqrt[3]{-0.5}\right)}^{3}\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))))) < 2

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    9. Applied egg-rr64.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 0 64.9%

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

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

    1. Initial program 2.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 56.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x\_m}{y\_m \cdot 2}\\
\mathbf{if}\;\frac{\tan t\_0}{\sin t\_0} \leq 2:\\
\;\;\;\;\frac{1}{\cos \left({\left(\sqrt[3]{\frac{-0.5}{y\_m}} \cdot \sqrt[3]{x\_m}\right)}^{3}\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))))) < 2

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \color{blue}{\left({\left(\sqrt[3]{x \cdot \frac{-0.5}{y}}\right)}^{3}\right)}} \]
    9. Applied egg-rr64.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. *-commutative64.4%

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

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

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

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

    1. Initial program 2.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

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

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


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

    1. Initial program 55.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-neg55.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-neg55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. associate-*r/67.7%

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

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

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

    if 1e80 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 7.1%

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    4. Applied egg-rr3.9%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    5. Step-by-step derivation
      1. rem-exp-log7.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\frac{1}{\sqrt{\frac{\color{blue}{0.25}}{y \cdot y}}}}\right)} \]
      9. metadata-eval3.4%

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\frac{1}{\color{blue}{\sqrt{\frac{-0.5}{y}} \cdot \sqrt{\frac{-0.5}{y}}}}}\right)} \]
      12. add-sqr-sqrt6.6%

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
      18. rem-exp-log2.7%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
      19. add-log-exp0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{\log \left(e^{e^{\log \left(y \cdot 2\right)}}\right)}}\right)} \]
      20. neg-log0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{e^{e^{\log \left(y \cdot 2\right)}}}\right)}}\right)} \]
      21. rem-exp-log0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{y \cdot 2}}}\right)}\right)} \]
      22. *-commutative0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{2 \cdot y}}}\right)}\right)} \]
      23. exp-prod0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{\color{blue}{{\left(e^{2}\right)}^{y}}}\right)}\right)} \]
    6. Applied egg-rr0.9%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
    7. Taylor expanded in x around 0 3.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\log \left(\frac{1}{e^{2 \cdot y}}\right)}{y}} \]
    8. Step-by-step derivation
      1. log-rec3.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{-\log \left(e^{2 \cdot y}\right)}}{y} \]
      2. *-commutative3.9%

        \[\leadsto 0.5 \cdot \frac{-\log \left(e^{\color{blue}{y \cdot 2}}\right)}{y} \]
      3. rem-log-exp10.3%

        \[\leadsto 0.5 \cdot \frac{-\color{blue}{y \cdot 2}}{y} \]
      4. distribute-rgt-neg-in10.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot \left(-2\right)}}{y} \]
      5. metadata-eval10.3%

        \[\leadsto 0.5 \cdot \frac{y \cdot \color{blue}{-2}}{y} \]
    9. Simplified10.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot -2}{y}} \]
    10. Step-by-step derivation
      1. add-cube-cbrt10.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\sqrt[3]{\frac{y \cdot -2}{y}}\right)}^{3}} \]
      3. *-commutative10.3%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{\color{blue}{-2 \cdot y}}{y}}\right)}^{3} \]
      4. *-un-lft-identity10.3%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{-2 \cdot y}{\color{blue}{1 \cdot y}}}\right)}^{3} \]
      5. times-frac10.3%

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

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\color{blue}{-2} \cdot \frac{y}{y}}\right)}^{3} \]
    11. Applied egg-rr10.3%

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

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

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


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

    1. Initial program 55.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999984e88 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 6.8%

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    4. Applied egg-rr4.0%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    5. Step-by-step derivation
      1. rem-exp-log6.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\frac{1}{\color{blue}{\sqrt{\frac{-0.5}{y}} \cdot \sqrt{\frac{-0.5}{y}}}}}\right)} \]
      12. add-sqr-sqrt6.7%

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
      18. rem-exp-log2.8%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
      19. add-log-exp0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{\log \left(e^{e^{\log \left(y \cdot 2\right)}}\right)}}\right)} \]
      20. neg-log0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{e^{e^{\log \left(y \cdot 2\right)}}}\right)}}\right)} \]
      21. rem-exp-log0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{y \cdot 2}}}\right)}\right)} \]
      22. *-commutative0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{2 \cdot y}}}\right)}\right)} \]
      23. exp-prod0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{\color{blue}{{\left(e^{2}\right)}^{y}}}\right)}\right)} \]
    6. Applied egg-rr0.9%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
    7. Taylor expanded in x around 0 3.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\log \left(\frac{1}{e^{2 \cdot y}}\right)}{y}} \]
    8. Step-by-step derivation
      1. log-rec3.7%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{-\log \left(e^{2 \cdot y}\right)}}{y} \]
      2. *-commutative3.7%

        \[\leadsto 0.5 \cdot \frac{-\log \left(e^{\color{blue}{y \cdot 2}}\right)}{y} \]
      3. rem-log-exp10.2%

        \[\leadsto 0.5 \cdot \frac{-\color{blue}{y \cdot 2}}{y} \]
      4. distribute-rgt-neg-in10.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot \left(-2\right)}}{y} \]
      5. metadata-eval10.2%

        \[\leadsto 0.5 \cdot \frac{y \cdot \color{blue}{-2}}{y} \]
    9. Simplified10.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot -2}{y}} \]
    10. Step-by-step derivation
      1. add-cube-cbrt10.2%

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

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\sqrt[3]{\frac{y \cdot -2}{y}}\right)}^{3}} \]
      3. *-commutative10.2%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{\color{blue}{-2 \cdot y}}{y}}\right)}^{3} \]
      4. *-un-lft-identity10.2%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{-2 \cdot y}{\color{blue}{1 \cdot y}}}\right)}^{3} \]
      5. times-frac10.2%

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

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\color{blue}{-2} \cdot \frac{y}{y}}\right)}^{3} \]
    11. Applied egg-rr10.2%

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

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

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


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

    1. Initial program 55.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-neg55.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-neg55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\cos \left(x \cdot \color{blue}{\frac{1}{\frac{y}{-0.5}}}\right)} \]
      3. un-div-inv67.6%

        \[\leadsto \frac{1}{\cos \color{blue}{\left(\frac{x}{\frac{y}{-0.5}}\right)}} \]
      4. div-inv67.6%

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{x}{y \cdot \color{blue}{\left(-2\right)}}\right)} \]
      7. distribute-rgt-neg-in67.6%

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
      8. rem-log-exp67.6%

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

        \[\leadsto \frac{1}{\cos \left(\frac{x}{-\color{blue}{\log \left({\left(e^{2}\right)}^{y}\right)}}\right)} \]
      10. log-rec46.8%

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
      11. add-sqr-sqrt29.1%

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

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

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\sqrt{\color{blue}{\left(-\log \left({\left(e^{2}\right)}^{y}\right)\right)} \cdot \log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
      14. log-pow46.8%

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

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\sqrt{\left(-y \cdot \color{blue}{2}\right) \cdot \log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
      16. log-rec46.7%

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\sqrt{\left(-y \cdot 2\right) \cdot \color{blue}{\left(-\log \left({\left(e^{2}\right)}^{y}\right)\right)}}}\right)} \]
      17. log-pow61.5%

        \[\leadsto \frac{1}{\cos \left(\frac{x}{\sqrt{\left(-y \cdot 2\right) \cdot \left(-\color{blue}{y \cdot \log \left(e^{2}\right)}\right)}}\right)} \]
      18. rem-log-exp61.5%

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

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

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

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

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

    if 9.99999999999999927e74 < (/.f64 x (*.f64 y #s(literal 2 binary64)))

    1. Initial program 7.0%

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    4. Applied egg-rr3.9%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    5. Step-by-step derivation
      1. rem-exp-log7.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\frac{1}{\sqrt{\frac{\color{blue}{0.25}}{y \cdot y}}}}\right)} \]
      9. metadata-eval3.4%

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\frac{1}{\color{blue}{\sqrt{\frac{-0.5}{y}} \cdot \sqrt{\frac{-0.5}{y}}}}}\right)} \]
      12. add-sqr-sqrt7.0%

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

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

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

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

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

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
      18. rem-exp-log2.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
      19. add-log-exp0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{\log \left(e^{e^{\log \left(y \cdot 2\right)}}\right)}}\right)} \]
      20. neg-log0.4%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{e^{e^{\log \left(y \cdot 2\right)}}}\right)}}\right)} \]
      21. rem-exp-log0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{y \cdot 2}}}\right)}\right)} \]
      22. *-commutative0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{2 \cdot y}}}\right)}\right)} \]
      23. exp-prod0.9%

        \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{\color{blue}{{\left(e^{2}\right)}^{y}}}\right)}\right)} \]
    6. Applied egg-rr0.9%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
    7. Taylor expanded in x around 0 3.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\log \left(\frac{1}{e^{2 \cdot y}}\right)}{y}} \]
    8. Step-by-step derivation
      1. log-rec3.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{-\log \left(e^{2 \cdot y}\right)}}{y} \]
      2. *-commutative3.9%

        \[\leadsto 0.5 \cdot \frac{-\log \left(e^{\color{blue}{y \cdot 2}}\right)}{y} \]
      3. rem-log-exp10.6%

        \[\leadsto 0.5 \cdot \frac{-\color{blue}{y \cdot 2}}{y} \]
      4. distribute-rgt-neg-in10.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot \left(-2\right)}}{y} \]
      5. metadata-eval10.6%

        \[\leadsto 0.5 \cdot \frac{y \cdot \color{blue}{-2}}{y} \]
    9. Simplified10.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot -2}{y}} \]
    10. Step-by-step derivation
      1. add-cube-cbrt10.6%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{y \cdot -2}{y}} \cdot \sqrt[3]{\frac{y \cdot -2}{y}}\right) \cdot \sqrt[3]{\frac{y \cdot -2}{y}}\right)} \]
      2. pow310.6%

        \[\leadsto 0.5 \cdot \color{blue}{{\left(\sqrt[3]{\frac{y \cdot -2}{y}}\right)}^{3}} \]
      3. *-commutative10.6%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{\color{blue}{-2 \cdot y}}{y}}\right)}^{3} \]
      4. *-un-lft-identity10.6%

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\frac{-2 \cdot y}{\color{blue}{1 \cdot y}}}\right)}^{3} \]
      5. times-frac10.6%

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

        \[\leadsto 0.5 \cdot {\left(\sqrt[3]{\color{blue}{-2} \cdot \frac{y}{y}}\right)}^{3} \]
    11. Applied egg-rr10.6%

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

Alternative 7: 55.4% accurate, 1.9× speedup?

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

\\
1 + \left(\frac{1}{\cos \left(x\_m \cdot \frac{-0.5}{y\_m}\right)} + -1\right)
\end{array}
Derivation
  1. Initial program 45.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-neg45.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-neg45.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\cos \left(x \cdot \frac{-0.5}{y}\right)}} \]
  8. Step-by-step derivation
    1. add-cube-cbrt55.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. pow355.7%

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

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

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

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

    \[\leadsto \frac{1}{\cos \left({\color{blue}{\left(\sqrt[3]{\frac{-0.5}{y}} \cdot \sqrt[3]{x}\right)}}^{3}\right)} \]
  12. Step-by-step derivation
    1. cbrt-unprod55.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\cos \left(\frac{x \cdot -0.5}{y}\right)}\right)} - 1} \]
    11. sub-neg52.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\cos \left(\frac{x \cdot -0.5}{y}\right)}\right)} + \left(-1\right)} \]
    12. metadata-eval52.5%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{1}{\cos \left(\frac{x \cdot -0.5}{y}\right)}\right)} + \color{blue}{-1} \]
  13. Applied egg-rr55.3%

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

      \[\leadsto \color{blue}{1 + \left(\frac{1}{\cos \left(-0.5 \cdot \frac{x}{y}\right)} + -1\right)} \]
  15. Simplified55.6%

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

Alternative 8: 55.4% 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.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-neg45.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-neg45.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.4% 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 45.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 55.3%

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

Alternative 10: 55.0% 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.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-neg45.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-neg45.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 6.6% 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.9%

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
  4. Applied egg-rr16.8%

    \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
  5. Step-by-step derivation
    1. rem-exp-log45.9%

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\frac{y}{0.5}}}\right)} \]
    4. clear-num46.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{-y \cdot 2}}\right)} \]
    18. rem-exp-log2.0%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{e^{\log \left(y \cdot 2\right)}}}\right)} \]
    19. add-log-exp0.3%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{-\color{blue}{\log \left(e^{e^{\log \left(y \cdot 2\right)}}\right)}}\right)} \]
    20. neg-log0.3%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{e^{e^{\log \left(y \cdot 2\right)}}}\right)}}\right)} \]
    21. rem-exp-log0.7%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{y \cdot 2}}}\right)}\right)} \]
    22. *-commutative0.7%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{e^{\color{blue}{2 \cdot y}}}\right)}\right)} \]
    23. exp-prod0.7%

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\log \left(\frac{1}{\color{blue}{{\left(e^{2}\right)}^{y}}}\right)}\right)} \]
  6. Applied egg-rr0.7%

    \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{\color{blue}{\log \left(\frac{1}{{\left(e^{2}\right)}^{y}}\right)}}\right)} \]
  7. Taylor expanded in x around 0 2.3%

    \[\leadsto \color{blue}{0.5 \cdot \frac{\log \left(\frac{1}{e^{2 \cdot y}}\right)}{y}} \]
  8. Step-by-step derivation
    1. log-rec2.3%

      \[\leadsto 0.5 \cdot \frac{\color{blue}{-\log \left(e^{2 \cdot y}\right)}}{y} \]
    2. *-commutative2.3%

      \[\leadsto 0.5 \cdot \frac{-\log \left(e^{\color{blue}{y \cdot 2}}\right)}{y} \]
    3. rem-log-exp6.6%

      \[\leadsto 0.5 \cdot \frac{-\color{blue}{y \cdot 2}}{y} \]
    4. distribute-rgt-neg-in6.6%

      \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot \left(-2\right)}}{y} \]
    5. metadata-eval6.6%

      \[\leadsto 0.5 \cdot \frac{y \cdot \color{blue}{-2}}{y} \]
  9. Simplified6.6%

    \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot -2}{y}} \]
  10. Taylor expanded in y around 0 6.6%

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

Developer Target 1: 55.0% 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 2024139 
(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)))))