ab-angle->ABCF A

Percentage Accurate: 79.7% → 79.7%
Time: 17.5s
Alternatives: 18
Speedup: 1.3×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) PI)))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
	double t_0 = (angle / 180.0) * ((double) M_PI);
	return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
	double t_0 = (angle / 180.0) * Math.PI;
	return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle):
	t_0 = (angle / 180.0) * math.pi
	return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0))
end
function tmp = code(a, b, angle)
	t_0 = (angle / 180.0) * pi;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0);
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\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 18 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: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) PI)))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
	double t_0 = (angle / 180.0) * ((double) M_PI);
	return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
	double t_0 = (angle / 180.0) * Math.PI;
	return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle):
	t_0 = (angle / 180.0) * math.pi
	return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0))
end
function tmp = code(a, b, angle)
	t_0 = (angle / 180.0) * pi;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0);
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}

Alternative 1: 79.7% accurate, 0.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{t\_0} \cdot \left({\left(\sqrt[3]{{t\_0}^{0.25}}\right)}^{2} \cdot \sqrt{t\_0}\right)\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
   (+
    (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
    (pow
     (* b (cos (* (cbrt t_0) (* (pow (cbrt (pow t_0 0.25)) 2.0) (sqrt t_0)))))
     2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((cbrt(t_0) * (pow(cbrt(pow(t_0, 0.25)), 2.0) * sqrt(t_0))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI * 0.005555555555555556);
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.cbrt(t_0) * (Math.pow(Math.cbrt(Math.pow(t_0, 0.25)), 2.0) * Math.sqrt(t_0))))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(cbrt(t_0) * Float64((cbrt((t_0 ^ 0.25)) ^ 2.0) * sqrt(t_0))))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[t$95$0, 1/3], $MachinePrecision] * N[(N[Power[N[Power[N[Power[t$95$0, 0.25], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{t\_0} \cdot \left({\left(\sqrt[3]{{t\_0}^{0.25}}\right)}^{2} \cdot \sqrt{t\_0}\right)\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. rem-exp-log77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2} \]
    2. add-sqr-sqrt39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}\right)}^{2} \]
    3. add-cbrt-cube35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\sqrt[3]{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    4. add-sqr-sqrt35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    5. cbrt-prod39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    6. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\sqrt[3]{\color{blue}{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    7. associate-*l*39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
    8. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  6. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
  7. Step-by-step derivation
    1. add-sqr-sqrt39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{\left(\sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}} \cdot \sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}}\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
    2. pow239.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{{\left(\sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}}\right)}^{2}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  8. Applied egg-rr39.2%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{{\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  9. Add Preprocessing

Alternative 2: 79.7% accurate, 0.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left({\left(\sqrt[3]{{t\_0}^{0.25}}\right)}^{2} \cdot \sqrt{t\_0}\right) \cdot \sqrt[3]{0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)}\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
   (+
    (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
    (pow
     (*
      b
      (cos
       (*
        (* (pow (cbrt (pow t_0 0.25)) 2.0) (sqrt t_0))
        (cbrt (* 0.005555555555555556 (* angle_m PI))))))
     2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((pow(cbrt(pow(t_0, 0.25)), 2.0) * sqrt(t_0)) * cbrt((0.005555555555555556 * (angle_m * ((double) M_PI))))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI * 0.005555555555555556);
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((Math.pow(Math.cbrt(Math.pow(t_0, 0.25)), 2.0) * Math.sqrt(t_0)) * Math.cbrt((0.005555555555555556 * (angle_m * Math.PI)))))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64((cbrt((t_0 ^ 0.25)) ^ 2.0) * sqrt(t_0)) * cbrt(Float64(0.005555555555555556 * Float64(angle_m * pi)))))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(N[Power[N[Power[N[Power[t$95$0, 0.25], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left({\left(\sqrt[3]{{t\_0}^{0.25}}\right)}^{2} \cdot \sqrt{t\_0}\right) \cdot \sqrt[3]{0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. rem-exp-log77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2} \]
    2. add-sqr-sqrt39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}\right)}^{2} \]
    3. add-cbrt-cube35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\sqrt[3]{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    4. add-sqr-sqrt35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    5. cbrt-prod39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    6. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\sqrt[3]{\color{blue}{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    7. associate-*l*39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
    8. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  6. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
  7. Step-by-step derivation
    1. add-sqr-sqrt39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{\left(\sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}} \cdot \sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}}\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
    2. pow239.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{{\left(\sqrt{\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}}\right)}^{2}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  8. Applied egg-rr39.2%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\color{blue}{{\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  9. Step-by-step derivation
    1. *-un-lft-identity39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(1 \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  10. Applied egg-rr39.2%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(1 \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  11. Step-by-step derivation
    1. *-lft-identity39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
    2. associate-*r*39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
    3. *-commutative39.2%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  12. Simplified39.2%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}} \cdot \left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  13. Final simplification39.2%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left({\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.25}}\right)}^{2} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)\right)}^{2} \]
  14. Add Preprocessing

