ab-angle->ABCF A

Percentage Accurate: 79.5% → 79.5%
Time: 16.6s
Alternatives: 9
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

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

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

Alternative 1: 79.5% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 57.9% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr39.5%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow239.5%

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

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

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

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

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

    if 1.9500000000000001e-156 < b

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right) + {b}^{2}} \]
    7. Step-by-step derivation
      1. fma-define73.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right), {b}^{2}\right)} \]
      2. unpow273.7%

        \[\leadsto \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {\pi}^{2}\right), {b}^{2}\right) \]
      3. unpow273.7%

        \[\leadsto \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right), {b}^{2}\right) \]
      4. swap-sqr73.7%

        \[\leadsto \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}, {b}^{2}\right) \]
      5. unpow273.7%

        \[\leadsto \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot \color{blue}{{\left(angle \cdot \pi\right)}^{2}}, {b}^{2}\right) \]
    8. Simplified73.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\left(angle \cdot \pi\right)}^{2}, {b}^{2}\right)} \]
    9. Step-by-step derivation
      1. fma-undefine73.7%

        \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({a}^{2} \cdot {\left(angle \cdot \pi\right)}^{2}\right) + {b}^{2}} \]
      2. *-rgt-identity73.7%

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

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

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

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

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

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

Alternative 3: 57.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr39.5%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow239.5%

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

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

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

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

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

    if 6.79999999999999955e-157 < b

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_0 := \left(angle \cdot \pi\right) \cdot 0.005555555555555556\\
\mathbf{if}\;b \leq 2.4 \cdot 10^{-157}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;b \cdot b + {\left(a \cdot t\_0\right)}^{2}\\


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

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr39.5%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow239.5%

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

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

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified39.4%

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

    if 2.4e-157 < b

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.6% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.9% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{-133}:\\
\;\;\;\;{b}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.5e-133

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 2.5e-133 < a

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.3% accurate, 3.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.15 \cdot 10^{+95}:\\
\;\;\;\;{b}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.15e95

    1. Initial program 77.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 2.15e95 < a

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative65.0%

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr71.2%

        \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow271.2%

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

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

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

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
    8. Taylor expanded in angle around 0 68.0%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow268.0%

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {\pi}^{2}\right)\right) \]
      3. unpow268.0%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
      4. swap-sqr67.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
      5. swap-sqr74.0%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      6. unpow274.0%

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

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    11. Step-by-step derivation
      1. unpow274.0%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      2. associate-*r*76.0%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)} \]
    12. Applied egg-rr76.0%

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

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

Alternative 8: 37.5% accurate, 32.1× speedup?

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

\\
3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(a \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
    5. swap-sqr36.2%

      \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
    6. unpow236.2%

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
    8. *-commutative36.2%

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

    \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  8. Taylor expanded in angle around 0 34.1%

    \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]
  9. Step-by-step derivation
    1. unpow234.1%

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

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

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

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
    5. swap-sqr34.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    6. unpow234.0%

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

    \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
  11. Step-by-step derivation
    1. unpow234.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    2. associate-*r*34.8%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)} \]
  12. Applied egg-rr34.8%

    \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)} \]
  13. Final simplification34.8%

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

Alternative 9: 37.7% accurate, 32.1× speedup?

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

\\
3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot angle\right) \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
    5. swap-sqr36.2%

      \[\leadsto \color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
    6. unpow236.2%

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
    8. *-commutative36.2%

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

    \[\leadsto \color{blue}{{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} \]
  8. Taylor expanded in angle around 0 34.1%

    \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]
  9. Step-by-step derivation
    1. unpow234.1%

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

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

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

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
    5. swap-sqr34.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    6. unpow234.0%

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

    \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
  11. Step-by-step derivation
    1. unpow234.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    2. associate-*r*34.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(\left(a \cdot angle\right) \cdot \pi\right)} \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \]
    3. associate-*l*34.0%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot angle\right) \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
  12. Applied egg-rr34.0%

    \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot angle\right) \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024146 
(FPCore (a b angle)
  :name "ab-angle->ABCF A"
  :precision binary64
  (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))