ab-angle->ABCF C

Percentage Accurate: 79.8% → 79.8%
Time: 16.8s
Alternatives: 14
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 79.8% 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.8% accurate, 1.0× speedup?

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

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

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

    \[\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. 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 angle\right) \cdot \frac{1}{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. *-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), \left(\frac{1}{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{PI}\left(\right), angle\right), \left(\frac{1}{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. 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), \left(\frac{1}{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-eval81.1%

      \[\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), \frac{1}{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) \]
  6. Applied egg-rr81.1%

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

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

Alternative 2: 79.8% accurate, 1.0× speedup?

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

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

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

    \[\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 a around 0

    \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(a \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\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. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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), angle\right), 180\right)\right)\right), 2\right)\right) \]
    5. *-commutativeN/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), angle\right), 180\right)\right)\right), 2\right)\right) \]
    6. 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), 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{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), angle\right), 180\right)\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{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), angle\right), 180\right)\right)\right), 2\right)\right) \]
    9. *-lowering-*.f6481.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), angle\right), 180\right)\right)\right), 2\right)\right) \]
  7. Simplified81.0%

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

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

Alternative 3: 67.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.98 \cdot 10^{-81}:\\
\;\;\;\;\left(a \cdot a\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.98e-81

    1. Initial program 80.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(angle, \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      14. PI-lowering-PI.f6464.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified64.2%

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

    if 1.98e-81 < b

    1. Initial program 82.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. 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. Simplified82.1%

      \[\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. add-cube-cbrtN/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(\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot 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(\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(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right), 180\right)\right)\right), 2\right)\right) \]
      3. 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(\mathsf{/.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      5. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\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{*.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      8. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      9. 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{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      10. *-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(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(angle \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      12. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      13. PI-lowering-PI.f6481.6%

        \[\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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
    6. Applied egg-rr81.6%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\color{blue}{\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \left(angle \cdot \sqrt[3]{\pi}\right)\right)}}{180}\right)\right)}^{2} \]
    7. 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(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}, 2\right)\right) \]
    8. 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(\left(\left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{180}\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\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(\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\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(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      5. *-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(angle, \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right), 2\right)\right) \]
      6. 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(angle, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\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(angle, \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      10. PI-lowering-PI.f6478.6%

        \[\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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified78.6%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    11. 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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6478.6%

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

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

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

Alternative 4: 79.7% accurate, 2.0× speedup?

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

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

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

    \[\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(\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), angle\right), 180\right)\right)\right), 2\right)\right) \]
  6. 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), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6480.8%

      \[\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), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified80.8%

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

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