Alternative 3: 79.7% accurate, 0.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_1 := \sqrt{t\_0}\\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{t\_0} \cdot \left(t\_1 \cdot \sqrt[3]{t\_1}\right)\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))) (t_1 (sqrt t_0)))
   (+
    (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
    (pow (* b (cos (* (cbrt t_0) (* t_1 (cbrt t_1))))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_1 = sqrt(t_0);
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((cbrt(t_0) * (t_1 * cbrt(t_1))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI * 0.005555555555555556);
	double t_1 = Math.sqrt(t_0);
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.cbrt(t_0) * (t_1 * Math.cbrt(t_1))))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_1 = sqrt(t_0)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(cbrt(t_0) * Float64(t_1 * cbrt(t_1))))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[t$95$0], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[t$95$0, 1/3], $MachinePrecision] * N[(t$95$1 * N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \sqrt{t\_0}\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{t\_0} \cdot \left(t\_1 \cdot \sqrt[3]{t\_1}\right)\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. rem-exp-log77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2} \]
    2. add-sqr-sqrt39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}\right)}^{2} \]
    3. add-cbrt-cube35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\sqrt[3]{\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    4. add-sqr-sqrt35.6%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    5. cbrt-prod39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right)} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    6. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\sqrt[3]{\color{blue}{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right) \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2} \]
    7. associate-*l*39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
    8. rem-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\color{blue}{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2} \]
  6. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}} \cdot \sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}\right)}^{2} \]
  7. Final simplification39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}}\right)\right)\right)}^{2} \]
  8. Add Preprocessing

