ab-angle->ABCF C

Percentage Accurate: 79.4% → 79.3%
Time: 13.9s
Alternatives: 13
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 13 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.4% 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.3% accurate, 0.7× speedup?

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\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. metadata-eval82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 79.3% accurate, 1.0× speedup?

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\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. metadata-eval82.4%

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

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

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

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

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

      Alternative 3: 79.4% accurate, 1.0× speedup?

      \[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(\frac{\pi \cdot angle\_m}{180}\right)\right)}^{2} + {\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
       (+
        (pow (* a (cos (/ (* PI angle_m) 180.0))) 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 pow((a * cos(((((double) M_PI) * angle_m) / 180.0))), 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 Math.pow((a * Math.cos(((Math.PI * angle_m) / 180.0))), 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 math.pow((a * math.cos(((math.pi * angle_m) / 180.0))), 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 * cos(Float64(Float64(pi * angle_m) / 180.0))) ^ 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 * cos(((pi * angle_m) / 180.0))) ^ 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[Power[N[(a * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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|
      
      \\
      {\left(a \cdot \cos \left(\frac{\pi \cdot angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
      \end{array}
      
      Derivation
      1. Initial program 82.4%

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

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

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

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

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

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

        Alternative 4: 79.4% 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 82.4%

          \[{\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: 79.4% accurate, 1.0× speedup?

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

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

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

              \[\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-inv82.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{angle}{180}}\right)\right)}^{2} \]
            3. clear-num82.3%

              \[\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-inv82.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(\frac{\pi}{\frac{180}{angle}}\right)}\right)}^{2} \]
          4. Applied egg-rr82.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(\frac{\pi}{\frac{180}{angle}}\right)}\right)}^{2} \]
          5. Add Preprocessing

          Alternative 6: 79.4% 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(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
             (+ (pow (* b (sin t_0)) 2.0) (pow (* 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((b * sin(t_0)), 2.0) + pow((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((b * Math.sin(t_0)), 2.0) + Math.pow((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((b * math.sin(t_0)), 2.0) + math.pow((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 Float64((Float64(b * sin(t_0)) ^ 2.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 = ((b * sin(t_0)) ^ 2.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[(N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[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)\\
          {\left(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \cos t\_0\right)}^{2}
          \end{array}
          \end{array}
          
          Derivation
          1. Initial program 82.4%

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

              \[\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. Final simplification82.3%

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

            Alternative 7: 63.1% accurate, 1.3× speedup?

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

              1. Initial program 80.0%

                \[{\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.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 inf 60.7%

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

                if 2.60000000000000014e146 < b

                1. Initial program 97.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. Simplified97.7%

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

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

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

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

                    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\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. metadata-eval97.7%

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

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

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

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

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

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

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

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

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

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

                      \[\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)} \]
                    6. swap-sqr81.3%

                      \[\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)} \]
                    7. unpow281.3%

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

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

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

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

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

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

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

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

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

                Alternative 8: 79.3% accurate, 1.3× speedup?

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

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

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

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

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

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

                    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\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. metadata-eval82.4%

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

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

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

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

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

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

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

                  Alternative 9: 79.4% 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}^{2} \end{array} \]
                  angle_m = (fabs.f64 angle)
                  (FPCore (a b angle_m)
                   :precision binary64
                   (+ (pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0) (pow a 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) + pow(a, 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) + Math.pow(a, 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) + math.pow(a, 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) + (a ^ 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 ^ 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[Power[a, 2.0], $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}^{2}
                  \end{array}
                  
                  Derivation
                  1. Initial program 82.4%

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

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

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

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

                    Alternative 10: 63.1% accurate, 2.0× speedup?

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

                      1. Initial program 80.0%

                        \[{\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.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 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 6.70000000000000007e146 < b

                        1. Initial program 97.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. Simplified97.7%

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

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

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

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

                            \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\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. metadata-eval97.7%

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

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

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

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

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

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

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

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

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

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

                              \[\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)} \]
                            6. swap-sqr81.3%

                              \[\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)} \]
                            7. unpow281.3%

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

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

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

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

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

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

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

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

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

                        Alternative 11: 63.1% accurate, 2.0× speedup?

                        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ \mathbf{if}\;b \leq 2.3 \cdot 10^{+147}:\\ \;\;\;\;{\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 (* (* PI angle_m) 0.005555555555555556)))
                           (if (<= b 2.3e+147) (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) * 0.005555555555555556;
                        	double tmp;
                        	if (b <= 2.3e+147) {
                        		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 = (Math.PI * angle_m) * 0.005555555555555556;
                        	double tmp;
                        	if (b <= 2.3e+147) {
                        		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 = (math.pi * angle_m) * 0.005555555555555556
                        	tmp = 0
                        	if b <= 2.3e+147:
                        		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(Float64(pi * angle_m) * 0.005555555555555556)
                        	tmp = 0.0
                        	if (b <= 2.3e+147)
                        		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 = (pi * angle_m) * 0.005555555555555556;
                        	tmp = 0.0;
                        	if (b <= 2.3e+147)
                        		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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[b, 2.3e+147], 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 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
                        \mathbf{if}\;b \leq 2.3 \cdot 10^{+147}:\\
                        \;\;\;\;{\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.2999999999999999e147

                          1. Initial program 80.0%

                            \[{\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.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 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 2.2999999999999999e147 < b

                            1. Initial program 97.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. Simplified97.7%

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

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

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

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

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

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

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

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

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

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

                            Alternative 12: 57.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 13: 57.6% 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.4%

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

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

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

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

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

                                Reproduce

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