ab-angle->ABCF A

Percentage Accurate: 80.0% → 79.1%
Time: 15.5s
Alternatives: 12
Speedup: 1.0×

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 12 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: 80.0% 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.1% accurate, 0.8× speedup?

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

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

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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. Step-by-step derivation
    1. associate-*r/74.6%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.2% accurate, 1.0× speedup?

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

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

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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. Step-by-step derivation
    1. associate-*r/74.6%

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

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

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

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

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

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

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

Alternative 3: 80.1% accurate, 1.0× speedup?

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

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

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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-rr74.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 4: 79.0% accurate, 1.0× speedup?

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

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

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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. Step-by-step derivation
    1. associate-*r/74.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(\sqrt{a} \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} \cdot a + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  10. Final simplification36.0%

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

Alternative 5: 79.1% accurate, 1.3× speedup?

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

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

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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. Step-by-step derivation
    1. associate-*r/74.6%

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

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

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

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

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

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

    \[\leadsto \left(\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot a + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  8. Final simplification73.9%

    \[\leadsto a \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) + {b}^{2} \]
  9. Add Preprocessing

Alternative 6: 80.0% accurate, 1.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \mathsf{fma}\left(b, b, {\left(a\_m \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\right) \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (fma b b (pow (* a_m (sin (* angle (* PI 0.005555555555555556)))) 2.0)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	return fma(b, b, pow((a_m * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0));
}
a_m = abs(a)
function code(a_m, b, angle)
	return fma(b, b, (Float64(a_m * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0))
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := N[(b * b + N[Power[N[(a$95$m * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|

\\
\mathsf{fma}\left(b, b, {\left(a\_m \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 74.6%

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

      \[\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/74.6%

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

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

      \[\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. Simplified74.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. Step-by-step derivation
    1. +-commutative74.8%

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

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

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

      \[\leadsto \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)} + {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} \]
    5. *-commutative74.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right), b, {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}\right)} \]
  6. Applied egg-rr74.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), b, {\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\right)} \]
  7. Taylor expanded in angle around 0 73.9%

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

Alternative 7: 68.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 72.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. unpow272.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/72.2%

        \[\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*72.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. unpow272.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. Simplified72.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. Step-by-step derivation
      1. associate-*r/72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot {\cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}}^{2} \]
      5. metadata-eval56.6%

        \[\leadsto \left(b \cdot b\right) \cdot {\cos \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)}^{2} \]
      6. associate-/r/56.6%

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

        \[\leadsto \left(b \cdot b\right) \cdot {\cos \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}}^{2} \]
      8. *-lft-identity56.7%

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

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

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

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

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

    if 1.24999999999999999e131 < a

    1. Initial program 93.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. unpow293.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/93.6%

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r/93.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a} \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \cdot a + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} \]
    9. Taylor expanded in a around inf 51.4%

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)}^{2} \]
      6. associate-/r/51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}}^{2} \]
      8. *-lft-identity51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      10. swap-sqr72.8%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      11. unpow272.8%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}} \]
    11. Simplified73.1%

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

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

Alternative 8: 69.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 72.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. unpow272.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/72.2%

        \[\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*72.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. unpow272.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. Simplified72.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 a around 0 56.6%

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

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

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

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

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

    if 9.6000000000000004e132 < a

    1. Initial program 93.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. unpow293.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/93.6%

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r/93.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a} \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \cdot a + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} \]
    9. Taylor expanded in a around inf 51.4%

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)}^{2} \]
      6. associate-/r/51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}}^{2} \]
      8. *-lft-identity51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      10. swap-sqr72.8%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      11. unpow272.8%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}} \]
    11. Simplified73.1%

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

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

Alternative 9: 68.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 2.4 \cdot 10^{+130}:\\
\;\;\;\;b \cdot b\\

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


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

    1. Initial program 72.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. unpow272.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/72.2%

        \[\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*72.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. unpow272.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. Simplified72.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 55.7%

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

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

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

    if 2.40000000000000024e130 < a

    1. Initial program 93.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. unpow293.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/93.6%

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r/93.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a} \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \cdot a + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} \]
    9. Taylor expanded in a around inf 51.4%

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)}^{2} \]
      6. associate-/r/51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}}^{2} \]
      8. *-lft-identity51.3%

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      10. swap-sqr72.8%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)} \]
      11. unpow272.8%

        \[\leadsto \color{blue}{{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}} \]
    11. Simplified73.1%

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

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

Alternative 10: 69.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 72.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. unpow272.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/72.2%

        \[\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*72.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. unpow272.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. Simplified72.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 55.7%

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

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

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

    if 1e133 < a

    1. Initial program 93.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. unpow293.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/93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 11: 56.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 3.1 \cdot 10^{+155}:\\
\;\;\;\;b \cdot b\\

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


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

    1. Initial program 72.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. unpow272.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/72.2%

        \[\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*72.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. unpow272.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. Simplified72.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 55.2%

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

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

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

    if 3.09999999999999989e155 < a

    1. Initial program 99.5%

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

        \[\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/99.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*99.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. unpow299.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. Simplified99.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 33.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\left(\sqrt{{b}^{4}} \cdot \sqrt{{b}^{4}}\right) \cdot \sqrt{{b}^{4}}\right)}^{0.3333333333333333}} \]
      3. add-sqr-sqrt33.3%

        \[\leadsto {\left(\color{blue}{{b}^{4}} \cdot \sqrt{{b}^{4}}\right)}^{0.3333333333333333} \]
      4. sqrt-pow133.3%

        \[\leadsto {\left({b}^{4} \cdot \color{blue}{{b}^{\left(\frac{4}{2}\right)}}\right)}^{0.3333333333333333} \]
      5. metadata-eval33.3%

        \[\leadsto {\left({b}^{4} \cdot {b}^{\color{blue}{2}}\right)}^{0.3333333333333333} \]
      6. pow-prod-up33.3%

        \[\leadsto {\color{blue}{\left({b}^{\left(4 + 2\right)}\right)}}^{0.3333333333333333} \]
      7. metadata-eval33.3%

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

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

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

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

Alternative 12: 56.0% accurate, 139.0× speedup?

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

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

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

      \[\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/74.6%

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024163 
(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)))