ab-angle->ABCF A

Percentage Accurate: 80.0% → 79.9%
Time: 18.4s
Alternatives: 16
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 16 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 79.9% accurate, 0.5× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.9% accurate, 0.6× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.0% accurate, 0.7× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 40.7% accurate, 0.7× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.7% accurate, 0.7× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.9% accurate, 1.0× speedup?

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

    \[{\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/79.6%

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

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

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

Alternative 7: 80.0% accurate, 1.0× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right), b \cdot \cos \left(\frac{angle}{\frac{180}{\pi}}\right)\right)\right)}^{2}} \]
  15. Add Preprocessing

Alternative 8: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\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. Applied egg-rr79.6%

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}} \]
  6. Add Preprocessing

Alternative 9: 79.9% accurate, 1.3× speedup?

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

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

    \[{\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/79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.0% accurate, 1.3× speedup?

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

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

    \[{\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. add-sqr-sqrt43.8%

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

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

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

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

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

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

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

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

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

Alternative 11: 53.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.25 \cdot 10^{-95}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}\\

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


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if 1.2499999999999999e-95 < b

    1. Initial program 78.2%

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    5. Taylor expanded in a around 0 66.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. unpow266.0%

        \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative66.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*65.9%

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

        \[\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-sqr65.9%

        \[\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. unpow265.9%

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

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

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

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

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

Alternative 12: 53.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{-93}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}\\

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


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if 1.39999999999999999e-93 < b

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 66.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. *-commutative66.0%

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

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

        \[\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. unpow265.9%

        \[\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-sqr65.9%

        \[\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. unpow265.9%

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

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

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

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

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

Alternative 13: 53.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.4 \cdot 10^{-94}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;b \cdot b\\


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if 4.40000000000000002e-94 < b

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 64.8%

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

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

      \[\leadsto \color{blue}{b \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 53.6% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;b \cdot b\\


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999985e-92 < b

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 64.8%

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

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

      \[\leadsto \color{blue}{b \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.0%

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

Alternative 15: 57.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.7 \cdot 10^{+149}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{b}^{6}}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 1.7e+149) (* b b) (cbrt (pow b 6.0))))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 1.7e+149) {
		tmp = b * b;
	} else {
		tmp = cbrt(pow(b, 6.0));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 1.7e+149) {
		tmp = b * b;
	} else {
		tmp = Math.cbrt(Math.pow(b, 6.0));
	}
	return tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (a <= 1.7e+149)
		tmp = Float64(b * b);
	else
		tmp = cbrt((b ^ 6.0));
	end
	return tmp
end
code[a_, b_, angle_] := If[LessEqual[a, 1.7e+149], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\


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

    1. Initial program 76.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. associate-*l/76.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)}^{2} \]
      2. associate-/l*76.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e149 < a

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

      \[\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 32.8%

      \[\leadsto \color{blue}{{b}^{2}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt32.8%

        \[\leadsto \color{blue}{\sqrt{{b}^{2}} \cdot \sqrt{{b}^{2}}} \]
      2. sqrt-unprod46.9%

        \[\leadsto \color{blue}{\sqrt{{b}^{2} \cdot {b}^{2}}} \]
      3. pow-prod-up46.9%

        \[\leadsto \sqrt{\color{blue}{{b}^{\left(2 + 2\right)}}} \]
      4. metadata-eval46.9%

        \[\leadsto \sqrt{{b}^{\color{blue}{4}}} \]
    7. Applied egg-rr46.9%

      \[\leadsto \color{blue}{\sqrt{{b}^{4}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube49.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{{b}^{4}} \cdot \sqrt{{b}^{4}}\right) \cdot \sqrt{{b}^{4}}}} \]
      2. pow1/349.0%

        \[\leadsto \color{blue}{{\left(\left(\sqrt{{b}^{4}} \cdot \sqrt{{b}^{4}}\right) \cdot \sqrt{{b}^{4}}\right)}^{0.3333333333333333}} \]
      3. add-sqr-sqrt49.0%

        \[\leadsto {\left(\color{blue}{{b}^{4}} \cdot \sqrt{{b}^{4}}\right)}^{0.3333333333333333} \]
      4. sqrt-pow149.0%

        \[\leadsto {\left({b}^{4} \cdot \color{blue}{{b}^{\left(\frac{4}{2}\right)}}\right)}^{0.3333333333333333} \]
      5. metadata-eval49.0%

        \[\leadsto {\left({b}^{4} \cdot {b}^{\color{blue}{2}}\right)}^{0.3333333333333333} \]
      6. pow-prod-up49.0%

        \[\leadsto {\color{blue}{\left({b}^{\left(4 + 2\right)}\right)}}^{0.3333333333333333} \]
      7. metadata-eval49.0%

        \[\leadsto {\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} \]
    9. Applied egg-rr49.0%

      \[\leadsto \color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} \]
    10. Step-by-step derivation
      1. unpow1/349.3%

        \[\leadsto \color{blue}{\sqrt[3]{{b}^{6}}} \]
    11. Simplified49.3%

      \[\leadsto \color{blue}{\sqrt[3]{{b}^{6}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 57.4% 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 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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