Alternative 5: 79.8% accurate, 2.0× speedup?

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

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

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

    \[\leadsto \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-*.f6480.8%

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

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

Alternative 6: 67.1% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.4 \cdot 10^{-79}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.3999999999999998e-79

    1. Initial program 80.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr80.7%

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

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2} \cdot {\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)}^{2}\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) \]
      2. pow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot {\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)}^{2}\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\color{blue}{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. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot {\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\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), \color{blue}{angle}\right), 180\right)\right)\right), 2\right)\right) \]
      4. div-invN/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot \left(\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\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) \]
      8. sqr-cos-aN/A

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

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) + \frac{1}{2}\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) \]
      10. distribute-lft-inN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) + \left(a \cdot a\right) \cdot \frac{1}{2}\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) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), \left(\left(a \cdot a\right) \cdot \frac{1}{2}\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) \]
    8. Applied egg-rr76.0%

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

      \[\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)} \]
    10. Step-by-step derivation
      1. *-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) \]
      2. 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) \]
      3. *-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) \]
      4. +-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) \]
      5. *-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) \]
      6. 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) \]
      7. *-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) \]
      8. *-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) \]
      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}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{PI}\left(\right)\right), \frac{1}{90}\right)\right)\right)\right)\right) \]
      10. PI-lowering-PI.f6464.2%

        \[\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) \]
    11. Simplified64.2%

      \[\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 4.3999999999999998e-79 < b

    1. Initial program 82.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. 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. Simplified82.1%

      \[\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. add-cube-cbrtN/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(\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot 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(\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(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right), 180\right)\right)\right), 2\right)\right) \]
      3. 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(\mathsf{/.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      5. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\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{*.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      8. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      9. 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{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      10. *-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(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(angle \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      12. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      13. PI-lowering-PI.f6481.6%

        \[\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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
    6. Applied egg-rr81.6%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\color{blue}{\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \left(angle \cdot \sqrt[3]{\pi}\right)\right)}}{180}\right)\right)}^{2} \]
    7. 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(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}, 2\right)\right) \]
    8. 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(\left(\left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{180}\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\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(\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\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(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      5. *-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(angle, \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right), 2\right)\right) \]
      6. 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(angle, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\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(angle, \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      10. PI-lowering-PI.f6478.6%

        \[\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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified78.6%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    11. 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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6478.6%

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

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

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

Alternative 7: 67.1% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{-81}:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.5999999999999997e-81

    1. Initial program 80.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(\left({\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}^{2}\right), \color{blue}{\left({a}^{2}\right)}, \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    4. Applied egg-rr71.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right), a \cdot a, b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. cos-2N/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) - \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right) \]
      2. sqr-cos-aN/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) - \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right) \]
      3. flip-+N/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)} - \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right) \cdot \frac{1}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)} - \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right) \]
      5. sqr-sin-aN/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right) \cdot \frac{1}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right)\right) \]
      6. fmm-defN/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \left(\mathsf{fma}\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right), \frac{1}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)}, \mathsf{neg}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      7. fma-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\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), \mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{fma.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right) \cdot \left(\frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), \left(\frac{1}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)}\right), \left(\mathsf{neg}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    6. Applied egg-rr27.2%

      \[\leadsto \mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right), a \cdot a, b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \color{blue}{\mathsf{fma}\left(0.25 - 0.25 \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{2}{\frac{\frac{180}{angle}}{\pi}}\right)\right), \frac{1}{0.5 + \cos \left(\frac{2}{\frac{\frac{180}{angle}}{\pi}}\right) \cdot -0.5}, -\left(0.5 + \cos \left(\frac{2}{\frac{\frac{180}{angle}}{\pi}}\right) \cdot -0.5\right)\right)}\right)\right)\right) \]
    7. Taylor expanded in a around inf

      \[\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)} \]
    8. 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. associate-*r*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(\left(\frac{1}{90} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right) \]
      9. *-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(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{90} \cdot angle\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(\mathsf{PI}\left(\right), \left(\frac{1}{90} \cdot angle\right)\right)\right)\right)\right)\right)\right) \]
      11. PI-lowering-PI.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(\mathsf{PI.f64}\left(\right), \left(\frac{1}{90} \cdot angle\right)\right)\right)\right)\right)\right)\right) \]
      12. *-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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \frac{1}{90}\right)\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f6464.1%

        \[\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(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{90}\right)\right)\right)\right)\right)\right)\right) \]
    9. Simplified64.1%

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

    if 7.5999999999999997e-81 < b

    1. Initial program 82.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. 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. Simplified82.1%

      \[\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. add-cube-cbrtN/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(\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot 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(\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(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right), 180\right)\right)\right), 2\right)\right) \]
      3. 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(\mathsf{/.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      5. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\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{*.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      8. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      9. 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{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      10. *-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(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(angle \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      12. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      13. PI-lowering-PI.f6481.6%

        \[\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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
    6. Applied egg-rr81.6%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\color{blue}{\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \left(angle \cdot \sqrt[3]{\pi}\right)\right)}}{180}\right)\right)}^{2} \]
    7. 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(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}, 2\right)\right) \]
    8. 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(\left(\left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{180}\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\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(\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\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(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      5. *-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(angle, \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right), 2\right)\right) \]
      6. 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(angle, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\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(angle, \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      10. PI-lowering-PI.f6478.6%

        \[\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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified78.6%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    11. 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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6478.6%

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

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

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

Alternative 8: 67.2% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{-106}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.60000000000000013e-106

    1. Initial program 80.7%

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

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

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

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

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

    if 3.60000000000000013e-106 < b

    1. Initial program 81.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. Simplified81.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. Step-by-step derivation
      1. add-cube-cbrtN/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(\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot 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(\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(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right), 180\right)\right)\right), 2\right)\right) \]
      3. 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(\mathsf{/.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      5. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\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{*.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      8. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      9. 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{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      10. *-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(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(angle \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\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{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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      12. cbrt-lowering-cbrt.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
      13. PI-lowering-PI.f6481.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{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{*.f64}\left(angle, \mathsf{cbrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right)\right), 180\right)\right)\right), 2\right)\right) \]
    6. Applied egg-rr81.0%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\color{blue}{\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \left(angle \cdot \sqrt[3]{\pi}\right)\right)}}{180}\right)\right)}^{2} \]
    7. 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(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}, 2\right)\right) \]
    8. 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(\left(\left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{180}\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\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(\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\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(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      5. *-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(angle, \left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right), 2\right)\right) \]
      6. 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(angle, \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\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(angle, \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\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{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      10. PI-lowering-PI.f6478.1%

        \[\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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified78.1%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left({a}^{2}\right)}, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right), 2\right)\right) \]
    11. 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(angle, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{180}, \mathsf{PI.f64}\left(\right)\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6477.8%

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

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

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

Alternative 9: 63.9% accurate, 15.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{-107}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{+111}:\\ \;\;\;\;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}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= b 6.6e-107)
   (* a a)
   (if (<= b 1.9e+111)
     (+
      (* a a)
      (* (* angle angle) (* (* PI PI) (* (* b b) 3.08641975308642e-5))))
     (*
      (* (* angle (* PI (* 0.005555555555555556 b))) (* angle b))
      (/ PI 180.0)))))
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 6.6e-107) {
		tmp = a * a;
	} else if (b <= 1.9e+111) {
		tmp = (a * a) + ((angle * angle) * ((((double) M_PI) * ((double) M_PI)) * ((b * b) * 3.08641975308642e-5)));
	} else {
		tmp = ((angle * (((double) M_PI) * (0.005555555555555556 * b))) * (angle * b)) * (((double) M_PI) / 180.0);
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 6.6e-107) {
		tmp = a * a;
	} else if (b <= 1.9e+111) {
		tmp = (a * a) + ((angle * angle) * ((Math.PI * Math.PI) * ((b * b) * 3.08641975308642e-5)));
	} else {
		tmp = ((angle * (Math.PI * (0.005555555555555556 * b))) * (angle * b)) * (Math.PI / 180.0);
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if b <= 6.6e-107:
		tmp = a * a
	elif b <= 1.9e+111:
		tmp = (a * a) + ((angle * angle) * ((math.pi * math.pi) * ((b * b) * 3.08641975308642e-5)))
	else:
		tmp = ((angle * (math.pi * (0.005555555555555556 * b))) * (angle * b)) * (math.pi / 180.0)
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (b <= 6.6e-107)
		tmp = Float64(a * a);
	elseif (b <= 1.9e+111)
		tmp = Float64(Float64(a * a) + Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * Float64(Float64(b * b) * 3.08641975308642e-5))));
	else
		tmp = Float64(Float64(Float64(angle * Float64(pi * Float64(0.005555555555555556 * b))) * Float64(angle * b)) * Float64(pi / 180.0));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 6.6e-107)
		tmp = a * a;
	elseif (b <= 1.9e+111)
		tmp = (a * a) + ((angle * angle) * ((pi * pi) * ((b * b) * 3.08641975308642e-5)));
	else
		tmp = ((angle * (pi * (0.005555555555555556 * b))) * (angle * b)) * (pi / 180.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[b, 6.6e-107], N[(a * a), $MachinePrecision], If[LessEqual[b, 1.9e+111], N[(N[(a * a), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision] * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.6 \cdot 10^{-107}:\\
\;\;\;\;a \cdot a\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{+111}:\\
\;\;\;\;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}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 6.60000000000000007e-107

    1. Initial program 80.7%

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

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

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

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

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

    if 6.60000000000000007e-107 < b < 1.89999999999999988e111

    1. Initial program 69.8%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr69.9%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified38.9%

      \[\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)} \]
    10. 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) \]
    11. 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. *-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({b}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right)\right)\right) \]
      3. 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), \mathsf{*.f64}\left(\left(b \cdot b\right), \frac{1}{32400}\right)\right)\right)\right) \]
      4. *-lowering-*.f6460.5%

        \[\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(\mathsf{*.f64}\left(b, b\right), \frac{1}{32400}\right)\right)\right)\right) \]
    12. Simplified60.5%

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

    if 1.89999999999999988e111 < b

    1. Initial program 93.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr93.5%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified48.8%

      \[\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)} \]
    10. 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)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      16. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      17. PI-lowering-PI.f6453.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
    12. Simplified53.8%

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

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

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

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

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

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot angle\right) \]
      6. pow2N/A

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \left(angle \cdot angle\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \left({b}^{2} \cdot {\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) \cdot \left(angle \cdot angle\right) \]
      8. unpow-prod-downN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(angle \cdot \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot b\right)\right), \color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    14. Applied egg-rr75.6%

      \[\leadsto \color{blue}{\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 63.0% accurate, 20.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 7.8 \cdot 10^{+110}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= b 7.8e+110)
   (* a a)
   (*
    (* (* angle (* PI (* 0.005555555555555556 b))) (* angle b))
    (/ PI 180.0))))
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 7.8e+110) {
		tmp = a * a;
	} else {
		tmp = ((angle * (((double) M_PI) * (0.005555555555555556 * b))) * (angle * b)) * (((double) M_PI) / 180.0);
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 7.8e+110) {
		tmp = a * a;
	} else {
		tmp = ((angle * (Math.PI * (0.005555555555555556 * b))) * (angle * b)) * (Math.PI / 180.0);
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if b <= 7.8e+110:
		tmp = a * a
	else:
		tmp = ((angle * (math.pi * (0.005555555555555556 * b))) * (angle * b)) * (math.pi / 180.0)
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (b <= 7.8e+110)
		tmp = Float64(a * a);
	else
		tmp = Float64(Float64(Float64(angle * Float64(pi * Float64(0.005555555555555556 * b))) * Float64(angle * b)) * Float64(pi / 180.0));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 7.8e+110)
		tmp = a * a;
	else
		tmp = ((angle * (pi * (0.005555555555555556 * b))) * (angle * b)) * (pi / 180.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[b, 7.8e+110], N[(a * a), $MachinePrecision], N[(N[(N[(angle * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision] * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.8 \cdot 10^{+110}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.8000000000000007e110

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

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

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

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

    if 7.8000000000000007e110 < b

    1. Initial program 93.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr93.5%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified48.8%

      \[\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)} \]
    10. 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)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      16. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      17. PI-lowering-PI.f6453.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
    12. Simplified53.8%

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

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

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

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

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

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot angle\right) \]
      6. pow2N/A

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \left(angle \cdot angle\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \left({b}^{2} \cdot {\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) \cdot \left(angle \cdot angle\right) \]
      8. unpow-prod-downN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(angle \cdot \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot b\right)\right), \color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    14. Applied egg-rr75.6%

      \[\leadsto \color{blue}{\left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \frac{\pi}{180}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 63.0% accurate, 20.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 4 \cdot 10^{+110}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \frac{\pi}{180}\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= b 4e+110)
   (* a a)
   (*
    (* angle b)
    (* (* angle (* PI (* 0.005555555555555556 b))) (/ PI 180.0)))))
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 4e+110) {
		tmp = a * a;
	} else {
		tmp = (angle * b) * ((angle * (((double) M_PI) * (0.005555555555555556 * b))) * (((double) M_PI) / 180.0));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 4e+110) {
		tmp = a * a;
	} else {
		tmp = (angle * b) * ((angle * (Math.PI * (0.005555555555555556 * b))) * (Math.PI / 180.0));
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if b <= 4e+110:
		tmp = a * a
	else:
		tmp = (angle * b) * ((angle * (math.pi * (0.005555555555555556 * b))) * (math.pi / 180.0))
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (b <= 4e+110)
		tmp = Float64(a * a);
	else
		tmp = Float64(Float64(angle * b) * Float64(Float64(angle * Float64(pi * Float64(0.005555555555555556 * b))) * Float64(pi / 180.0)));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 4e+110)
		tmp = a * a;
	else
		tmp = (angle * b) * ((angle * (pi * (0.005555555555555556 * b))) * (pi / 180.0));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[b, 4e+110], N[(a * a), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(N[(angle * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 4 \cdot 10^{+110}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;\left(angle \cdot b\right) \cdot \left(\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right) \cdot \frac{\pi}{180}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.0000000000000001e110

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

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

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

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

    if 4.0000000000000001e110 < b

    1. Initial program 93.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr93.5%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified48.8%

      \[\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)} \]
    10. 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)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      16. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      17. PI-lowering-PI.f6453.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
    12. Simplified53.8%

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

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

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

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

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

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot angle\right) \]
      6. pow2N/A

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \left(angle \cdot angle\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \left({b}^{2} \cdot {\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) \cdot \left(angle \cdot angle\right) \]
      8. unpow-prod-downN/A

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

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

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

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

        \[\leadsto \left(\left(angle \cdot b\right) \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{angle} \cdot \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      13. associate-*l*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, b\right), \mathsf{*.f64}\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{\left(angle \cdot \left(b \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
    14. Applied egg-rr75.6%

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

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

Alternative 12: 62.7% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.7 \cdot 10^{+145}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(angle \cdot b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.69999999999999993e145

    1. Initial program 78.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-*.f6461.8%

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

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

    if 3.69999999999999993e145 < b

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

      \[\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. 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 angle\right) \cdot \frac{1}{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. *-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), \left(\frac{1}{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{PI}\left(\right), angle\right), \left(\frac{1}{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. 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), \left(\frac{1}{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-eval97.4%

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr97.4%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified51.2%

      \[\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)} \]
    10. 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)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      16. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      17. PI-lowering-PI.f6456.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
    12. Simplified56.5%

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

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

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

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

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

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

Alternative 13: 61.9% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.9 \cdot 10^{+111}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;angle \cdot \left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.89999999999999988e111

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

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

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

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

    if 1.89999999999999988e111 < b

    1. Initial program 93.4%

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

        \[\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), \frac{1}{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) \]
    6. Applied egg-rr93.5%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \]
    7. 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}} \]
    8. 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) \]
    9. Simplified48.8%

      \[\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)} \]
    10. 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)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      16. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
      17. PI-lowering-PI.f6453.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\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), \frac{1}{32400}\right)\right)\right) \]
    12. Simplified53.8%

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

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

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

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

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

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(angle \cdot angle\right) \]
      6. pow2N/A

        \[\leadsto \left({b}^{2} \cdot \left({\frac{1}{180}}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \left(angle \cdot angle\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \left({b}^{2} \cdot {\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) \cdot \left(angle \cdot angle\right) \]
      8. unpow-prod-downN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(angle, \left({\left(\mathsf{PI}\left(\right) \cdot \left(b \cdot \frac{1}{180}\right)\right)}^{2}\right)\right)\right) \]
      15. unpow-prod-downN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \color{blue}{\left({\left(b \cdot \frac{1}{180}\right)}^{2}\right)}\right)\right)\right) \]
    14. Applied egg-rr66.0%

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

Alternative 14: 57.6% accurate, 139.0× speedup?

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

\\
a \cdot a
\end{array}
Derivation
  1. Initial program 81.0%

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

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

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

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

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

Reproduce

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