ab-angle->ABCF C

Percentage Accurate: 80.0% → 80.0%
Time: 14.7s
Alternatives: 10
Speedup: 1.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 10 alternatives:

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

Initial Program: 80.0% 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: 80.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{angle\_m \cdot 0.005555555555555556}\\
{\left(a \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(t\_0 \cdot \left(\pi \cdot t\_0\right)\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Simplified81.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. metadata-eval81.2%

        \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
      2. div-inv81.2%

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

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

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

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

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

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

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

        \[\leadsto {\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 \color{blue}{0.005555555555555556}\right)\right)\right)}^{2} \]
      5. add-sqr-sqrt37.8%

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

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

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

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

    Alternative 2: 80.0% accurate, 0.7× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\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))))
       (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin (expm1 (log1p 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 pow((a * cos(t_0)), 2.0) + pow((b * sin(expm1(log1p(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 Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(Math.expm1(Math.log1p(t_0)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	t_0 = math.pi * (angle_m * 0.005555555555555556)
    	return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(math.expm1(math.log1p(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 * cos(t_0)) ^ 2.0) + (Float64(b * sin(expm1(log1p(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[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $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)\\
    {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)}^{2}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 81.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. Simplified81.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. metadata-eval81.2%

          \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
        2. div-inv81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 80.0% accurate, 1.0× speedup?

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

            \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
          2. div-inv81.2%

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

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

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

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

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

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

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

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

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

        Alternative 4: 80.0% accurate, 1.0× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ {\left(a \cdot \cos t\_0\right)}^{2} + {\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 180.0))))
           (+ (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 = ((double) M_PI) * (angle_m / 180.0);
        	return pow((a * cos(t_0)), 2.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 / 180.0);
        	return Math.pow((a * Math.cos(t_0)), 2.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 / 180.0)
        	return math.pow((a * math.cos(t_0)), 2.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 / 180.0))
        	return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
        end
        
        angle_m = abs(angle);
        function tmp = code(a, b, angle_m)
        	t_0 = pi * (angle_m / 180.0);
        	tmp = ((a * cos(t_0)) ^ 2.0) + ((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 / 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}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        t_0 := \pi \cdot \frac{angle\_m}{180}\\
        {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
        \end{array}
        \end{array}
        
        Derivation
        1. Initial program 81.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. Add Preprocessing
        3. Add Preprocessing

        Alternative 5: 80.0% accurate, 1.0× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ {\left(\mathsf{hypot}\left(b \cdot \sin t\_0, a \cdot \cos t\_0\right)\right)}^{2} \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
           (pow (hypot (* b (sin t_0)) (* a (cos 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 pow(hypot((b * sin(t_0)), (a * cos(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 Math.pow(Math.hypot((b * Math.sin(t_0)), (a * Math.cos(t_0))), 2.0);
        }
        
        angle_m = math.fabs(angle)
        def code(a, b, angle_m):
        	t_0 = math.pi * (angle_m * 0.005555555555555556)
        	return math.pow(math.hypot((b * math.sin(t_0)), (a * math.cos(t_0))), 2.0)
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
        	return hypot(Float64(b * sin(t_0)), Float64(a * cos(t_0))) ^ 2.0
        end
        
        angle_m = abs(angle);
        function tmp = code(a, b, angle_m)
        	t_0 = pi * (angle_m * 0.005555555555555556);
        	tmp = hypot((b * sin(t_0)), (a * cos(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[Power[N[Sqrt[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
        {\left(\mathsf{hypot}\left(b \cdot \sin t\_0, a \cdot \cos t\_0\right)\right)}^{2}
        \end{array}
        \end{array}
        
        Derivation
        1. Initial program 81.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. Simplified81.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. metadata-eval81.2%

              \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
            2. div-inv81.2%

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

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

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

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

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

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

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

              \[\leadsto {\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 \color{blue}{0.005555555555555556}\right)\right)\right)}^{2} \]
            5. add-sqr-sqrt37.8%

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

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

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

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

          Alternative 6: 80.0% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

                \[\leadsto \left(a \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)}\right) \cdot a + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
              2. associate-*r*80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 7: 53.6% accurate, 2.0× speedup?

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

              1. Initial program 79.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. Simplified79.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. Step-by-step derivation
                  1. metadata-eval79.5%

                    \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
                  2. div-inv79.6%

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

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

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

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

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

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

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

                    \[\leadsto {\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 \color{blue}{0.005555555555555556}\right)\right)\right)}^{2} \]
                  5. add-sqr-sqrt37.5%

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

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

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

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

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

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

                    \[\leadsto \left(b \cdot b\right) \cdot {\sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\sqrt{0.005555555555555556} \cdot \sqrt{0.005555555555555556}\right)}\right)}^{2} \]
                  4. rem-square-sqrt45.2%

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

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

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

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

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

                    \[\leadsto \left(b \cdot b\right) \cdot \color{blue}{\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \]
                  10. swap-sqr49.2%

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

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

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

                if 7.79999999999999982e-34 < a

                1. Initial program 87.1%

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

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

                      \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
                    2. div-inv87.1%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(a \cdot a\right) \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)} \]
                    7. swap-sqr76.8%

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

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

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

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

                Alternative 8: 53.5% accurate, 2.0× speedup?

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

                  1. Initial program 79.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. Simplified79.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 a around 0 45.2%

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

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

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

                        \[\leadsto \left(b \cdot b\right) \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)} \]
                      4. swap-sqr49.1%

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

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

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

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

                    if 7.20000000000000068e-33 < a

                    1. Initial program 87.1%

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

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

                          \[\leadsto {\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 \color{blue}{\frac{1}{180}}\right)\right)\right)}^{2} \]
                        2. div-inv87.1%

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(a \cdot a\right) \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)} \]
                        7. swap-sqr76.8%

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

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

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

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

                    Alternative 9: 79.9% 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 81.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. Simplified81.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. metadata-eval81.2%

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

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

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

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

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

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

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

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

                      Alternative 10: 56.9% 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 81.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. Simplified81.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 60.5%

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

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

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

                        Reproduce

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