ab-angle->ABCF C

Percentage Accurate: 79.5% → 79.6%
Time: 27.1s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. unpow281.1%

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. sqr-neg72.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.5% accurate, 1.0× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. Taylor expanded in angle around inf 81.0%

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

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

Alternative 3: 79.6% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. Taylor expanded in angle around inf 81.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. unpow281.1%

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. sqr-neg72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
    6. fabs-sqr38.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|\right)}\right)}^{2} \]
    7. sqr-pow80.6%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{1}}\right|\right)\right)}^{2} \]
    8. unpow180.6%

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)\right)}^{2} \]
    12. fabs-mul80.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
    13. fabs-mul80.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
    14. metadata-eval80.5%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    16. sqr-pow80.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    17. fabs-sqr80.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    18. sqr-pow80.5%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
    21. sqr-pow41.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
    22. fabs-sqr41.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
    23. sqr-pow80.5%

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

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

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

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

Alternative 5: 79.5% accurate, 1.5× speedup?

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

\\
{\left(b \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {a}^{2}
\end{array}
Derivation
  1. Initial program 81.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. unpow281.1%

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. sqr-neg72.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)}^{2} \]
  5. Taylor expanded in angle around inf 80.5%

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
    6. fabs-sqr38.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|\right)}\right)}^{2} \]
    7. sqr-pow80.6%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{1}}\right|\right)\right)}^{2} \]
    8. unpow180.6%

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)\right)}^{2} \]
    12. fabs-mul80.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
    13. fabs-mul80.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
    14. metadata-eval80.5%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    16. sqr-pow80.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    17. fabs-sqr80.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    18. sqr-pow80.5%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
    21. sqr-pow41.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
    22. fabs-sqr41.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
    23. sqr-pow80.5%

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

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

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

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

Alternative 6: 79.5% accurate, 1.5× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)}^{2} + {a}^{2}
\end{array}
Derivation
  1. Initial program 81.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. unpow281.1%

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. sqr-neg72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.2% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in81.2%

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(-\pi \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      9. distribute-rgt-neg-out81.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.6%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.6%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.6%

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.6%

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

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

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    9. Step-by-step derivation
      1. unpow265.2%

        \[\leadsto \color{blue}{a \cdot a} \]
    10. Simplified65.2%

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

    if 1.10000000000000011e-112 < b

    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. Step-by-step derivation
      1. unpow280.7%

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
      6. fabs-sqr35.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.2%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(\color{blue}{0.005555555555555556} \cdot \left|\pi\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      15. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{{\pi}^{1}}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      19. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\pi}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      20. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{-112}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}\\ \end{array} \]

Alternative 8: 67.2% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in81.2%

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(-\pi \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      9. distribute-rgt-neg-out81.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.6%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.6%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.6%

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.6%

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

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

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    9. Step-by-step derivation
      1. unpow265.2%

        \[\leadsto \color{blue}{a \cdot a} \]
    10. Simplified65.2%

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

    if 4.8000000000000001e-112 < b

    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. Step-by-step derivation
      1. unpow280.7%

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{-112}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(b \cdot \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]

Alternative 9: 67.2% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in81.2%

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(-\pi \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      9. distribute-rgt-neg-out81.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.6%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.6%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.6%

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.6%

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

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

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    9. Step-by-step derivation
      1. unpow265.2%

        \[\leadsto \color{blue}{a \cdot a} \]
    10. Simplified65.2%

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

    if 3.0999999999999998e-112 < b

    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. Step-by-step derivation
      1. unpow280.7%

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
      6. fabs-sqr35.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.2%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(\color{blue}{0.005555555555555556} \cdot \left|\pi\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      15. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{{\pi}^{1}}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      19. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\pi}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      20. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right) \cdot \left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right)} + {\left(a \cdot 1\right)}^{2}}\right)}^{2} \]
      5. *-rgt-identity75.2%

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

        \[\leadsto {\left(\sqrt{\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right) \cdot \left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right) + \color{blue}{a \cdot a}}\right)}^{2} \]
      7. hypot-def75.2%

        \[\leadsto {\color{blue}{\left(\mathsf{hypot}\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right), a\right)\right)}}^{2} \]
      8. *-commutative75.2%

        \[\leadsto {\left(\mathsf{hypot}\left(\color{blue}{\left(angle \cdot \frac{\pi}{180}\right) \cdot b}, a\right)\right)}^{2} \]
      9. associate-*l*75.2%

        \[\leadsto {\left(\mathsf{hypot}\left(\color{blue}{angle \cdot \left(\frac{\pi}{180} \cdot b\right)}, a\right)\right)}^{2} \]
      10. div-inv75.2%

        \[\leadsto {\left(\mathsf{hypot}\left(angle \cdot \left(\color{blue}{\left(\pi \cdot \frac{1}{180}\right)} \cdot b\right), a\right)\right)}^{2} \]
      11. metadata-eval75.2%

        \[\leadsto {\left(\mathsf{hypot}\left(angle \cdot \left(\left(\pi \cdot \color{blue}{0.005555555555555556}\right) \cdot b\right), a\right)\right)}^{2} \]
    9. Applied egg-rr75.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.1 \cdot 10^{-112}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right), a\right)\right)}^{2}\\ \end{array} \]

