ab-angle->ABCF C

Percentage Accurate: 79.4% → 79.5%
Time: 10.4s
Alternatives: 9
Speedup: 1.4×

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

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

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

Alternative 1: 79.5% accurate, 1.4× speedup?

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

\\
{a}^{2} + {\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot b\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. Add Preprocessing
  3. Taylor expanded in b around 0

    \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
    2. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
    3. *-commutativeN/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \cdot b\right)}^{2} \]
    4. associate-*r*N/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
    5. lower-sin.f64N/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\color{blue}{\sin \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
    6. *-commutativeN/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
    7. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
    8. *-commutativeN/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
    10. lower-PI.f6481.1

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

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

    \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(\sin \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)\right) \cdot b\right)}^{2} \]
  7. Step-by-step derivation
    1. Simplified81.5%

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

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

    Alternative 2: 79.4% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ {a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (+ (pow a 2.0) (pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0)))
    double code(double a, double b, double angle) {
    	return pow(a, 2.0) + pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
    }
    
    public static double code(double a, double b, double angle) {
    	return Math.pow(a, 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0);
    }
    
    def code(a, b, angle):
    	return math.pow(a, 2.0) + math.pow((b * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0)
    
    function code(a, b, angle)
    	return Float64((a ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0))
    end
    
    function tmp = code(a, b, angle)
    	tmp = (a ^ 2.0) + ((b * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0);
    end
    
    code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    {a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
        2. lower-*.f64N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
        3. associate-*r*N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot b\right)}^{2} \]
        4. *-commutativeN/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2} \]
        5. associate-*r*N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
        6. lower-sin.f64N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\color{blue}{\sin \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
        7. associate-*r*N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot b\right)}^{2} \]
        8. *-commutativeN/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2} \]
        9. associate-*r*N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
        10. lower-*.f64N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
        11. lower-*.f64N/A

          \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot b\right)}^{2} \]
        12. lower-PI.f6481.0

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

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

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

      Alternative 3: 76.3% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 0.001:\\ \;\;\;\;{a}^{2} + {\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\ \end{array} \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (if (<= (/ angle 180.0) 0.001)
         (+
          (pow a 2.0)
          (pow
           (*
            b
            (*
             angle
             (*
              PI
              (fma
               (* -2.8577960676726107e-8 (* angle angle))
               (* PI PI)
               0.005555555555555556))))
           2.0))
         (+
          (pow a 2.0)
          (*
           (- 0.5 (* 0.5 (cos (* 2.0 (* angle (* PI 0.005555555555555556))))))
           (* b b)))))
      double code(double a, double b, double angle) {
      	double tmp;
      	if ((angle / 180.0) <= 0.001) {
      		tmp = pow(a, 2.0) + pow((b * (angle * (((double) M_PI) * fma((-2.8577960676726107e-8 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), 2.0);
      	} else {
      		tmp = pow(a, 2.0) + ((0.5 - (0.5 * cos((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))))) * (b * b));
      	}
      	return tmp;
      }
      
      function code(a, b, angle)
      	tmp = 0.0
      	if (Float64(angle / 180.0) <= 0.001)
      		tmp = Float64((a ^ 2.0) + (Float64(b * Float64(angle * Float64(pi * fma(Float64(-2.8577960676726107e-8 * Float64(angle * angle)), Float64(pi * pi), 0.005555555555555556)))) ^ 2.0));
      	else
      		tmp = Float64((a ^ 2.0) + Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))) * Float64(b * b)));
      	end
      	return tmp
      end
      
      code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 0.001], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(angle * N[(Pi * N[(N[(-2.8577960676726107e-8 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{angle}{180} \leq 0.001:\\
      \;\;\;\;{a}^{2} + {\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\
      
      \mathbf{else}:\\
      \;\;\;\;{a}^{2} + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 angle #s(literal 180 binary64)) < 1e-3

        1. Initial program 88.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. Add Preprocessing
        3. Taylor expanded in angle around 0

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

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

            \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
          3. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)}\right)\right)}^{2} \]
            2. *-commutativeN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot \frac{-1}{34992000}}\right)\right)\right)}^{2} \]
            3. associate-*r*N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \color{blue}{{angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{34992000}\right)}\right)\right)\right)}^{2} \]
            4. *-commutativeN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + {angle}^{2} \cdot \color{blue}{\left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right)}\right)\right)\right)}^{2} \]
            5. lower-*.f64N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + {angle}^{2} \cdot \left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)}\right)}^{2} \]
            6. associate-*r*N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \color{blue}{\left({angle}^{2} \cdot \frac{-1}{34992000}\right) \cdot {\mathsf{PI}\left(\right)}^{3}}\right)\right)\right)}^{2} \]
            7. *-commutativeN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \color{blue}{\left(\frac{-1}{34992000} \cdot {angle}^{2}\right)} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)}^{2} \]
            8. unpow3N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right)}^{2} \]
            9. unpow2N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}^{2} \]
            10. associate-*r*N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \mathsf{PI}\left(\right)}\right)\right)\right)}^{2} \]
            11. distribute-rgt-outN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}\right)\right)}^{2} \]
            12. +-commutativeN/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{180}\right)}\right)\right)\right)}^{2} \]
            13. lower-*.f64N/A

              \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{180}\right)\right)}\right)\right)}^{2} \]
          4. Simplified83.7%

            \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.005555555555555556\right)\right)\right)}\right)}^{2} \]

          if 1e-3 < (/.f64 angle #s(literal 180 binary64))

          1. Initial program 60.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. Add Preprocessing
          3. Taylor expanded in b around 0

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
            2. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
            3. *-commutativeN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \cdot b\right)}^{2} \]
            4. associate-*r*N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
            5. lower-sin.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\color{blue}{\sin \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
            6. *-commutativeN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
            7. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
            8. *-commutativeN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
            9. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
            10. lower-PI.f6460.8

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

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

            \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(\sin \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)\right) \cdot b\right)}^{2} \]
          7. Step-by-step derivation
            1. Simplified61.5%

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

              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(b \cdot b\right)} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification77.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 0.001:\\ \;\;\;\;{a}^{2} + {\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 4: 76.9% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\ \;\;\;\;{a}^{2} + \left(angle \cdot b\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (if (<= (/ angle 180.0) 2e-5)
             (+
              (pow a 2.0)
              (* (* angle b) (* (* PI (* PI 3.08641975308642e-5)) (* angle b))))
             (+
              (pow a 2.0)
              (*
               b
               (*
                b
                (- 0.5 (* 0.5 (cos (* 2.0 (* angle (* PI 0.005555555555555556)))))))))))
          double code(double a, double b, double angle) {
          	double tmp;
          	if ((angle / 180.0) <= 2e-5) {
          		tmp = pow(a, 2.0) + ((angle * b) * ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (angle * b)));
          	} else {
          		tmp = pow(a, 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (angle * (((double) M_PI) * 0.005555555555555556))))))));
          	}
          	return tmp;
          }
          
          public static double code(double a, double b, double angle) {
          	double tmp;
          	if ((angle / 180.0) <= 2e-5) {
          		tmp = Math.pow(a, 2.0) + ((angle * b) * ((Math.PI * (Math.PI * 3.08641975308642e-5)) * (angle * b)));
          	} else {
          		tmp = Math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * Math.cos((2.0 * (angle * (Math.PI * 0.005555555555555556))))))));
          	}
          	return tmp;
          }
          
          def code(a, b, angle):
          	tmp = 0
          	if (angle / 180.0) <= 2e-5:
          		tmp = math.pow(a, 2.0) + ((angle * b) * ((math.pi * (math.pi * 3.08641975308642e-5)) * (angle * b)))
          	else:
          		tmp = math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * math.cos((2.0 * (angle * (math.pi * 0.005555555555555556))))))))
          	return tmp
          
          function code(a, b, angle)
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 2e-5)
          		tmp = Float64((a ^ 2.0) + Float64(Float64(angle * b) * Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(angle * b))));
          	else
          		tmp = Float64((a ^ 2.0) + Float64(b * Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b, angle)
          	tmp = 0.0;
          	if ((angle / 180.0) <= 2e-5)
          		tmp = (a ^ 2.0) + ((angle * b) * ((pi * (pi * 3.08641975308642e-5)) * (angle * b)));
          	else
          		tmp = (a ^ 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (angle * (pi * 0.005555555555555556))))))));
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-5], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(angle * b), $MachinePrecision] * N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(b * N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\
          \;\;\;\;{a}^{2} + \left(angle \cdot b\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle \cdot b\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;{a}^{2} + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000016e-5

            1. Initial program 88.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. Taylor expanded in angle around 0

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

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

                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                2. associate-*r*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                3. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                4. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                5. unpow2N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                6. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                8. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                9. unpow2N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                10. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                11. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                12. unpow2N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                13. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                14. lower-PI.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                15. lower-PI.f6473.4

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              4. Simplified73.4%

                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                2. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                4. lift-PI.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                5. lift-PI.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                6. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)} \]
                7. rem-square-sqrtN/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                8. lift-sqrt.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                9. lift-sqrt.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                10. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right)} \]
                11. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)} \]
                12. lift-sqrt.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                13. lift-sqrt.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                14. rem-square-sqrtN/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                15. associate-*l*N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
                16. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                17. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
              6. Applied egg-rr84.8%

                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \left(angle \cdot b\right)} \]

              if 2.00000000000000016e-5 < (/.f64 angle #s(literal 180 binary64))

              1. Initial program 61.3%

                \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in b around 0

                \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
                2. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)}}^{2} \]
                3. *-commutativeN/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \cdot b\right)}^{2} \]
                4. associate-*r*N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
                5. lower-sin.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\color{blue}{\sin \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)} \cdot b\right)}^{2} \]
                6. *-commutativeN/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
                7. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b\right)}^{2} \]
                8. *-commutativeN/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
                9. lower-*.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(\sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right) \cdot b\right)}^{2} \]
                10. lower-PI.f6461.3

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

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

                \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(\sin \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)\right) \cdot b\right)}^{2} \]
              7. Step-by-step derivation
                1. Simplified62.0%

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

                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot b} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification78.3%

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

              Alternative 5: 73.1% accurate, 3.2× speedup?

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

                1. Initial program 77.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. Add Preprocessing
                3. Taylor expanded in angle around 0

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

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

                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                    2. associate-*r*N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                    3. associate-*l*N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                    4. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                    5. unpow2N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    6. associate-*l*N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    7. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    9. unpow2N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    10. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                    11. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                    12. unpow2N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                    13. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                    14. lower-PI.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                    15. lower-PI.f6469.8

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                  4. Simplified69.8%

                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                    2. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                    3. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                    4. lift-PI.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                    5. lift-PI.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                    6. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                    7. *-commutativeN/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                    8. associate-*r*N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \]
                    9. *-commutativeN/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                    10. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                    11. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \frac{1}{32400}\right) \]
                    12. associate-*l*N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                    13. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                    14. lower-*.f6469.8

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\pi \cdot \pi\right) \cdot \left(angle \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)}\right) \]
                  6. Applied egg-rr69.8%

                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\pi \cdot \pi\right) \cdot \left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]

                  if 1.4999999999999999e112 < b

                  1. Initial program 95.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. Add Preprocessing
                  3. Taylor expanded in angle around 0

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

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

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                    3. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                      2. associate-*r*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                      3. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                      4. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                      5. unpow2N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      6. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      7. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      9. unpow2N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                      11. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                      12. unpow2N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                      14. lower-PI.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                      15. lower-PI.f6465.5

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                    4. Simplified65.5%

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                      4. lift-PI.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                      5. lift-PI.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                      6. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)} \]
                      7. rem-square-sqrtN/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      8. lift-sqrt.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      9. lift-sqrt.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      10. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right)} \]
                      11. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)} \]
                      12. lift-sqrt.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      13. lift-sqrt.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      14. rem-square-sqrtN/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right) \]
                      15. associate-*l*N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
                      16. lift-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
                    6. Applied egg-rr95.7%

                      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle \cdot \left(angle \cdot b\right)\right)\right) \cdot b} \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification74.2%

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

                  Alternative 6: 73.4% accurate, 3.2× speedup?

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

                    1. Initial program 78.1%

                      \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    2. Add Preprocessing
                    3. Taylor expanded in angle around 0

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

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

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                      3. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                        2. associate-*r*N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                        3. associate-*l*N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                        4. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                        5. unpow2N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        6. associate-*l*N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        7. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        8. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        9. unpow2N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        10. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                        11. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                        12. unpow2N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                        13. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                        14. lower-PI.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                        15. lower-PI.f6470.0

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                      4. Simplified70.0%

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                      5. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                        2. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                        3. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                        4. lift-PI.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                        5. lift-PI.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                        6. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                        7. *-commutativeN/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                        8. associate-*r*N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \]
                        9. *-commutativeN/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                        10. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                        11. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \frac{1}{32400}\right) \]
                        12. associate-*l*N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                        13. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                        14. lower-*.f6470.1

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\pi \cdot \pi\right) \cdot \left(angle \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)}\right) \]
                      6. Applied egg-rr70.1%

                        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\pi \cdot \pi\right) \cdot \left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]

                      if 1.9999999999999999e124 < b

                      1. Initial program 95.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. Add Preprocessing
                      3. Taylor expanded in angle around 0

                        \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                      4. Step-by-step derivation
                        1. Simplified95.8%

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

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                        3. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                          2. associate-*r*N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                          3. associate-*l*N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                          4. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                          5. unpow2N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          6. associate-*l*N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          7. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          8. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          9. unpow2N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          10. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                          11. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                          12. unpow2N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                          13. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                          14. lower-PI.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          15. lower-PI.f6463.9

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                        4. Simplified63.9%

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                        5. Step-by-step derivation
                          1. associate-*r*N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(\left(angle \cdot b\right) \cdot b\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          2. *-commutativeN/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(b \cdot \left(angle \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          3. associate-*r*N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot b\right) \cdot \left(angle \cdot b\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          4. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot b\right) \cdot \left(angle \cdot b\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          5. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot b\right)} \cdot \left(angle \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                          6. lower-*.f6495.5

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(angle \cdot b\right) \cdot \color{blue}{\left(angle \cdot b\right)}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                        6. Applied egg-rr95.5%

                          \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot b\right) \cdot \left(angle \cdot b\right)\right)} \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification74.2%

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

                      Alternative 7: 72.3% accurate, 3.2× speedup?

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

                        1. Initial program 78.1%

                          \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        2. Add Preprocessing
                        3. Taylor expanded in angle around 0

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

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

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                          3. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                            2. associate-*r*N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                            3. associate-*l*N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                            4. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                            5. unpow2N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            6. associate-*l*N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            7. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            8. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            9. unpow2N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            10. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                            11. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                            12. unpow2N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                            13. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                            14. lower-PI.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                            15. lower-PI.f6470.0

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                          4. Simplified70.0%

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                          5. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                            2. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                            3. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                            4. lift-PI.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                            5. lift-PI.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                            6. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                            7. *-commutativeN/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                            8. associate-*r*N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \]
                            9. *-commutativeN/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                            10. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \frac{1}{32400}\right)} \]
                            11. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)} \cdot \frac{1}{32400}\right) \]
                            12. associate-*l*N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                            13. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                            14. lower-*.f6470.1

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\pi \cdot \pi\right) \cdot \left(angle \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)}\right) \]
                          6. Applied egg-rr70.1%

                            \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\pi \cdot \pi\right) \cdot \left(angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]

                          if 1.9999999999999999e124 < b

                          1. Initial program 95.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. Add Preprocessing
                          3. Taylor expanded in angle around 0

                            \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                          4. Step-by-step derivation
                            1. Simplified95.8%

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

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                            3. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                              2. associate-*r*N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                              3. associate-*l*N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                              4. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                              5. unpow2N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              6. associate-*l*N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              7. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              8. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              9. unpow2N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              10. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                              11. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                              12. unpow2N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                              13. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                              14. lower-PI.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                              15. lower-PI.f6463.9

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                            4. Simplified63.9%

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                            5. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                              2. lift-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                              3. lift-PI.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                              4. lift-PI.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                              5. lift-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                              6. lift-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
                              7. associate-*l*N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                              8. *-commutativeN/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot angle} \]
                              9. lower-*.f64N/A

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot angle} \]
                            6. Applied egg-rr88.8%

                              \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(b \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot angle} \]
                          5. Recombined 2 regimes into one program.
                          6. Final simplification73.1%

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

                          Alternative 8: 72.3% accurate, 3.2× speedup?

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

                            1. Initial program 78.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. Add Preprocessing
                            3. Taylor expanded in angle around 0

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

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

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                              3. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                2. associate-*r*N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                                3. associate-*l*N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                4. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                5. unpow2N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                6. associate-*l*N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                7. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                8. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                9. unpow2N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                10. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                11. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                12. unpow2N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                13. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                14. lower-PI.f64N/A

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                15. lower-PI.f6469.1

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                              4. Simplified69.1%

                                \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]

                              if 5e15 < b

                              1. Initial program 89.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. Taylor expanded in angle around 0

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

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

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                3. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                  2. associate-*r*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                                  3. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  5. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  6. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  7. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  8. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  9. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  10. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  11. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  12. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                  13. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                  14. lower-PI.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                  15. lower-PI.f6468.8

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                                4. Simplified68.8%

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                                5. Step-by-step derivation
                                  1. lift-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                  2. lift-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot b\right)\right)}\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                  3. lift-PI.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                  4. lift-PI.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right) \]
                                  5. lift-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                  6. lift-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)} \]
                                  7. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{angle \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                                  8. *-commutativeN/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot angle} \]
                                  9. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot angle} \]
                                6. Applied egg-rr84.4%

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(b \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot angle} \]
                              5. Recombined 2 regimes into one program.
                              6. Final simplification73.1%

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

                              Alternative 9: 69.8% accurate, 3.3× speedup?

                              \[\begin{array}{l} \\ {a}^{2} + \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \end{array} \]
                              (FPCore (a b angle)
                               :precision binary64
                               (+
                                (pow a 2.0)
                                (* (* (* PI PI) 3.08641975308642e-5) (* angle (* angle (* b b))))))
                              double code(double a, double b, double angle) {
                              	return pow(a, 2.0) + (((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5) * (angle * (angle * (b * b))));
                              }
                              
                              public static double code(double a, double b, double angle) {
                              	return Math.pow(a, 2.0) + (((Math.PI * Math.PI) * 3.08641975308642e-5) * (angle * (angle * (b * b))));
                              }
                              
                              def code(a, b, angle):
                              	return math.pow(a, 2.0) + (((math.pi * math.pi) * 3.08641975308642e-5) * (angle * (angle * (b * b))))
                              
                              function code(a, b, angle)
                              	return Float64((a ^ 2.0) + Float64(Float64(Float64(pi * pi) * 3.08641975308642e-5) * Float64(angle * Float64(angle * Float64(b * b)))))
                              end
                              
                              function tmp = code(a, b, angle)
                              	tmp = (a ^ 2.0) + (((pi * pi) * 3.08641975308642e-5) * (angle * (angle * (b * b))));
                              end
                              
                              code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * N[(angle * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              {a}^{2} + \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)
                              \end{array}
                              
                              Derivation
                              1. Initial program 81.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. Add Preprocessing
                              3. Taylor expanded in angle around 0

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

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

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                3. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                  2. associate-*r*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \cdot \frac{1}{32400} \]
                                  3. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left({angle}^{2} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  5. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {b}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  6. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  7. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot {b}^{2}\right)\right)} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  8. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \color{blue}{\left(angle \cdot {b}^{2}\right)}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  9. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  10. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right) \]
                                  11. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
                                  12. unpow2N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                  13. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right) \]
                                  14. lower-PI.f64N/A

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \]
                                  15. lower-PI.f6469.0

                                    \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
                                4. Simplified69.0%

                                  \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
                                5. Final simplification69.0%

                                  \[\leadsto {a}^{2} + \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \]
                                6. Add Preprocessing

                                Reproduce

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