Alternative 4: 79.7% accurate, 0.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))) 2.0)
  (pow (* b (cos (exp (log (* angle_m (* PI 0.005555555555555556)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556)))))), 2.0) + pow((b * cos(exp(log((angle_m * (((double) M_PI) * 0.005555555555555556)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556)))))), 2.0) + Math.pow((b * Math.cos(Math.exp(Math.log((angle_m * (Math.PI * 0.005555555555555556)))))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556)))))), 2.0) + math.pow((b * math.cos(math.exp(math.log((angle_m * (math.pi * 0.005555555555555556)))))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) ^ 2.0) + (Float64(b * cos(exp(log(Float64(angle_m * Float64(pi * 0.005555555555555556)))))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[Exp[N[Log[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. expm1-log1p-u39.2%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{angle}{180} \cdot \pi\right)\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    2. expm1-undefine32.3%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{angle}{180} \cdot \pi\right)} - 1\right)}\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    3. associate-*l/32.3%

      \[\leadsto {\left(a \cdot \sin \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{angle \cdot \pi}{180}}\right)} - 1\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    4. associate-*r/32.3%

      \[\leadsto {\left(a \cdot \sin \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \frac{\pi}{180}}\right)} - 1\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    5. div-inv32.3%

      \[\leadsto {\left(a \cdot \sin \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)} - 1\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    6. metadata-eval32.3%

      \[\leadsto {\left(a \cdot \sin \left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)} - 1\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
  6. Applied egg-rr32.3%

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} - 1\right)}\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
  7. Step-by-step derivation
    1. expm1-define39.2%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    2. associate-*r*39.2%

      \[\leadsto {\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    3. *-commutative39.2%

      \[\leadsto {\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
    4. associate-*r*39.2%

      \[\leadsto {\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
  8. Simplified39.2%

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
  9. Final simplification39.2%

    \[\leadsto {\left(a \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \]
  10. Add Preprocessing

Alternative 5: 79.7% accurate, 0.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
  (pow (* b (cos (exp (log (* angle_m (* PI 0.005555555555555556)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(exp(log((angle_m * (((double) M_PI) * 0.005555555555555556)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(Math.exp(Math.log((angle_m * (Math.PI * 0.005555555555555556)))))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(math.exp(math.log((angle_m * (math.pi * 0.005555555555555556)))))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(exp(log(Float64(angle_m * Float64(pi * 0.005555555555555556)))))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos(exp(log((angle_m * (pi * 0.005555555555555556)))))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[Exp[N[Log[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Add Preprocessing

Alternative 6: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
  (pow (* b (cos (/ 1.0 (/ 180.0 (* angle_m PI))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((1.0 / (180.0 / (angle_m * math.pi))))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos((1.0 / (180.0 / (angle_m * pi))))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. clear-num77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}\right)}^{2} \]
  4. Applied egg-rr77.9%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}\right)}^{2} \]
  5. Add Preprocessing

Alternative 7: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot {\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}\right) \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
  (* b (* b (pow (cos (* angle_m (* PI 0.005555555555555556))) 2.0)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + (b * (b * pow(cos((angle_m * (((double) M_PI) * 0.005555555555555556))), 2.0)));
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + (b * (b * Math.pow(Math.cos((angle_m * (Math.PI * 0.005555555555555556))), 2.0)));
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + (b * (b * math.pow(math.cos((angle_m * (math.pi * 0.005555555555555556))), 2.0)))
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + Float64(b * Float64(b * (cos(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 2.0))))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + (b * (b * (cos((angle_m * (pi * 0.005555555555555556))) ^ 2.0)));
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * N[(b * N[Power[N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot {\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. unpow-prod-down39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{{b}^{2} \cdot {\cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2}} \]
    2. unpow239.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right)} \cdot {\cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2} \]
    3. associate-*l*39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{b \cdot \left(b \cdot {\cos \left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}^{2}\right)} \]
    4. rem-exp-log77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot {\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2}\right) \]
    5. pow277.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right) \]
    6. sqr-cos-a77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \]
    7. associate-*r*77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)\right)\right) \]
    8. metadata-eval77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right) \]
    9. div-inv77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\frac{angle \cdot \pi}{180}}\right)\right)\right) \]
    10. associate-*l/77.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(\frac{angle}{180} \cdot \pi\right)}\right)\right)\right) \]
    11. sqr-cos-a77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \color{blue}{\left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}\right) \]
    12. pow277.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + b \cdot \left(b \cdot \color{blue}{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{2}}\right) \]
  6. Applied egg-rr77.9%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{b \cdot \left(b \cdot {\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}\right)} \]
  7. Add Preprocessing

Alternative 8: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
  (pow (* b (cos (/ (* angle_m PI) 180.0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle_m * ((double) M_PI)) / 180.0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle_m * Math.PI) / 180.0))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle_m * math.pi) / 180.0))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle_m * pi) / 180.0))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
  4. Applied egg-rr77.8%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
  5. Add Preprocessing