Alternative 10: 67.2% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in81.2%

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(-\pi \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      9. distribute-rgt-neg-out81.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.6%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.6%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr75.5%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.6%

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.6%

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

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

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    9. Step-by-step derivation
      1. unpow265.2%

        \[\leadsto \color{blue}{a \cdot a} \]
    10. Simplified65.2%

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

    if 4.8000000000000001e-112 < b

    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. Step-by-step derivation
      1. unpow280.7%

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(-b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}}^{2} \]
      7. distribute-rgt-neg-in80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
      6. fabs-sqr35.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
      7. sqr-pow75.2%

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
      11. associate-*r*75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
      12. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
      13. fabs-mul75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
      14. metadata-eval75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(\color{blue}{0.005555555555555556} \cdot \left|\pi\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      15. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      16. sqr-pow74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      17. fabs-sqr74.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      18. sqr-pow75.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{{\pi}^{1}}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      19. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\pi}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
      20. unpow175.2%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
      21. sqr-pow39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
      22. fabs-sqr39.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
      23. sqr-pow75.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right), b \cdot \left(angle \cdot \frac{\pi}{180}\right), {\left(a \cdot 1\right)}^{2}\right)} \]
      4. *-commutative75.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{\pi}{180}\right) \cdot b}, b \cdot \left(angle \cdot \frac{\pi}{180}\right), {\left(a \cdot 1\right)}^{2}\right) \]
      5. associate-*l*75.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{angle \cdot \left(\frac{\pi}{180} \cdot b\right)}, b \cdot \left(angle \cdot \frac{\pi}{180}\right), {\left(a \cdot 1\right)}^{2}\right) \]
      6. div-inv75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\color{blue}{\left(\pi \cdot \frac{1}{180}\right)} \cdot b\right), b \cdot \left(angle \cdot \frac{\pi}{180}\right), {\left(a \cdot 1\right)}^{2}\right) \]
      7. metadata-eval75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot \color{blue}{0.005555555555555556}\right) \cdot b\right), b \cdot \left(angle \cdot \frac{\pi}{180}\right), {\left(a \cdot 1\right)}^{2}\right) \]
      8. *-commutative75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), \color{blue}{\left(angle \cdot \frac{\pi}{180}\right) \cdot b}, {\left(a \cdot 1\right)}^{2}\right) \]
      9. associate-*l*75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), \color{blue}{angle \cdot \left(\frac{\pi}{180} \cdot b\right)}, {\left(a \cdot 1\right)}^{2}\right) \]
      10. div-inv75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), angle \cdot \left(\color{blue}{\left(\pi \cdot \frac{1}{180}\right)} \cdot b\right), {\left(a \cdot 1\right)}^{2}\right) \]
      11. metadata-eval75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), angle \cdot \left(\left(\pi \cdot \color{blue}{0.005555555555555556}\right) \cdot b\right), {\left(a \cdot 1\right)}^{2}\right) \]
      12. *-rgt-identity75.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), {\color{blue}{a}}^{2}\right) \]
      13. pow275.2%

        \[\leadsto \mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), \color{blue}{a \cdot a}\right) \]
    9. Applied egg-rr75.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), angle \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot b\right), a \cdot a\right)} \]
    10. Step-by-step derivation
      1. fma-udef75.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{-112}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + {\left(angle \cdot \left(\pi \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]

Alternative 11: 57.9% accurate, 205.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.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. unpow281.1%

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{\left(b \cdot b\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. sqr-neg72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{1}}\right)}^{2} \]
    5. sqr-pow35.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left({\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right)}\right)}^{2} \]
    6. fabs-sqr35.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left|{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{\left(\frac{1}{2}\right)}\right|}\right)}^{2} \]
    7. sqr-pow75.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{{\left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}^{1}}\right|\right)}^{2} \]
    8. unpow175.5%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{-0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right|\right)}^{2} \]
    11. associate-*r*75.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot angle}\right|\right)}^{2} \]
    12. fabs-mul75.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\left(\left|-0.005555555555555556 \cdot \pi\right| \cdot \left|angle\right|\right)}\right)}^{2} \]
    13. fabs-mul75.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\color{blue}{\left(\left|-0.005555555555555556\right| \cdot \left|\pi\right|\right)} \cdot \left|angle\right|\right)\right)}^{2} \]
    14. metadata-eval75.5%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{1}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    16. sqr-pow75.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \left|\color{blue}{{\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}}\right|\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    17. fabs-sqr75.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left({\pi}^{\left(\frac{1}{2}\right)} \cdot {\pi}^{\left(\frac{1}{2}\right)}\right)}\right) \cdot \left|angle\right|\right)\right)}^{2} \]
    18. sqr-pow75.5%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{1}}\right|\right)\right)}^{2} \]
    21. sqr-pow39.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right|\right)\right)}^{2} \]
    22. fabs-sqr39.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)}\right)\right)}^{2} \]
    23. sqr-pow75.5%

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

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

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
  10. Simplified59.7%

    \[\leadsto \color{blue}{a \cdot a} \]
  11. Final simplification59.7%

    \[\leadsto a \cdot a \]

Reproduce

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