ab-angle->ABCF C

Percentage Accurate: 79.7% → 79.7%
Time: 13.9s
Alternatives: 10
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 10 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.7% 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.7% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \color{blue}{\mathsf{fma}\left(\cos \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right), \cos 1, \sin \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \sin 1\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    2. log1p-undefine68.0%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(e^{\color{blue}{\log \left(1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}\right), \cos 1, \sin \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    3. rem-exp-log68.0%

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

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + \color{blue}{\left(0.005555555555555556 \cdot \pi\right) \cdot angle}\right), \cos 1, \sin \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    5. *-commutative68.1%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + \color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right), \cos 1, \sin \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    6. log1p-undefine68.1%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(e^{\color{blue}{\log \left(1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    7. rem-exp-log81.6%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \color{blue}{\left(1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)} \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    8. associate-*r*81.9%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + \color{blue}{\left(0.005555555555555556 \cdot \pi\right) \cdot angle}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    9. *-commutative81.9%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + \color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  8. Simplified81.9%

    \[\leadsto {\left(a \cdot \color{blue}{\mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin 1\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  9. Step-by-step derivation
    1. add-cbrt-cube81.9%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    2. pow381.9%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\sqrt[3]{\color{blue}{{\pi}^{3}}} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  10. Applied egg-rr81.9%

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

Alternative 2: 79.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ {\left(a \cdot {\left(\sqrt[3]{\cos \left(\sqrt[3]{{\pi}^{3}} \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{3}\right)}^{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
    (pow
     (cbrt (cos (* (cbrt (pow PI 3.0)) (* angle 0.005555555555555556))))
     3.0))
   2.0)
  (pow (* b (sin (* PI (* angle 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
	return pow((a * pow(cbrt(cos((cbrt(pow(((double) M_PI), 3.0)) * (angle * 0.005555555555555556)))), 3.0)), 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 * Math.pow(Math.cbrt(Math.cos((Math.cbrt(Math.pow(Math.PI, 3.0)) * (angle * 0.005555555555555556)))), 3.0)), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle * 0.005555555555555556)))), 2.0);
}
function code(a, b, angle)
	return Float64((Float64(a * (cbrt(cos(Float64(cbrt((pi ^ 3.0)) * Float64(angle * 0.005555555555555556)))) ^ 3.0)) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 2.0))
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Power[N[Power[N[Cos[N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 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}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot {\left(\sqrt[3]{\cos \color{blue}{\left(\sqrt{0.005555555555555556 \cdot \left(\pi \cdot angle\right)} \cdot \sqrt{0.005555555555555556 \cdot \left(\pi \cdot angle\right)}\right)}}\right)}^{3}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    4. add-sqr-sqrt81.6%

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    2. pow381.9%

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\cos \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\sqrt[3]{\color{blue}{{\pi}^{3}}} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  10. Applied egg-rr81.9%

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

Alternative 3: 79.7% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\sqrt{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt{\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} \]
  8. Applied egg-rr45.4%

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\sqrt{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt{\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} \]
  9. Step-by-step derivation
    1. add-sqr-sqrt81.9%

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

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\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} \]
    3. pow381.9%

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

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

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

Alternative 4: 79.7% 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}
Derivation
  1. Initial program 81.9%

    \[{\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. Add Preprocessing
  3. Add Preprocessing

Alternative 5: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt[3]{{\left(a \cdot \cos \left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right)\right)}^{6}}} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  9. Step-by-step derivation
    1. add-sqr-sqrt71.8%

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

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

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

Alternative 6: 79.8% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 53.6% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 79.7%

      \[{\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.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-eval79.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-eval79.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-frac279.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-neg79.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-out79.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*79.7%

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

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

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

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

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

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

      \[\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 45.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. unpow245.0%

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

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

        \[\leadsto \left(b \cdot b\right) \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)} \]
      4. swap-sqr51.1%

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

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

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

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

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

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

    if 3.1000000000000001e-46 < a

    1. Initial program 87.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/87.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-eval87.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-eval87.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-frac287.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-neg87.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-out87.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*87.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-187.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. *-commutative87.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*87.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-eval87.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-eval87.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. Simplified87.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 73.9%

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.8%

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

Alternative 8: 53.6% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 79.7%

      \[{\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.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-eval79.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-eval79.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-frac279.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-neg79.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-out79.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*79.7%

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

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

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

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

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

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

      \[\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 45.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. unpow245.0%

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

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

        \[\leadsto \left(b \cdot b\right) \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)} \]
      4. swap-sqr51.1%

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

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

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

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

    if 6.3999999999999998e-46 < a

    1. Initial program 87.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/87.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-eval87.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-eval87.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-frac287.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-neg87.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-out87.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*87.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-187.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. *-commutative87.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*87.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-eval87.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-eval87.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. Simplified87.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 73.9%

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

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

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

Alternative 9: 56.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {a}^{2} \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)} \]
    3. unpow256.3%

      \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot \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-sqr56.3%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right)\right)}^{2}} \]
  8. Final simplification56.5%

    \[\leadsto {\left(a \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2} \]
  9. Add Preprocessing

Alternative 10: 56.9% 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 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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