ab-angle->ABCF C

Percentage Accurate: 80.0% → 79.9%
Time: 16.3s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 80.0% accurate, 1.0× speedup?

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

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

Alternative 1: 79.9% accurate, 0.8× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) + 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. /-lowering-/.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right) + 1}}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. inv-powN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left({\left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{-1}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. div-invN/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left({\left(180 \cdot \frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{-1}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left({\left(180 \cdot \frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. unpow-prod-downN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left({180}^{\left(\mathsf{neg}\left(1\right)\right)} \cdot {\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left({180}^{-1} \cdot {\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{180} \cdot {\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{180} \cdot {\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{180}\right), \left({\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \left({\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right)}^{\left(\mathsf{neg}\left(1\right)\right)}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\left(\frac{\frac{1}{angle}}{\mathsf{PI}\left(\right) + 1}\right), \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{angle}\right), \left(\mathsf{PI}\left(\right) + 1\right)\right), \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, angle\right), \left(\mathsf{PI}\left(\right) + 1\right)\right), \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, angle\right), \mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right)\right), \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, angle\right), \mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right)\right), \left(\mathsf{neg}\left(1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    17. metadata-eval79.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, angle\right), \mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right)\right), -1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  8. Applied egg-rr79.1%

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

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

Alternative 2: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) + 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. /-lowering-/.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{\frac{{\mathsf{PI}\left(\right)}^{3} + {1}^{3}}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)}}{\frac{180}{angle}}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{{\mathsf{PI}\left(\right)}^{3} + {1}^{3}}{\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left({\mathsf{PI}\left(\right)}^{3} + {1}^{3}\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. pow3N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right) + {1}^{3}\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. metadata-evalN/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{180}{angle} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{180}{angle}\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(180, angle\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right) + \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(180, angle\right), \mathsf{+.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \left(1 \cdot 1 - \mathsf{PI}\left(\right) \cdot 1\right)\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  8. Applied egg-rr79.0%

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

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

Alternative 3: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) + 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. /-lowering-/.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{\mathsf{PI}\left(\right) + 1}{180} \cdot angle\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right) + 1}{180}\right), angle\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) + 1\right), 180\right), angle\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right), 180\right), angle\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), 180\right), angle\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  8. Applied egg-rr79.0%

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

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

Alternative 4: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    10. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    11. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) + 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    14. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    16. /-lowering-/.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right) + 1}}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{\frac{180}{angle}} \cdot \left(\mathsf{PI}\left(\right) + 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    3. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{angle}{180} \cdot \left(\mathsf{PI}\left(\right) + 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{angle}{180}\right), \left(\mathsf{PI}\left(\right) + 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(angle, 180\right), \left(\mathsf{PI}\left(\right) + 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(angle, 180\right), \mathsf{+.f64}\left(\mathsf{PI}\left(\right), 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    7. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(angle, 180\right), \mathsf{+.f64}\left(\mathsf{PI.f64}\left(\right), 1\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
  8. Applied egg-rr79.0%

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

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

Alternative 5: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)\right)\right), 2\right)\right) \]
    2. associate-/l*N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), 2\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    6. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

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

Alternative 6: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)\right)\right), 2\right)\right) \]
    2. associate-/l*N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), 2\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    6. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    2. div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    4. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\frac{1}{180} \cdot angle\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    6. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{1}{180} \cdot angle\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    7. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\frac{1}{180}, angle\right)\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
  8. Applied egg-rr79.0%

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

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

Alternative 7: 80.0% accurate, 1.3× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\left({\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right)\right) \]
    2. unpow2N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  6. Applied egg-rr78.9%

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

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

Alternative 8: 79.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)\right)\right), 2\right)\right) \]
    2. associate-/l*N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), 2\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
    6. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
  6. Applied egg-rr79.0%

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

    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right), 2\right)\right) \]
  8. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6478.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 180\right), angle\right)\right)\right)}, 2\right)\right) \]
  9. Simplified78.1%

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

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

Alternative 9: 79.9% accurate, 2.0× speedup?

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

\\
a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 78.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 \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  4. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6478.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)}, 2\right)\right) \]
  5. Simplified78.0%

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