Alternative 9: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI)))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 10: 79.8% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ {\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
   (pow (hypot (* a (sin t_0)) (* b (cos t_0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (((double) M_PI) * 0.005555555555555556);
	return pow(hypot((a * sin(t_0)), (b * cos(t_0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI * 0.005555555555555556);
	return Math.pow(Math.hypot((a * Math.sin(t_0)), (b * Math.cos(t_0))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = angle_m * (math.pi * 0.005555555555555556)
	return math.pow(math.hypot((a * math.sin(t_0)), (b * math.cos(t_0))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	return hypot(Float64(a * sin(t_0)), Float64(b * cos(t_0))) ^ 2.0
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	t_0 = angle_m * (pi * 0.005555555555555556);
	tmp = hypot((a * sin(t_0)), (b * cos(t_0))) ^ 2.0;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[Power[N[Sqrt[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Step-by-step derivation
    1. unpow277.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
    2. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    3. associate-/l*77.8%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    4. unpow277.8%

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
  3. Simplified77.8%

    \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Applied egg-rr77.8%

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}} \]
  6. Add Preprocessing

Alternative 11: 62.6% accurate, 1.3× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 2.5 \cdot 10^{+169}:\\ \;\;\;\;{b}^{2} \cdot {\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= a 2.5e+169)
   (* (pow b 2.0) (pow (cos (* PI (* angle_m 0.005555555555555556))) 2.0))
   (pow (* a (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 2.5e+169) {
		tmp = pow(b, 2.0) * pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 2.0);
	} else {
		tmp = pow((a * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 2.5e+169) {
		tmp = Math.pow(b, 2.0) * Math.pow(Math.cos((Math.PI * (angle_m * 0.005555555555555556))), 2.0);
	} else {
		tmp = Math.pow((a * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if a <= 2.5e+169:
		tmp = math.pow(b, 2.0) * math.pow(math.cos((math.pi * (angle_m * 0.005555555555555556))), 2.0)
	else:
		tmp = math.pow((a * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (a <= 2.5e+169)
		tmp = Float64((b ^ 2.0) * (cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.0));
	else
		tmp = Float64(a * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (a <= 2.5e+169)
		tmp = (b ^ 2.0) * (cos((pi * (angle_m * 0.005555555555555556))) ^ 2.0);
	else
		tmp = (a * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[a, 2.5e+169], N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{+169}:\\
\;\;\;\;{b}^{2} \cdot {\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.50000000000000009e169

    1. Initial program 76.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 56.7%

      \[\leadsto \color{blue}{{b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. associate-*r*56.7%

        \[\leadsto {b}^{2} \cdot {\cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}}^{2} \]
    7. Simplified56.7%

      \[\leadsto \color{blue}{{b}^{2} \cdot {\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}} \]

    if 2.50000000000000009e169 < a

    1. Initial program 94.8%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/94.7%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*94.8%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified94.8%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 58.2%

      \[\leadsto \color{blue}{{a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.2%

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2} \]
      3. associate-*r*58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.2%

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr85.6%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow285.6%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      7. associate-*r*85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
      8. *-commutative85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified85.6%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.5 \cdot 10^{+169}:\\ \;\;\;\;{b}^{2} \cdot {\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 62.6% accurate, 1.3× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ \mathbf{if}\;a \leq 2.1 \cdot 10^{+169}:\\ \;\;\;\;{b}^{2} \cdot {\cos t\_0}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI))))
   (if (<= a 2.1e+169)
     (* (pow b 2.0) (pow (cos t_0) 2.0))
     (pow (* a (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double tmp;
	if (a <= 2.1e+169) {
		tmp = pow(b, 2.0) * pow(cos(t_0), 2.0);
	} else {
		tmp = pow((a * sin(t_0)), 2.0);
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
	double tmp;
	if (a <= 2.1e+169) {
		tmp = Math.pow(b, 2.0) * Math.pow(Math.cos(t_0), 2.0);
	} else {
		tmp = Math.pow((a * Math.sin(t_0)), 2.0);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = 0.005555555555555556 * (angle_m * math.pi)
	tmp = 0
	if a <= 2.1e+169:
		tmp = math.pow(b, 2.0) * math.pow(math.cos(t_0), 2.0)
	else:
		tmp = math.pow((a * math.sin(t_0)), 2.0)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	tmp = 0.0
	if (a <= 2.1e+169)
		tmp = Float64((b ^ 2.0) * (cos(t_0) ^ 2.0));
	else
		tmp = Float64(a * sin(t_0)) ^ 2.0;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	t_0 = 0.005555555555555556 * (angle_m * pi);
	tmp = 0.0;
	if (a <= 2.1e+169)
		tmp = (b ^ 2.0) * (cos(t_0) ^ 2.0);
	else
		tmp = (a * sin(t_0)) ^ 2.0;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2.1e+169], N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
\mathbf{if}\;a \leq 2.1 \cdot 10^{+169}:\\
\;\;\;\;{b}^{2} \cdot {\cos t\_0}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.1000000000000001e169

    1. Initial program 76.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 56.7%

      \[\leadsto \color{blue}{{b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]

    if 2.1000000000000001e169 < a

    1. Initial program 94.8%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/94.7%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*94.8%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified94.8%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 58.2%

      \[\leadsto \color{blue}{{a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.2%

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2} \]
      3. associate-*r*58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.2%

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr85.6%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow285.6%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      7. associate-*r*85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
      8. *-commutative85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified85.6%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 79.8% accurate, 1.3× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {b}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow b 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {b}^{2}
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
    2. associate-*r/77.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} \]
    3. add-exp-log39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{180}\right)}\right)}\right)}^{2} \]
    4. div-inv39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \color{blue}{\left(\pi \cdot \frac{1}{180}\right)}\right)}\right)\right)}^{2} \]
    5. metadata-eval39.1%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.1%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} \]
  5. Taylor expanded in angle around 0 77.8%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\color{blue}{b}}^{2} \]
  6. Add Preprocessing

Alternative 14: 62.6% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ \mathbf{if}\;a \leq 2.1 \cdot 10^{+169}:\\ \;\;\;\;{\left(b \cdot \cos t\_0\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI))))
   (if (<= a 2.1e+169) (pow (* b (cos t_0)) 2.0) (pow (* a (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double tmp;
	if (a <= 2.1e+169) {
		tmp = pow((b * cos(t_0)), 2.0);
	} else {
		tmp = pow((a * sin(t_0)), 2.0);
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
	double tmp;
	if (a <= 2.1e+169) {
		tmp = Math.pow((b * Math.cos(t_0)), 2.0);
	} else {
		tmp = Math.pow((a * Math.sin(t_0)), 2.0);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = 0.005555555555555556 * (angle_m * math.pi)
	tmp = 0
	if a <= 2.1e+169:
		tmp = math.pow((b * math.cos(t_0)), 2.0)
	else:
		tmp = math.pow((a * math.sin(t_0)), 2.0)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	tmp = 0.0
	if (a <= 2.1e+169)
		tmp = Float64(b * cos(t_0)) ^ 2.0;
	else
		tmp = Float64(a * sin(t_0)) ^ 2.0;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	t_0 = 0.005555555555555556 * (angle_m * pi);
	tmp = 0.0;
	if (a <= 2.1e+169)
		tmp = (b * cos(t_0)) ^ 2.0;
	else
		tmp = (a * sin(t_0)) ^ 2.0;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2.1e+169], N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
\mathbf{if}\;a \leq 2.1 \cdot 10^{+169}:\\
\;\;\;\;{\left(b \cdot \cos t\_0\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.1000000000000001e169

    1. Initial program 76.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 56.7%

      \[\leadsto \color{blue}{{b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto {b}^{2} \cdot {\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2} \]
      2. associate-*r*56.7%

        \[\leadsto {b}^{2} \cdot {\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      3. unpow256.7%

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      4. unpow256.7%

        \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      5. swap-sqr56.7%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow256.7%

        \[\leadsto \color{blue}{{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      7. associate-*r*56.7%

        \[\leadsto {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
      8. *-commutative56.7%

        \[\leadsto {\left(b \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified56.7%

      \[\leadsto \color{blue}{{\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]

    if 2.1000000000000001e169 < a

    1. Initial program 94.8%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/94.7%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*94.8%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified94.8%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 58.2%

      \[\leadsto \color{blue}{{a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.2%

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2} \]
      3. associate-*r*58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.2%

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr85.6%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow285.6%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      7. associate-*r*85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
      8. *-commutative85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified85.6%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 62.9% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 2.3 \cdot 10^{+169}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= a 2.3e+169)
   (* b b)
   (pow (* a (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 2.3e+169) {
		tmp = b * b;
	} else {
		tmp = pow((a * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 2.3e+169) {
		tmp = b * b;
	} else {
		tmp = Math.pow((a * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if a <= 2.3e+169:
		tmp = b * b
	else:
		tmp = math.pow((a * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (a <= 2.3e+169)
		tmp = Float64(b * b);
	else
		tmp = Float64(a * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (a <= 2.3e+169)
		tmp = b * b;
	else
		tmp = (a * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[a, 2.3e+169], N[(b * b), $MachinePrecision], N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+169}:\\
\;\;\;\;b \cdot b\\

\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.2999999999999999e169

    1. Initial program 76.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.3%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.3%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 56.6%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow256.6%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr56.6%

      \[\leadsto \color{blue}{b \cdot b} \]

    if 2.2999999999999999e169 < a

    1. Initial program 94.8%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/94.7%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*94.8%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow294.8%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified94.8%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 58.2%

      \[\leadsto \color{blue}{{a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.2%

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2} \]
      3. associate-*r*58.2%

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.2%

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr85.6%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow285.6%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      7. associate-*r*85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
      8. *-commutative85.6%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified85.6%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 57.5% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;{\left({b}^{6}\right)}^{0.3333333333333333}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= a 7.2e+154) (* b b) (pow (pow b 6.0) 0.3333333333333333)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 7.2e+154) {
		tmp = b * b;
	} else {
		tmp = pow(pow(b, 6.0), 0.3333333333333333);
	}
	return tmp;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    real(8) :: tmp
    if (a <= 7.2d+154) then
        tmp = b * b
    else
        tmp = (b ** 6.0d0) ** 0.3333333333333333d0
    end if
    code = tmp
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 7.2e+154) {
		tmp = b * b;
	} else {
		tmp = Math.pow(Math.pow(b, 6.0), 0.3333333333333333);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if a <= 7.2e+154:
		tmp = b * b
	else:
		tmp = math.pow(math.pow(b, 6.0), 0.3333333333333333)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (a <= 7.2e+154)
		tmp = Float64(b * b);
	else
		tmp = (b ^ 6.0) ^ 0.3333333333333333;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (a <= 7.2e+154)
		tmp = b * b;
	else
		tmp = (b ^ 6.0) ^ 0.3333333333333333;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[a, 7.2e+154], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;b \cdot b\\

\mathbf{else}:\\
\;\;\;\;{\left({b}^{6}\right)}^{0.3333333333333333}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 7.2000000000000001e154

    1. Initial program 76.0%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.0%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.0%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.0%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.0%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.0%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 56.9%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow256.9%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr56.9%

      \[\leadsto \color{blue}{b \cdot b} \]

    if 7.2000000000000001e154 < a

    1. Initial program 95.4%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow295.4%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/95.4%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*95.4%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow295.4%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 40.4%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt40.4%

        \[\leadsto \color{blue}{\sqrt{{b}^{2}} \cdot \sqrt{{b}^{2}}} \]
      2. sqrt-unprod52.1%

        \[\leadsto \color{blue}{\sqrt{{b}^{2} \cdot {b}^{2}}} \]
      3. pow-prod-up52.1%

        \[\leadsto \sqrt{\color{blue}{{b}^{\left(2 + 2\right)}}} \]
      4. metadata-eval52.1%

        \[\leadsto \sqrt{{b}^{\color{blue}{4}}} \]
    7. Applied egg-rr52.1%

      \[\leadsto \color{blue}{\sqrt{{b}^{4}}} \]
    8. Step-by-step derivation
      1. sqrt-pow140.4%

        \[\leadsto \color{blue}{{b}^{\left(\frac{4}{2}\right)}} \]
      2. metadata-eval40.4%

        \[\leadsto {b}^{\color{blue}{2}} \]
      3. add-cbrt-cube51.9%

        \[\leadsto \color{blue}{\sqrt[3]{\left({b}^{2} \cdot {b}^{2}\right) \cdot {b}^{2}}} \]
      4. pow1/351.9%

        \[\leadsto \color{blue}{{\left(\left({b}^{2} \cdot {b}^{2}\right) \cdot {b}^{2}\right)}^{0.3333333333333333}} \]
      5. pow-prod-up51.9%

        \[\leadsto {\left(\color{blue}{{b}^{\left(2 + 2\right)}} \cdot {b}^{2}\right)}^{0.3333333333333333} \]
      6. metadata-eval51.9%

        \[\leadsto {\left({b}^{\color{blue}{4}} \cdot {b}^{2}\right)}^{0.3333333333333333} \]
      7. pow-prod-up51.9%

        \[\leadsto {\color{blue}{\left({b}^{\left(4 + 2\right)}\right)}}^{0.3333333333333333} \]
      8. metadata-eval51.9%

        \[\leadsto {\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} \]
    9. Applied egg-rr51.9%

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

Alternative 17: 57.5% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 1.6 \cdot 10^{+154}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{b}^{6}}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= a 1.6e+154) (* b b) (cbrt (pow b 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.6e+154) {
		tmp = b * b;
	} else {
		tmp = cbrt(pow(b, 6.0));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.6e+154) {
		tmp = b * b;
	} else {
		tmp = Math.cbrt(Math.pow(b, 6.0));
	}
	return tmp;
}
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (a <= 1.6e+154)
		tmp = Float64(b * b);
	else
		tmp = cbrt((b ^ 6.0));
	end
	return tmp
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.6e+154], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.6 \cdot 10^{+154}:\\
\;\;\;\;b \cdot b\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.6e154

    1. Initial program 76.0%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow276.0%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/76.0%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*76.0%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow276.0%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified76.0%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 56.9%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow256.9%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr56.9%

      \[\leadsto \color{blue}{b \cdot b} \]

    if 1.6e154 < a

    1. Initial program 95.4%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. unpow295.4%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
      2. associate-*l/95.4%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      3. associate-/l*95.4%

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
      4. unpow295.4%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 40.4%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt40.4%

        \[\leadsto \color{blue}{\sqrt{{b}^{2}} \cdot \sqrt{{b}^{2}}} \]
      2. sqrt-unprod52.1%

        \[\leadsto \color{blue}{\sqrt{{b}^{2} \cdot {b}^{2}}} \]
      3. pow-prod-up52.1%

        \[\leadsto \sqrt{\color{blue}{{b}^{\left(2 + 2\right)}}} \]
      4. metadata-eval52.1%

        \[\leadsto \sqrt{{b}^{\color{blue}{4}}} \]
    7. Applied egg-rr52.1%

      \[\leadsto \color{blue}{\sqrt{{b}^{4}}} \]
    8. Step-by-step derivation
      1. sqrt-pow140.4%

        \[\leadsto \color{blue}{{b}^{\left(\frac{4}{2}\right)}} \]
      2. metadata-eval40.4%

        \[\leadsto {b}^{\color{blue}{2}} \]
      3. add-cbrt-cube51.9%

        \[\leadsto \color{blue}{\sqrt[3]{\left({b}^{2} \cdot {b}^{2}\right) \cdot {b}^{2}}} \]
      4. pow1/351.9%

        \[\leadsto \color{blue}{{\left(\left({b}^{2} \cdot {b}^{2}\right) \cdot {b}^{2}\right)}^{0.3333333333333333}} \]
      5. pow-prod-up51.9%

        \[\leadsto {\left(\color{blue}{{b}^{\left(2 + 2\right)}} \cdot {b}^{2}\right)}^{0.3333333333333333} \]
      6. metadata-eval51.9%

        \[\leadsto {\left({b}^{\color{blue}{4}} \cdot {b}^{2}\right)}^{0.3333333333333333} \]
      7. pow-prod-up51.9%

        \[\leadsto {\color{blue}{\left({b}^{\left(4 + 2\right)}\right)}}^{0.3333333333333333} \]
      8. metadata-eval51.9%

        \[\leadsto {\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} \]
    9. Applied egg-rr51.9%

      \[\leadsto \color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} \]
    10. Step-by-step derivation
      1. unpow1/351.9%

        \[\leadsto \color{blue}{\sqrt[3]{{b}^{6}}} \]
    11. Simplified51.9%

      \[\leadsto \color{blue}{\sqrt[3]{{b}^{6}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 56.9% accurate, 139.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ b \cdot b \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return b * b;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    code = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return b * b;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return b * b
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64(b * b)
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = b * b;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
b \cdot b
\end{array}
Derivation
  1. Initial program 77.8%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Step-by-step derivation
    1. unpow277.8%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)} \]
    2. associate-*l/77.8%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    3. associate-/l*77.8%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    4. unpow277.8%

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
  3. Simplified77.8%

    \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Taylor expanded in angle around 0 55.4%

    \[\leadsto \color{blue}{{b}^{2}} \]
  6. Step-by-step derivation
    1. unpow255.4%

      \[\leadsto \color{blue}{b \cdot b} \]
  7. Applied egg-rr55.4%

    \[\leadsto \color{blue}{b \cdot b} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024181 
(FPCore (a b angle)
  :name "ab-angle->ABCF A"
  :precision binary64
  (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))