ab-angle->ABCF A

Percentage Accurate: 79.5% → 79.5%
Time: 16.7s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

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

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

Alternative 1: 79.5% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.5% accurate, 0.7× speedup?

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

\\
{\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(a \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. *-commutative77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 4: 79.5% 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 77.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/77.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*77.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-neg77.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-out77.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-neg77.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-neg77.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-out77.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-neg77.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/77.6%

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

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

    \[\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-rr77.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 5: 79.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ {\left(a \cdot \sin \left(angle \cdot \frac{\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(angle * Float64(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[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

Alternative 6: 79.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.9% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 78.8%

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

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
      2. associate-/l*78.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-neg78.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-out78.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-neg78.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-neg78.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-out78.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-neg78.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/78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999997e-144 < b

    1. Initial program 75.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/75.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*75.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-neg75.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-out75.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-neg75.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-neg75.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-out75.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-neg75.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/75.6%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
      10. associate-/l*75.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. Simplified75.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 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 78.8%

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

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
      2. associate-/l*78.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-neg78.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-out78.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-neg78.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-neg78.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-out78.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-neg78.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/78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999997e-144 < b

    1. Initial program 75.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/75.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*75.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-neg75.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-out75.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-neg75.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-neg75.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-out75.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-neg75.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/75.6%

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} \]
      10. associate-/l*75.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. Simplified75.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 73.2%

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

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

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

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

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

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

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

Alternative 9: 53.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 76.3%

      \[{\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.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*76.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 38.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. unpow238.6%

        \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
      2. *-commutative38.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*38.8%

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

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

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

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

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

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

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

    if 1.70000000000000009e-68 < b

    1. Initial program 80.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/80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;angle \leq 8.8 \cdot 10^{+166}:\\
\;\;\;\;b \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 8.7999999999999996e166

    1. Initial program 79.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/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.7%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\frac{angle}{180} \cdot \pi\right)}\right)}^{2} \]
      9. associate-*l/79.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*79.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. Simplified79.8%

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

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

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

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

    if 8.7999999999999996e166 < angle

    1. Initial program 61.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/61.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*61.4%

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

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

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

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

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

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

        \[\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/61.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*61.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. Simplified61.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 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 57.8% 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 77.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/77.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*77.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-neg77.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-out77.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-neg77.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-neg77.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-out77.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-neg77.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/77.6%

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

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

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

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

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

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

Reproduce

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