Alternative 10: 76.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + angle \cdot \left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right)\right)\right)\right)\\ \mathbf{if}\;angle \leq 10000000000:\\ \;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{angle \cdot \pi}{-180}\right)\right)\right) + t\_0 \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) + \left(a \cdot a\right) \cdot \left(0.5 + 0.5\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0
         (*
          angle
          (*
           b
           (*
            PI
            (+
             0.005555555555555556
             (* angle (* angle (* (* PI PI) -2.8577960676726107e-8)))))))))
   (if (<= angle 10000000000.0)
     (+
      (* a (* a (+ 0.5 (* 0.5 (cos (* 2.0 (/ (* angle PI) -180.0)))))))
      (* t_0 t_0))
     (+
      (* (* b b) (- 0.5 (* 0.5 (cos (* 2.0 (/ PI (/ 180.0 angle)))))))
      (* (* a a) (+ 0.5 0.5))))))
double code(double a, double b, double angle) {
	double t_0 = angle * (b * (((double) M_PI) * (0.005555555555555556 + (angle * (angle * ((((double) M_PI) * ((double) M_PI)) * -2.8577960676726107e-8))))));
	double tmp;
	if (angle <= 10000000000.0) {
		tmp = (a * (a * (0.5 + (0.5 * cos((2.0 * ((angle * ((double) M_PI)) / -180.0))))))) + (t_0 * t_0);
	} else {
		tmp = ((b * b) * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) / (180.0 / angle))))))) + ((a * a) * (0.5 + 0.5));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = angle * (b * (Math.PI * (0.005555555555555556 + (angle * (angle * ((Math.PI * Math.PI) * -2.8577960676726107e-8))))));
	double tmp;
	if (angle <= 10000000000.0) {
		tmp = (a * (a * (0.5 + (0.5 * Math.cos((2.0 * ((angle * Math.PI) / -180.0))))))) + (t_0 * t_0);
	} else {
		tmp = ((b * b) * (0.5 - (0.5 * Math.cos((2.0 * (Math.PI / (180.0 / angle))))))) + ((a * a) * (0.5 + 0.5));
	}
	return tmp;
}
def code(a, b, angle):
	t_0 = angle * (b * (math.pi * (0.005555555555555556 + (angle * (angle * ((math.pi * math.pi) * -2.8577960676726107e-8))))))
	tmp = 0
	if angle <= 10000000000.0:
		tmp = (a * (a * (0.5 + (0.5 * math.cos((2.0 * ((angle * math.pi) / -180.0))))))) + (t_0 * t_0)
	else:
		tmp = ((b * b) * (0.5 - (0.5 * math.cos((2.0 * (math.pi / (180.0 / angle))))))) + ((a * a) * (0.5 + 0.5))
	return tmp
