ab-angle->ABCF C

Percentage Accurate: 79.3% → 79.2%
Time: 14.3s
Alternatives: 8
Speedup: 2.0×

Specification

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin 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 8 alternatives:

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

Initial Program: 79.3% accurate, 1.0× speedup?

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

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

Alternative 1: 79.2% accurate, 0.8× speedup?

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

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

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u66.5%

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

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

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    4. Applied egg-rr66.5%

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \left(a \cdot {\cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}^{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      9. expm1-log1p-u66.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      8. sqr-cos-a82.3%

        \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      9. *-commutative82.3%

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      10. *-commutative82.3%

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right)\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      11. associate-*l*82.2%

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

      \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    9. Step-by-step derivation
      1. associate-*r*82.3%

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

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    10. Simplified82.3%

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

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      2. expm1-undefine66.5%

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

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

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)} - 1\right)\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      5. *-commutative66.5%

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

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

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

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

        \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \color{blue}{\left(angle \cdot 0.005555555555555556\right)}\right)\right)\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    14. Simplified66.5%

      \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    15. Add Preprocessing

    Alternative 2: 79.2% accurate, 1.3× speedup?

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

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

        \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. expm1-log1p-u66.5%

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

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

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      4. Applied egg-rr66.5%

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

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

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

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

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

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

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

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

          \[\leadsto a \cdot \left(a \cdot {\cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}^{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        9. expm1-log1p-u66.5%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto a \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        8. sqr-cos-a82.3%

          \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        9. *-commutative82.3%

          \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        10. *-commutative82.3%

          \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right)\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        11. associate-*l*82.2%

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

        \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      9. Step-by-step derivation
        1. associate-*r*82.3%

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

          \[\leadsto a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      10. Simplified82.3%

        \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      11. Final simplification82.3%

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

      Alternative 3: 79.3% accurate, 1.3× speedup?

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

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

          \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. expm1-log1p-u66.5%

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

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

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        4. Applied egg-rr66.5%

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

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

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

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

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

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

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

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

            \[\leadsto a \cdot \left(a \cdot {\cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}^{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
          9. expm1-log1p-u66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a \cdot \left(a \cdot \frac{\color{blue}{1} + \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right) + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
          4. distribute-lft-out82.2%

            \[\leadsto a \cdot \left(a \cdot \frac{1 + \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556 + \pi \cdot 0.005555555555555556\right)\right)}}{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
          5. distribute-lft-out82.2%

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

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

          \[\leadsto a \cdot \left(a \cdot \color{blue}{\frac{1 + \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}{2}}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        11. Final simplification82.2%

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

        Alternative 4: 62.6% accurate, 2.0× speedup?

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

          1. Initial program 79.7%

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

              \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
            2. Add Preprocessing
            3. Taylor expanded in a around inf 62.6%

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

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

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

                \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
              4. swap-sqr62.6%

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

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

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

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

            if 2.9999999999999999e141 < b

            1. Initial program 93.9%

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

                \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
              2. Add Preprocessing
              3. Taylor expanded in a around 0 57.1%

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

                  \[\leadsto {b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot angle\right)}\right)}^{2} \]
                2. unpow257.1%

                  \[\leadsto {b}^{2} \cdot \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
                3. unpow257.1%

                  \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \]
                4. swap-sqr76.7%

                  \[\leadsto \color{blue}{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
                5. unpow276.7%

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

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

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

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

            Alternative 5: 57.4% accurate, 2.0× speedup?

            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 4.4 \cdot 10^{+159}:\\ \;\;\;\;{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{a}^{6}}\\ \end{array} \end{array} \]
            angle_m = (fabs.f64 angle)
            (FPCore (a b angle_m)
             :precision binary64
             (if (<= b 4.4e+159)
               (pow (* a (cos (* 0.005555555555555556 (* PI angle_m)))) 2.0)
               (cbrt (pow a 6.0))))
            angle_m = fabs(angle);
            double code(double a, double b, double angle_m) {
            	double tmp;
            	if (b <= 4.4e+159) {
            		tmp = pow((a * cos((0.005555555555555556 * (((double) M_PI) * angle_m)))), 2.0);
            	} else {
            		tmp = cbrt(pow(a, 6.0));
            	}
            	return tmp;
            }
            
            angle_m = Math.abs(angle);
            public static double code(double a, double b, double angle_m) {
            	double tmp;
            	if (b <= 4.4e+159) {
            		tmp = Math.pow((a * Math.cos((0.005555555555555556 * (Math.PI * angle_m)))), 2.0);
            	} else {
            		tmp = Math.cbrt(Math.pow(a, 6.0));
            	}
            	return tmp;
            }
            
            angle_m = abs(angle)
            function code(a, b, angle_m)
            	tmp = 0.0
            	if (b <= 4.4e+159)
            		tmp = Float64(a * cos(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 2.0;
            	else
            		tmp = cbrt((a ^ 6.0));
            	end
            	return tmp
            end
            
            angle_m = N[Abs[angle], $MachinePrecision]
            code[a_, b_, angle$95$m_] := If[LessEqual[b, 4.4e+159], N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
            
            \begin{array}{l}
            angle_m = \left|angle\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;b \leq 4.4 \cdot 10^{+159}:\\
            \;\;\;\;{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
            
            \mathbf{else}:\\
            \;\;\;\;\sqrt[3]{{a}^{6}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if b < 4.3999999999999998e159

              1. Initial program 79.7%

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

                  \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                2. Add Preprocessing
                3. Taylor expanded in a around inf 60.7%

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

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

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

                    \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
                  4. swap-sqr60.7%

                    \[\leadsto \color{blue}{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
                  5. unpow260.7%

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

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

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

                if 4.3999999999999998e159 < b

                1. Initial program 99.5%

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

                    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                  2. Add Preprocessing
                  3. Taylor expanded in angle around 0 39.7%

                    \[\leadsto \color{blue}{{a}^{2}} \]
                  4. Step-by-step derivation
                    1. add-sqr-sqrt39.7%

                      \[\leadsto \color{blue}{\sqrt{{a}^{2}} \cdot \sqrt{{a}^{2}}} \]
                    2. sqrt-unprod45.7%

                      \[\leadsto \color{blue}{\sqrt{{a}^{2} \cdot {a}^{2}}} \]
                    3. pow-prod-up45.7%

                      \[\leadsto \sqrt{\color{blue}{{a}^{\left(2 + 2\right)}}} \]
                    4. metadata-eval45.7%

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

                    \[\leadsto \color{blue}{\sqrt{{a}^{4}}} \]
                  6. Step-by-step derivation
                    1. add-cbrt-cube48.7%

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

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

                      \[\leadsto {\left(\color{blue}{{a}^{4}} \cdot \sqrt{{a}^{4}}\right)}^{0.3333333333333333} \]
                    4. sqrt-pow148.7%

                      \[\leadsto {\left({a}^{4} \cdot \color{blue}{{a}^{\left(\frac{4}{2}\right)}}\right)}^{0.3333333333333333} \]
                    5. metadata-eval48.7%

                      \[\leadsto {\left({a}^{4} \cdot {a}^{\color{blue}{2}}\right)}^{0.3333333333333333} \]
                    6. pow-prod-up48.7%

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

                      \[\leadsto {\left({a}^{\color{blue}{6}}\right)}^{0.3333333333333333} \]
                  7. Applied egg-rr48.7%

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

                      \[\leadsto \color{blue}{\sqrt[3]{{a}^{6}}} \]
                  9. Simplified48.7%

                    \[\leadsto \color{blue}{\sqrt[3]{{a}^{6}}} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification59.2%

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

                Alternative 6: 79.3% accurate, 2.0× speedup?

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

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

                    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. expm1-log1p-u66.5%

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

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

                      \[\leadsto {\left(a \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
                  4. Applied egg-rr66.5%

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

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

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

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

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

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

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

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

                      \[\leadsto a \cdot \left(a \cdot {\cos \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}^{2}\right) + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
                    9. expm1-log1p-u66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 7: 57.6% accurate, 2.0× speedup?

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

                    1. Initial program 79.3%

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

                        \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                      2. Add Preprocessing
                      3. Taylor expanded in angle around 0 60.6%

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

                          \[\leadsto \color{blue}{a \cdot a} \]
                      5. Applied egg-rr60.6%

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

                      if 4.69999999999999983e154 < b

                      1. Initial program 99.5%

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

                          \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                        2. Add Preprocessing
                        3. Taylor expanded in angle around 0 41.0%

                          \[\leadsto \color{blue}{{a}^{2}} \]
                        4. Step-by-step derivation
                          1. add-sqr-sqrt41.0%

                            \[\leadsto \color{blue}{\sqrt{{a}^{2}} \cdot \sqrt{{a}^{2}}} \]
                          2. sqrt-unprod46.4%

                            \[\leadsto \color{blue}{\sqrt{{a}^{2} \cdot {a}^{2}}} \]
                          3. pow-prod-up46.4%

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

                            \[\leadsto \sqrt{{a}^{\color{blue}{4}}} \]
                        5. Applied egg-rr46.4%

                          \[\leadsto \color{blue}{\sqrt{{a}^{4}}} \]
                        6. Step-by-step derivation
                          1. add-cbrt-cube49.0%

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

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

                            \[\leadsto {\left(\color{blue}{{a}^{4}} \cdot \sqrt{{a}^{4}}\right)}^{0.3333333333333333} \]
                          4. sqrt-pow149.0%

                            \[\leadsto {\left({a}^{4} \cdot \color{blue}{{a}^{\left(\frac{4}{2}\right)}}\right)}^{0.3333333333333333} \]
                          5. metadata-eval49.0%

                            \[\leadsto {\left({a}^{4} \cdot {a}^{\color{blue}{2}}\right)}^{0.3333333333333333} \]
                          6. pow-prod-up49.0%

                            \[\leadsto {\color{blue}{\left({a}^{\left(4 + 2\right)}\right)}}^{0.3333333333333333} \]
                          7. metadata-eval49.0%

                            \[\leadsto {\left({a}^{\color{blue}{6}}\right)}^{0.3333333333333333} \]
                        7. Applied egg-rr49.0%

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

                            \[\leadsto \color{blue}{\sqrt[3]{{a}^{6}}} \]
                        9. Simplified49.0%

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

                      Alternative 8: 56.8% accurate, 139.0× speedup?

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

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

                          \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
                        2. Add Preprocessing
                        3. Taylor expanded in angle around 0 57.9%

                          \[\leadsto \color{blue}{{a}^{2}} \]
                        4. Step-by-step derivation
                          1. unpow257.9%

                            \[\leadsto \color{blue}{a \cdot a} \]
                        5. Applied egg-rr57.9%

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

                        Reproduce

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