ab-angle->ABCF C

Percentage Accurate: 80.2% → 80.2%
Time: 1.1min
Alternatives: 17
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 17 alternatives:

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

Initial Program: 80.2% 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: 80.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{angle \cdot 0.005555555555555556}\\
{\left(a \cdot \cos \left(t_0 \cdot \left(\pi \cdot {t_0}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  4. Step-by-step derivation
    1. rem-exp-log79.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(b \cdot \sin t_0\right)}^{2} + {\left(a \cdot \cos t_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 79.6%

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

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

Alternative 3: 80.1% 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(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (pow (* a (cos (* PI (/ angle 180.0)))) 2.0)
  (pow (* b (sin (/ PI (/ 180.0 angle)))) 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) / (180.0 / angle)))), 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 / (180.0 / angle)))), 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 / (180.0 / angle)))), 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(180.0 / angle)))) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((pi / (180.0 / angle)))) ^ 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[(180.0 / angle), $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(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.6%

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

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

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

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

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

Alternative 4: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \frac{\pi}{-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 (* angle (/ PI -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 = angle * (((double) M_PI) / -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 = angle * (Math.PI / -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 = angle * (math.pi / -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(angle * Float64(pi / -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 = angle * (pi / -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[(angle * N[(Pi / -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 := angle \cdot \frac{\pi}{-180}\\
{\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 79.6%

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

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

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

Alternative 5: 80.1% accurate, 1.0× speedup?

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

\\
{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.6%

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)\right)}^{2} \]
    7. metadata-eval60.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\sqrt[3]{{\left(\pi \cdot -0.005555555555555556\right)}^{3} \cdot {angle}^{3}}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. expm1-log1p-u54.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt[3]{{\left(\pi \cdot -0.005555555555555556\right)}^{3} \cdot {angle}^{3}}\right)\right)\right)}\right)}^{2} \]
    2. cbrt-prod54.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \color{blue}{\left(\sqrt[3]{{\left(\pi \cdot -0.005555555555555556\right)}^{3}} \cdot \sqrt[3]{{angle}^{3}}\right)}\right)\right)\right)}^{2} \]
    3. rem-cbrt-cube54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\color{blue}{\left(\pi \cdot -0.005555555555555556\right)} \cdot \sqrt[3]{{angle}^{3}}\right)\right)\right)\right)}^{2} \]
    4. rem-cbrt-cube79.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\left(\pi \cdot -0.005555555555555556\right) \cdot \color{blue}{angle}\right)\right)\right)\right)}^{2} \]
    5. associate-*l*79.4%

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \left(-0.005555555555555556 \cdot angle\right)\right)\right)\right)}\right)}^{2} \]
  7. Step-by-step derivation
    1. *-un-lft-identity79.4%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \pi\right)} \cdot 1\right)\right)\right)}^{2} \]
    4. add-sqr-sqrt45.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\color{blue}{\left(\sqrt{-0.005555555555555556 \cdot angle} \cdot \sqrt{-0.005555555555555556 \cdot angle}\right)} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    5. sqrt-unprod61.2%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(-0.005555555555555556 \cdot angle\right)} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    7. *-commutative61.2%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\left(angle \cdot -0.005555555555555556\right) \cdot \color{blue}{\left(angle \cdot -0.005555555555555556\right)}} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    8. swap-sqr60.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\color{blue}{\left(angle \cdot angle\right) \cdot \left(-0.005555555555555556 \cdot -0.005555555555555556\right)}} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    9. metadata-eval60.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\left(angle \cdot angle\right) \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}}} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    10. metadata-eval60.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\left(angle \cdot angle\right) \cdot \color{blue}{\left(0.005555555555555556 \cdot 0.005555555555555556\right)}} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    11. swap-sqr61.2%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\sqrt{\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \left(angle \cdot 0.005555555555555556\right)}} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    12. sqrt-unprod33.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\color{blue}{\left(\sqrt{angle \cdot 0.005555555555555556} \cdot \sqrt{angle \cdot 0.005555555555555556}\right)} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    13. add-sqr-sqrt79.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right) \cdot 1\right)\right)\right)}^{2} \]
    14. associate-*l*79.5%

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

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

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

Alternative 6: 80.0% accurate, 1.5× speedup?

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

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

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

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

    \[\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} \]
  4. Final simplification78.8%

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

Alternative 7: 80.1% accurate, 1.5× speedup?

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

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

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

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

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

Alternative 8: 80.0% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

Alternative 9: 75.2% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 6.50000000000000033e-99

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

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

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

    if 6.50000000000000033e-99 < angle

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;angle \leq 4 \cdot 10^{-98}:\\
\;\;\;\;{a}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(0.005555555555555556 \cdot t_0\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 3.99999999999999976e-98

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999976e-98 < angle

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;angle \leq 1.6 \cdot 10^{-22}:\\
\;\;\;\;{a}^{2} + 0.005555555555555556 \cdot \left(t_0 \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1.59999999999999994e-22

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999994e-22 < angle

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 75.2% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 9.80000000000000028e-98

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

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

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

    if 9.80000000000000028e-98 < angle

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

Alternative 16: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

Reproduce

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