function code(a, b, angle)
	t_0 = Float64(angle * Float64(b * Float64(pi * Float64(0.005555555555555556 + Float64(angle * Float64(angle * Float64(Float64(pi * pi) * -2.8577960676726107e-8)))))))
	tmp = 0.0
	if (angle <= 10000000000.0)
		tmp = Float64(Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * pi) / -180.0))))))) + Float64(t_0 * t_0));
	else
		tmp = Float64(Float64(Float64(b * b) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi / Float64(180.0 / angle))))))) + Float64(Float64(a * a) * Float64(0.5 + 0.5)));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	t_0 = angle * (b * (pi * (0.005555555555555556 + (angle * (angle * ((pi * pi) * -2.8577960676726107e-8))))));
	tmp = 0.0;
	if (angle <= 10000000000.0)
		tmp = (a * (a * (0.5 + (0.5 * cos((2.0 * ((angle * pi) / -180.0))))))) + (t_0 * t_0);
	else
		tmp = ((b * b) * (0.5 - (0.5 * cos((2.0 * (pi / (180.0 / angle))))))) + ((a * a) * (0.5 + 0.5));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(b * N[(Pi * N[(0.005555555555555556 + N[(angle * N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 10000000000.0], N[(N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + angle \cdot \left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right)\right)\right)\right)\\
\mathbf{if}\;angle \leq 10000000000:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{angle \cdot \pi}{-180}\right)\right)\right) + t\_0 \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) + \left(a \cdot a\right) \cdot \left(0.5 + 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1e10

    1. Initial program 86.5%

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified86.5%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \left(angle \cdot \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\right)\right) \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
      6. associate-*r*N/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \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\right)\right) \]
      11. distribute-rgt-outN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
      13. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right)\right), 2\right)\right) \]
    7. Simplified83.1%

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

      \[\leadsto \color{blue}{\left(angle \cdot \left(\left(\pi \cdot \left(0.005555555555555556 + angle \cdot \left(angle \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) \cdot b\right)\right) \cdot \left(angle \cdot \left(\left(\pi \cdot \left(0.005555555555555556 + angle \cdot \left(angle \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) \cdot b\right)\right) + a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{\pi \cdot angle}{-180}\right)\right)\right)} \]

    if 1e10 < angle

    1. Initial program 55.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. Applied egg-rr55.3%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(180, angle\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{1}\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. Simplified55.3%

        \[\leadsto \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) + \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \color{blue}{1}\right) \]
    6. Recombined 2 regimes into one program.
    7. Final simplification76.5%

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

    Alternative 11: 76.7% accurate, 3.3× speedup?

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

      1. Initial program 86.6%

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
        8. PI-lowering-PI.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
        9. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
      3. Simplified86.6%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \left(angle \cdot \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\right)\right) \]
        2. *-commutativeN/A

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
        6. associate-*r*N/A

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \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\right)\right) \]
        11. distribute-rgt-outN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
        13. PI-lowering-PI.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right)\right), 2\right)\right) \]
      7. Simplified83.1%

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

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right), 2\right)\right) \]
      9. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right)}, 2\right)\right) \]
        2. *-lowering-*.f6482.8%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right)}, 2\right)\right) \]
      10. Simplified82.8%

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

      if 0.20000000000000001 < angle

      1. Initial program 56.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. Applied egg-rr56.9%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(180, angle\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{1}\right)\right)\right)\right) \]
      5. Step-by-step derivation
        1. Simplified54.3%

          \[\leadsto \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) + \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \color{blue}{1}\right) \]
      6. Recombined 2 regimes into one program.
      7. Final simplification75.5%

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

      Alternative 12: 66.9% accurate, 3.3× speedup?

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

        1. Initial program 75.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. Applied egg-rr64.8%

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

          \[\leadsto \color{blue}{\left(b \cdot \left(b \cdot \left(0.5 + \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot -0.5\right)\right) + \left(a \cdot a\right) \cdot 0.5\right) + 0.5 \cdot \left(\cos \left(\left(\pi \cdot angle\right) \cdot -0.011111111111111112\right) \cdot \left(a \cdot a\right)\right)} \]
        5. Taylor expanded in b around 0

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

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

            \[\leadsto \left(\frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot {a}^{2} + \color{blue}{\frac{1}{2}} \cdot {a}^{2} \]
          3. distribute-rgt-inN/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{1}{2}} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{1}{2}} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)\right) \]
          10. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{90}\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\left(angle \cdot \mathsf{PI}\left(\right)\right), \frac{-1}{90}\right)\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{PI}\left(\right)\right), \frac{-1}{90}\right)\right)\right)\right)\right) \]
          14. PI-lowering-PI.f6459.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right), \frac{-1}{90}\right)\right)\right)\right)\right) \]
        7. Simplified59.7%

          \[\leadsto \color{blue}{\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(angle \cdot \pi\right) \cdot -0.011111111111111112\right)\right)} \]

        if 350 < b

        1. Initial program 86.6%

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
          6. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
          8. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
          9. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
        3. Simplified86.8%

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \left(angle \cdot \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\right)\right) \]
          2. *-commutativeN/A

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \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\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
          6. associate-*r*N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \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\right)\right) \]
          11. distribute-rgt-outN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \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\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
          13. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{1}{180} + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), 2\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right)\right), 2\right)\right) \]
        7. Simplified84.4%

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

          \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right), 2\right)\right) \]
        9. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right)}, 2\right)\right) \]
          2. *-lowering-*.f6484.4%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{-1}{34992000}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right)}, 2\right)\right) \]
        10. Simplified84.4%

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

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

      Alternative 13: 56.5% accurate, 3.5× speedup?

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

        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 \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(angle \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{32400} + \left(a \cdot a\right) \cdot \frac{-1}{32400}\right)\right)\right), \color{blue}{angle}\right)\right) \]
        7. Applied egg-rr45.7%

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

        if 3.00000000000000014e99 < a

        1. Initial program 84.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. Applied egg-rr79.3%

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

          \[\leadsto \color{blue}{{a}^{2} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
        5. Step-by-step derivation
          1. unpow2N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{2} \cdot \cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)\right)\right) \]
          7. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(\frac{-1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{90}\right)\right)\right)\right)\right)\right) \]
          9. associate-*l*N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{90}\right)\right)\right)\right)\right)\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(angle, \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{90}\right)\right)\right)\right)\right)\right)\right) \]
          11. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{-1}{90}\right)\right)\right)\right)\right)\right)\right) \]
          12. PI-lowering-PI.f6484.6%

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{-1}{90}\right)\right)\right)\right)\right)\right)\right) \]
        6. Simplified84.6%

          \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\right)\right)} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification51.3%

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

      Alternative 14: 56.5% accurate, 14.9× speedup?

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

        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 \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(angle \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{32400} + \left(a \cdot a\right) \cdot \frac{-1}{32400}\right)\right)\right), \color{blue}{angle}\right)\right) \]
        7. Applied egg-rr45.7%

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

        if 1.9e99 < a

        1. Initial program 84.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 \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6484.6%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified84.6%

          \[\leadsto \color{blue}{a \cdot a} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification51.3%

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

      Alternative 15: 53.0% accurate, 15.4× speedup?

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

        1. Initial program 79.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 angle around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{32400} \cdot {b}^{2}\right), \color{blue}{\left(\frac{-1}{32400} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
        5. Simplified36.4%

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in a around 0

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)}\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot b\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          5. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          10. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          11. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          12. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left({angle}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(angle \cdot angle\right), \frac{1}{32400}\right)\right) \]
          15. *-lowering-*.f6438.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{1}{32400}\right)\right) \]
        8. Simplified38.1%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) \cdot angle\right), \frac{1}{32400}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right), angle\right), \frac{1}{32400}\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          9. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          10. PI-lowering-PI.f6443.5%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
        10. Applied egg-rr43.5%

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

        if 1.25000000000000002e-156 < a < 3.9999999999999999e99

        1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in b around inf

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{32400}\right)}\right)\right)\right)\right) \]
          5. *-lowering-*.f6458.8%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{32400}}\right)\right)\right)\right)\right) \]
        8. Simplified58.8%

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

        if 3.9999999999999999e99 < a

        1. Initial program 84.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 \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6484.6%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified84.6%

          \[\leadsto \color{blue}{a \cdot a} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification52.8%

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

      Alternative 16: 53.0% accurate, 15.4× speedup?

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

        1. Initial program 79.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 angle around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{32400} \cdot {b}^{2}\right), \color{blue}{\left(\frac{-1}{32400} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
        5. Simplified36.4%

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in a around 0

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)}\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot b\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          5. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          10. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          11. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          12. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left({angle}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(angle \cdot angle\right), \frac{1}{32400}\right)\right) \]
          15. *-lowering-*.f6438.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{1}{32400}\right)\right) \]
        8. Simplified38.1%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) \cdot angle\right), \frac{1}{32400}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right), angle\right), \frac{1}{32400}\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          9. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          10. PI-lowering-PI.f6443.5%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
        10. Applied egg-rr43.5%

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

        if 1.4000000000000001e-156 < a < 4.39999999999999956e99

        1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in b around inf

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right) \]
          12. PI-lowering-PI.f6458.8%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right)\right)\right) \]
        8. Simplified58.8%

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

        if 4.39999999999999956e99 < a

        1. Initial program 84.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 \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6484.6%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified84.6%

          \[\leadsto \color{blue}{a \cdot a} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification52.8%

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

      Alternative 17: 61.7% accurate, 23.1× speedup?

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

        1. Initial program 74.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 angle around 0

          \[\leadsto \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6457.8%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified57.8%

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

        if 3.19999999999999986e112 < b

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{32400} \cdot {b}^{2}\right), \color{blue}{\left(\frac{-1}{32400} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
        5. Simplified34.7%

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in a around 0

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)}\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot b\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          5. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          10. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          11. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          12. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left({angle}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(angle \cdot angle\right), \frac{1}{32400}\right)\right) \]
          15. *-lowering-*.f6453.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{1}{32400}\right)\right) \]
        8. Simplified53.8%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) \cdot angle\right), \frac{1}{32400}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right), angle\right), \frac{1}{32400}\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          9. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
          10. PI-lowering-PI.f6460.4%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), angle\right), angle\right), \frac{1}{32400}\right) \]
        10. Applied egg-rr60.4%

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

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

      Alternative 18: 61.0% accurate, 23.1× speedup?

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

        1. Initial program 74.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 angle around 0

          \[\leadsto \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6457.8%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified57.8%

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

        if 2.79999999999999998e113 < b

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{32400} \cdot {b}^{2}\right), \color{blue}{\left(\frac{-1}{32400} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
        5. Simplified34.7%

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in a around 0

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)}\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot b\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          5. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          10. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          11. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          12. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left({angle}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(angle \cdot angle\right), \frac{1}{32400}\right)\right) \]
          15. *-lowering-*.f6453.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{1}{32400}\right)\right) \]
        8. Simplified53.8%

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

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

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right)\right) \cdot \color{blue}{b} \]
          3. metadata-evalN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \left(\frac{1}{180} \cdot \frac{1}{180}\right)\right)\right) \cdot b \]
          4. swap-sqrN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot b \]
          5. metadata-evalN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot b \]
          6. div-invN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\frac{angle}{180} \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot b \]
          7. metadata-evalN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\frac{angle}{180} \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot b \]
          8. div-invN/A

            \[\leadsto \left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\frac{angle}{180} \cdot \frac{angle}{180}\right)\right) \cdot b \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\frac{angle}{180} \cdot \frac{angle}{180}\right)\right), \color{blue}{b}\right) \]
        10. Applied egg-rr56.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.8 \cdot 10^{+113}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot \frac{angle \cdot angle}{32400}\right)\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 19: 60.5% accurate, 23.1× speedup?

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

        1. Initial program 74.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 angle around 0

          \[\leadsto \color{blue}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto a \cdot \color{blue}{a} \]
          2. *-lowering-*.f6457.8%

            \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
        5. Simplified57.8%

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

        if 9.5000000000000008e112 < b

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{32400} \cdot {b}^{2}\right), \color{blue}{\left(\frac{-1}{32400} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
        5. Simplified34.7%

          \[\leadsto \color{blue}{a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)} \]
        6. Taylor expanded in a around 0

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)}\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\left(b \cdot b\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          5. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          10. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          11. PI-lowering-PI.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\frac{1}{32400} \cdot {angle}^{2}\right)\right) \]
          12. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left({angle}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\left(angle \cdot angle\right), \frac{1}{32400}\right)\right) \]
          15. *-lowering-*.f6453.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), \frac{1}{32400}\right)\right) \]
        8. Simplified53.8%

          \[\leadsto \color{blue}{\left(b \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 20: 57.4% accurate, 139.0× speedup?

      \[\begin{array}{l} \\ a \cdot a \end{array} \]
      (FPCore (a b angle) :precision binary64 (* a a))
      double code(double a, double b, double angle) {
      	return a * a;
      }
      
      real(8) function code(a, b, angle)
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: angle
          code = a * a
      end function
      
      public static double code(double a, double b, double angle) {
      	return a * a;
      }
      
      def code(a, b, angle):
      	return a * a
      
      function code(a, b, angle)
      	return Float64(a * a)
      end
      
      function tmp = code(a, b, angle)
      	tmp = a * a;
      end
      
      code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      a \cdot a
      \end{array}
      
      Derivation
      1. Initial program 78.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 \color{blue}{{a}^{2}} \]
      4. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto a \cdot \color{blue}{a} \]
        2. *-lowering-*.f6453.2%

          \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
      5. Simplified53.2%

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

      Reproduce

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