ab-angle->ABCF C

Percentage Accurate: 80.0% → 79.9%
Time: 17.3s
Alternatives: 9
Speedup: N/A×

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 9 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: 79.9% accurate, 1.0× speedup?

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

\\
a \cdot a + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 74.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. Simplified74.0%

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

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

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

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

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

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

    Alternative 2: 58.7% accurate, 1.9× speedup?

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

      1. Initial program 72.6%

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

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

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

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

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

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

            \[\leadsto \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)} \cdot {b}^{2} \]
          6. unpow240.6%

            \[\leadsto \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) \cdot \color{blue}{\left(b \cdot b\right)} \]
          7. swap-sqr48.1%

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

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

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

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

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

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

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

        if 1.5499999999999999e-152 < a

        1. Initial program 76.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. Simplified76.5%

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

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

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

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

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

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

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

        Alternative 3: 58.6% accurate, 2.0× speedup?

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

          1. Initial program 72.6%

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

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

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

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

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

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

                \[\leadsto \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)} \cdot {b}^{2} \]
              6. unpow240.6%

                \[\leadsto \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) \cdot \color{blue}{\left(b \cdot b\right)} \]
              7. swap-sqr48.1%

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

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

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

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

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

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

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

            if 2.4999999999999999e-148 < a

            1. Initial program 76.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. Simplified76.5%

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

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

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

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

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

                \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} \]
              8. Taylor expanded in angle around 0 74.2%

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

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

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

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

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

            Alternative 4: 67.3% accurate, 2.0× speedup?

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

              1. Initial program 71.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. Add Preprocessing
              3. Step-by-step derivation
                1. associate-*r/71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6.70000000000000032e-118 < b

              1. Initial program 79.8%

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

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

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

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

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

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

                  \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} \]
                8. Taylor expanded in angle around 0 77.3%

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

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

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

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

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

              Alternative 5: 79.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 6: 79.9% accurate, 2.0× speedup?

                \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a + {\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) (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) + 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) + 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) + 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 * a) + (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) + ((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 * a), $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 a + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
                \end{array}
                
                Derivation
                1. Initial program 74.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. Simplified74.0%

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

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

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

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

                  Alternative 7: 67.4% accurate, 3.6× speedup?

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

                    1. Initial program 71.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. Simplified71.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 angle around 0 53.5%

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

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

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

                      if 6.70000000000000032e-118 < b

                      1. Initial program 79.8%

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

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

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

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

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

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

                          \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} \]
                        8. Taylor expanded in angle around 0 77.3%

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

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

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

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

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

                      Alternative 8: 67.4% accurate, 3.6× speedup?

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

                        1. Initial program 71.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. Simplified71.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 angle around 0 53.5%

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

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

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

                          if 9.49999999999999931e-118 < b

                          1. Initial program 79.8%

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

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

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

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

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

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

                              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} \]
                            8. Taylor expanded in angle around 0 77.3%

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

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

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

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

                          Alternative 9: 57.1% 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 74.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. Simplified74.0%

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

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

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

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

                            Reproduce

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