ab-angle->ABCF C

Percentage Accurate: 80.1% → 80.0%
Time: 17.4s
Alternatives: 7
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 80.0% accurate, 2.0× speedup?

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

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

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Step-by-step derivation
    1. Simplified81.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 angle around 0 82.5%

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

        \[\leadsto {a}^{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 {a}^{2} + {\left(b \cdot \sin \left(\pi \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
      3. associate-*r/82.6%

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

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

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

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

    Alternative 2: 59.0% accurate, 1.9× speedup?

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

      1. Initial program 81.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. Simplified81.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 37.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 5.79999999999999981e-159 < a

        1. Initial program 82.2%

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

            \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
          2. Add Preprocessing
          3. Taylor expanded in angle around 0 82.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. add-sqr-sqrt38.5%

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 59.0% accurate, 2.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 5.4 \cdot 10^{-158}:\\ \;\;\;\;{\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(angle \cdot \left(b \cdot \pi\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
        (FPCore (a b angle)
         :precision binary64
         (if (<= a 5.4e-158)
           (pow (* b (sin (* 0.005555555555555556 (* PI angle)))) 2.0)
           (+ (* a a) (pow (* 0.005555555555555556 (* angle (* b PI))) 2.0))))
        double code(double a, double b, double angle) {
        	double tmp;
        	if (a <= 5.4e-158) {
        		tmp = pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle)))), 2.0);
        	} else {
        		tmp = (a * a) + pow((0.005555555555555556 * (angle * (b * ((double) M_PI)))), 2.0);
        	}
        	return tmp;
        }
        
        public static double code(double a, double b, double angle) {
        	double tmp;
        	if (a <= 5.4e-158) {
        		tmp = Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle)))), 2.0);
        	} else {
        		tmp = (a * a) + Math.pow((0.005555555555555556 * (angle * (b * Math.PI))), 2.0);
        	}
        	return tmp;
        }
        
        def code(a, b, angle):
        	tmp = 0
        	if a <= 5.4e-158:
        		tmp = math.pow((b * math.sin((0.005555555555555556 * (math.pi * angle)))), 2.0)
        	else:
        		tmp = (a * a) + math.pow((0.005555555555555556 * (angle * (b * math.pi))), 2.0)
        	return tmp
        
        function code(a, b, angle)
        	tmp = 0.0
        	if (a <= 5.4e-158)
        		tmp = Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) ^ 2.0;
        	else
        		tmp = Float64(Float64(a * a) + (Float64(0.005555555555555556 * Float64(angle * Float64(b * pi))) ^ 2.0));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b, angle)
        	tmp = 0.0;
        	if (a <= 5.4e-158)
        		tmp = (b * sin((0.005555555555555556 * (pi * angle)))) ^ 2.0;
        	else
        		tmp = (a * a) + ((0.005555555555555556 * (angle * (b * pi))) ^ 2.0);
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_, angle_] := If[LessEqual[a, 5.4e-158], N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq 5.4 \cdot 10^{-158}:\\
        \;\;\;\;{\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(angle \cdot \left(b \cdot \pi\right)\right)\right)}^{2}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < 5.3999999999999997e-158

          1. Initial program 81.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. Simplified81.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 37.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 5.3999999999999997e-158 < a

            1. Initial program 82.2%

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

                \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0 82.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. metadata-eval82.8%

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

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

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

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

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

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

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

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

                \[\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}\;a \leq 5.4 \cdot 10^{-158}:\\ \;\;\;\;{\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(angle \cdot \left(b \cdot \pi\right)\right)\right)}^{2}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 4: 80.1% accurate, 2.0× speedup?

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

              \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
            2. Step-by-step derivation
              1. Simplified81.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 angle around 0 82.5%

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

                  \[\leadsto {a}^{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 {a}^{2} + {\left(b \cdot \sin \left(\pi \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
                3. associate-*r/82.6%

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

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

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

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

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

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

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

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

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

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

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

              Alternative 5: 80.1% accurate, 2.0× speedup?

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

                \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
              2. Step-by-step derivation
                1. Simplified81.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 angle around 0 82.5%

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

                    \[\leadsto {a}^{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 {a}^{2} + {\left(b \cdot \sin \left(\pi \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
                  3. associate-*r/82.6%

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

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

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

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

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

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

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

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

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

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

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

                Alternative 6: 67.1% accurate, 3.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3.6 \cdot 10^{-7}:\\ \;\;\;\;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} \end{array} \]
                (FPCore (a b angle)
                 :precision binary64
                 (if (<= b 3.6e-7)
                   (* a a)
                   (+ (* a a) (pow (* 0.005555555555555556 (* angle (* b PI))) 2.0))))
                double code(double a, double b, double angle) {
                	double tmp;
                	if (b <= 3.6e-7) {
                		tmp = a * a;
                	} else {
                		tmp = (a * a) + pow((0.005555555555555556 * (angle * (b * ((double) M_PI)))), 2.0);
                	}
                	return tmp;
                }
                
                public static double code(double a, double b, double angle) {
                	double tmp;
                	if (b <= 3.6e-7) {
                		tmp = a * a;
                	} else {
                		tmp = (a * a) + Math.pow((0.005555555555555556 * (angle * (b * Math.PI))), 2.0);
                	}
                	return tmp;
                }
                
                def code(a, b, angle):
                	tmp = 0
                	if b <= 3.6e-7:
                		tmp = a * a
                	else:
                		tmp = (a * a) + math.pow((0.005555555555555556 * (angle * (b * math.pi))), 2.0)
                	return tmp
                
                function code(a, b, angle)
                	tmp = 0.0
                	if (b <= 3.6e-7)
                		tmp = Float64(a * a);
                	else
                		tmp = Float64(Float64(a * a) + (Float64(0.005555555555555556 * Float64(angle * Float64(b * pi))) ^ 2.0));
                	end
                	return tmp
                end
                
                function tmp_2 = code(a, b, angle)
                	tmp = 0.0;
                	if (b <= 3.6e-7)
                		tmp = a * a;
                	else
                		tmp = (a * a) + ((0.005555555555555556 * (angle * (b * pi))) ^ 2.0);
                	end
                	tmp_2 = tmp;
                end
                
                code[a_, b_, angle_] := If[LessEqual[b, 3.6e-7], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;b \leq 3.6 \cdot 10^{-7}:\\
                \;\;\;\;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}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < 3.59999999999999994e-7

                  1. Initial program 79.9%

                    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                  2. Step-by-step derivation
                    1. 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 angle around 0 64.8%

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

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

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

                    if 3.59999999999999994e-7 < b

                    1. Initial program 88.5%

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

                        \[\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 90.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. metadata-eval90.0%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.6 \cdot 10^{-7}:\\ \;\;\;\;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 7: 56.8% accurate, 139.0× speedup?

                    \[\begin{array}{l} \\ a \cdot a \end{array} \]
                    (FPCore (a b angle) :precision binary64 (* a a))
                    double code(double a, double b, double angle) {
                    	return a * a;
                    }
                    
                    real(8) function code(a, b, angle)
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        real(8), intent (in) :: angle
                        code = a * a
                    end function
                    
                    public static double code(double a, double b, double angle) {
                    	return a * a;
                    }
                    
                    def code(a, b, angle):
                    	return a * a
                    
                    function code(a, b, angle)
                    	return Float64(a * a)
                    end
                    
                    function tmp = code(a, b, angle)
                    	tmp = a * a;
                    end
                    
                    code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    a \cdot a
                    \end{array}
                    
                    Derivation
                    1. Initial program 81.9%

                      \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    2. Step-by-step derivation
                      1. Simplified81.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 angle around 0 61.7%

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

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

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

                      Reproduce

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