ab-angle->ABCF C

Percentage Accurate: 79.6% → 79.5%
Time: 15.1s
Alternatives: 12
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

Alternative 3: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 61.9% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.9999999999999997e87

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.9999999999999997e87 < b

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. metadata-eval91.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot {\sin \left(angle \cdot \color{blue}{\left(\pi \cdot 0.005555555555555556\right)}\right)}^{2} \]
      6. unpow252.0%

        \[\leadsto \left(b \cdot b\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)} \]
      7. swap-sqr67.2%

        \[\leadsto \color{blue}{\left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      8. unpow267.2%

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

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

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

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

Alternative 6: 79.5% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.6% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. metadata-eval80.3%

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

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

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

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

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

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

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

Alternative 8: 79.6% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.9% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 6.8000000000000004e87

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      4. swap-sqr61.4%

        \[\leadsto \color{blue}{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      5. unpow261.4%

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

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

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

    if 6.8000000000000004e87 < b

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. metadata-eval91.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot {\sin \left(angle \cdot \color{blue}{\left(\pi \cdot 0.005555555555555556\right)}\right)}^{2} \]
      6. unpow252.0%

        \[\leadsto \left(b \cdot b\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)} \]
      7. swap-sqr67.2%

        \[\leadsto \color{blue}{\left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      8. unpow267.2%

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

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

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

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

Alternative 10: 61.9% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.39999999999999981e87

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      4. swap-sqr61.4%

        \[\leadsto \color{blue}{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      5. unpow261.4%

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

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

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

    if 2.39999999999999981e87 < b

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \]
      4. swap-sqr67.2%

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

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

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

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

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

Alternative 11: 57.7% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.70000000000000003e206

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      4. swap-sqr60.0%

        \[\leadsto \color{blue}{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \]
      5. unpow260.0%

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

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

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

    if 2.70000000000000003e206 < b

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{{a}^{4}}} \]
    8. Applied egg-rr46.8%

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

        \[\leadsto \color{blue}{\sqrt[3]{{a}^{6}}} \]
    10. Simplified47.2%

      \[\leadsto \color{blue}{\sqrt[3]{{a}^{6}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.0%

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

Alternative 12: 57.4% accurate, 139.0× speedup?

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

\\
a \cdot a
\end{array}
Derivation
  1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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