ab-angle->ABCF A

Percentage Accurate: 80.1% → 80.1%
Time: 19.6s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 80.1% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 65.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\color{blue}{e^{\mathsf{log1p}\left(angle \cdot \pi\right)} - 1}}\right)}^{3}}{180}\right)\right)}^{2} \]
  11. Step-by-step derivation
    1. expm1-define64.7%

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

    \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \pi\right)\right)}}\right)}^{3}}{180}\right)\right)}^{2} \]
  13. Final simplification64.7%

    \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot angle\right)\right)}\right)}^{3}}{180}\right)\right)}^{2} \]
  14. Add Preprocessing

Alternative 3: 80.1% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 65.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\color{blue}{e^{\mathsf{log1p}\left(angle \cdot \pi\right)} - 1}}{180}\right)\right)}^{2} \]
  9. Step-by-step derivation
    1. expm1-define64.7%

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

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

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

Alternative 5: 40.5% accurate, 0.7× speedup?

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.8%

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

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

Alternative 6: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 8: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 9: 67.3% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\


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

    1. Initial program 77.0%

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

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

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

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

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

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

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

        \[\leadsto {b}^{2} \cdot {\cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}}^{2} \]
    7. Simplified58.6%

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

    if 1.2e-48 < a

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.0% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 80.0% accurate, 1.3× speedup?

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(angle \cdot \left(\pi \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right)}^{2} \]
  4. Applied egg-rr39.8%

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

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

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

Alternative 12: 67.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := a \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;a \leq 2.15 \cdot 10^{-48}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{angle}{\frac{-180}{\pi}}\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\


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

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot {\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.6%

        \[\leadsto \left(b \cdot b\right) \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr58.6%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow258.6%

        \[\leadsto \color{blue}{{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    7. Simplified58.6%

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

    if 2.15e-48 < a

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 57.5% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999993e-160 < b

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 62.8% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.8 \cdot 10^{+153}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{angle}{\frac{-180}{\pi}}\right)\right)}^{2}\\

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot {\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      4. unpow258.0%

        \[\leadsto \left(b \cdot b\right) \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr58.0%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow258.0%

        \[\leadsto \color{blue}{{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    7. Simplified58.0%

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

    if 2.79999999999999985e153 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 62.8% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

        \[\leadsto {b}^{2} \cdot {\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2} \]
      3. unpow258.0%

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      4. unpow258.0%

        \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      5. swap-sqr58.0%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow258.0%

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

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

        \[\leadsto {\left(b \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
    7. Simplified58.0%

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

    if 3.2000000000000001e153 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 62.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.0%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr58.0%

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

    if 3.0499999999999999e153 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 62.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.0%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr58.0%

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

    if 3.4999999999999999e153 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 62.9% accurate, 3.7× speedup?

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

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

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. unpow258.0%

        \[\leadsto \color{blue}{b \cdot b} \]
    7. Applied egg-rr58.0%

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

    if 2.90000000000000002e153 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \left(\left(\color{blue}{\left(0.005555555555555556 \cdot 0.005555555555555556\right)} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right) \]
      17. unpow267.0%

        \[\leadsto \left(a \cdot a\right) \cdot \left(\left(\left(0.005555555555555556 \cdot 0.005555555555555556\right) \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot {\pi}^{2}\right) \]
      18. swap-sqr67.0%

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \color{blue}{\left(angle \cdot 0.005555555555555556\right)}\right) \cdot {\pi}^{2}\right) \]
      21. unpow267.0%

        \[\leadsto \left(a \cdot a\right) \cdot \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right) \]
    10. Simplified88.3%

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

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

Alternative 19: 57.0% accurate, 139.0× speedup?

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

\\
b \cdot b
\end{array}
Derivation
  1. Initial program 78.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{{b}^{2}} \]
  6. Step-by-step derivation
    1. unpow253.5%

      \[\leadsto \color{blue}{b \cdot b} \]
  7. Applied egg-rr53.5%

    \[\leadsto \color{blue}{b \cdot b} \]
  8. Add Preprocessing

Reproduce

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