ab-angle->ABCF C

Percentage Accurate: 79.7% → 79.7%
Time: 18.4s
Alternatives: 13
Speedup: 1.0×

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 13 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.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\ {\left(a \cdot \mathsf{fma}\left(\sin \left(1 + t\_0\right), \sin 1, \cos 1 \cdot \cos \left(1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle_m))))
   (+
    (pow
     (*
      a
      (fma
       (sin (+ 1.0 t_0))
       (sin 1.0)
       (* (cos 1.0) (cos (+ 1.0 (* 0.005555555555555556 (* PI angle_m)))))))
     2.0)
    (pow (* b (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
	return pow((a * fma(sin((1.0 + t_0)), sin(1.0), (cos(1.0) * cos((1.0 + (0.005555555555555556 * (((double) M_PI) * angle_m))))))), 2.0) + pow((b * sin(t_0)), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m))
	return Float64((Float64(a * fma(sin(Float64(1.0 + t_0)), sin(1.0), Float64(cos(1.0) * cos(Float64(1.0 + Float64(0.005555555555555556 * Float64(pi * angle_m))))))) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[(N[Sin[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[N[(1.0 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\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} \]
    9. metadata-eval66.0%

      \[\leadsto {\left(a \cdot \left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\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. Applied egg-rr66.0%

    \[\leadsto {\left(a \cdot \color{blue}{\left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\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. +-commutative66.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \color{blue}{\mathsf{fma}\left(\sin \left(1 + \pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), \sin 1, \cos 1 \cdot \cos \left(1 + \pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  9. Taylor expanded in angle around inf 80.3%

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

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

Alternative 2: 79.7% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\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} \]
    9. metadata-eval66.0%

      \[\leadsto {\left(a \cdot \left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\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. Applied egg-rr66.0%

    \[\leadsto {\left(a \cdot \color{blue}{\left(\cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\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. +-commutative66.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \color{blue}{\mathsf{fma}\left(\sin \left(1 + \pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), \sin 1, \cos 1 \cdot \cos \left(1 + \pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  9. Taylor expanded in angle around inf 80.3%

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

      \[\leadsto {\left(a \cdot \mathsf{fma}\left(\sin \left(1 + \pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), \color{blue}{\log \left(e^{\sin 1}\right)}, \cos 1 \cdot \cos \left(1 + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
  11. Applied egg-rr80.2%

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

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

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

Alternative 3: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\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. 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 \cdot angle}{180}\right)}\right)}^{2} \]
  6. Applied egg-rr80.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 \cdot angle}{180}\right)}\right)}^{2} \]
  7. Final simplification80.3%

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

Alternative 4: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.5% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\ t_1 := \cos t\_0\\ \mathbf{if}\;angle\_m \leq 410000:\\ \;\;\;\;a \cdot \left(t\_1 \cdot \left(a \cdot t\_1\right)\right) + {\left(t\_0 \cdot b\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \sqrt[3]{{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{6}}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle_m))) (t_1 (cos t_0)))
   (if (<= angle_m 410000.0)
     (+ (* a (* t_1 (* a t_1))) (pow (* t_0 b) 2.0))
     (+
      (pow a 2.0)
      (cbrt (pow (* b (sin (* 0.005555555555555556 (* PI angle_m)))) 6.0))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
	double t_1 = cos(t_0);
	double tmp;
	if (angle_m <= 410000.0) {
		tmp = (a * (t_1 * (a * t_1))) + pow((t_0 * b), 2.0);
	} else {
		tmp = pow(a, 2.0) + cbrt(pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))), 6.0));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = Math.PI * (0.005555555555555556 * angle_m);
	double t_1 = Math.cos(t_0);
	double tmp;
	if (angle_m <= 410000.0) {
		tmp = (a * (t_1 * (a * t_1))) + Math.pow((t_0 * b), 2.0);
	} else {
		tmp = Math.pow(a, 2.0) + Math.cbrt(Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))), 6.0));
	}
	return tmp;
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m))
	t_1 = cos(t_0)
	tmp = 0.0
	if (angle_m <= 410000.0)
		tmp = Float64(Float64(a * Float64(t_1 * Float64(a * t_1))) + (Float64(t_0 * b) ^ 2.0));
	else
		tmp = Float64((a ^ 2.0) + cbrt((Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 6.0)));
	end
	return tmp
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[angle$95$m, 410000.0], N[(N[(a * N[(t$95$1 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(t$95$0 * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 6.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|

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

\mathbf{else}:\\
\;\;\;\;{a}^{2} + \sqrt[3]{{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{6}}\\


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

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. unpow-prod-down86.2%

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

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

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

        \[\leadsto \color{blue}{{\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} \]
      5. unpow286.2%

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

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

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

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

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

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

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

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

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

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

    if 4.1e5 < angle

    1. Initial program 60.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 58.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;a \leq 7 \cdot 10^{-146}:\\
\;\;\;\;{\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\

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


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

    1. Initial program 77.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/78.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-eval78.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-eval78.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-frac278.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-neg78.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-out78.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*77.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-177.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. *-commutative77.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*77.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-eval77.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-eval77.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. Simplified77.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. unpow-prod-down77.9%

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

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

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

        \[\leadsto \color{blue}{{\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} \]
      5. unpow277.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000003e-146 < a

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

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

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

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

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

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

        \[\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*84.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-184.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. *-commutative84.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*84.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-eval84.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-eval84.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. Simplified84.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. unpow-prod-down84.3%

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

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

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

        \[\leadsto \color{blue}{{\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} \]
      5. unpow284.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.1% accurate, 2.0× speedup?

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

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

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


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

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

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

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

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

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

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

        \[\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*77.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-177.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. *-commutative77.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*77.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-eval77.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-eval77.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. Simplified77.5%

      \[\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. unpow-prod-down77.5%

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

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

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

        \[\leadsto \color{blue}{{\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} \]
      5. unpow277.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.09999999999999994e144 < b

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\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*99.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-eval99.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-eval99.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. Simplified99.8%

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

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

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

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

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

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

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

        \[\leadsto \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \color{blue}{\left(b \cdot b\right)} \]
      7. swap-sqr78.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{+144}:\\ \;\;\;\;{\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\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 9: 57.3% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 77.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/77.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-eval77.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-eval77.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-frac277.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-neg77.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-out77.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*77.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-177.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. *-commutative77.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*77.7%

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

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

        \[\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. Simplified77.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. Step-by-step derivation
      1. unpow-prod-down77.7%

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

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

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

        \[\leadsto \color{blue}{{\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} \]
      5. unpow277.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.2000000000000005e153 < b

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

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

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

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

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

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

        \[\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*99.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-199.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. *-commutative99.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*99.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-eval99.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-eval99.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. Simplified99.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 43.1%

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
    8. Step-by-step derivation
      1. add-cbrt-cube49.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      2. pow1/349.5%

        \[\leadsto \color{blue}{{\left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}^{0.3333333333333333}} \]
      3. unswap-sqr49.5%

        \[\leadsto {\color{blue}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}}^{0.3333333333333333} \]
      4. pow349.5%

        \[\leadsto {\left(\color{blue}{{a}^{3}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      5. metadata-eval49.5%

        \[\leadsto {\left({a}^{\color{blue}{\left(\frac{6}{2}\right)}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      6. pow349.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot \color{blue}{{a}^{3}}\right)}^{0.3333333333333333} \]
      7. metadata-eval49.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot {a}^{\color{blue}{\left(\frac{6}{2}\right)}}\right)}^{0.3333333333333333} \]
      8. sqr-pow49.5%

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

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

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

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

Alternative 10: 57.3% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 77.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/77.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-eval77.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-eval77.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-frac277.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-neg77.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-out77.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*77.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-177.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. *-commutative77.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*77.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot a\right) \cdot \left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot a\right)} \]
      8. unpow264.9%

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

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

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

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

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

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

    if 9.2000000000000005e153 < b

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

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

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

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

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

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

        \[\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*99.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-199.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. *-commutative99.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*99.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-eval99.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-eval99.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. Simplified99.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 43.1%

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
    8. Step-by-step derivation
      1. add-cbrt-cube49.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      2. pow1/349.5%

        \[\leadsto \color{blue}{{\left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}^{0.3333333333333333}} \]
      3. unswap-sqr49.5%

        \[\leadsto {\color{blue}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}}^{0.3333333333333333} \]
      4. pow349.5%

        \[\leadsto {\left(\color{blue}{{a}^{3}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      5. metadata-eval49.5%

        \[\leadsto {\left({a}^{\color{blue}{\left(\frac{6}{2}\right)}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      6. pow349.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot \color{blue}{{a}^{3}}\right)}^{0.3333333333333333} \]
      7. metadata-eval49.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot {a}^{\color{blue}{\left(\frac{6}{2}\right)}}\right)}^{0.3333333333333333} \]
      8. sqr-pow49.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 9.2 \cdot 10^{+153}:\\ \;\;\;\;{\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 11: 57.3% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.22 \cdot 10^{+157}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{\left({a}^{6}\right)}^{0.3333333333333333}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 1.22e+157) (* a a) (pow (pow a 6.0) 0.3333333333333333)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.22e+157) {
		tmp = a * a;
	} else {
		tmp = pow(pow(a, 6.0), 0.3333333333333333);
	}
	return tmp;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    real(8) :: tmp
    if (b <= 1.22d+157) then
        tmp = a * a
    else
        tmp = (a ** 6.0d0) ** 0.3333333333333333d0
    end if
    code = tmp
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.22e+157) {
		tmp = a * a;
	} else {
		tmp = Math.pow(Math.pow(a, 6.0), 0.3333333333333333);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if b <= 1.22e+157:
		tmp = a * a
	else:
		tmp = math.pow(math.pow(a, 6.0), 0.3333333333333333)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (b <= 1.22e+157)
		tmp = Float64(a * a);
	else
		tmp = (a ^ 6.0) ^ 0.3333333333333333;
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (b <= 1.22e+157)
		tmp = a * a;
	else
		tmp = (a ^ 6.0) ^ 0.3333333333333333;
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.22e+157], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

\mathbf{else}:\\
\;\;\;\;{\left({a}^{6}\right)}^{0.3333333333333333}\\


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

    1. Initial program 77.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/77.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-eval77.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-eval77.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-frac277.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-neg77.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-out77.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*77.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-177.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. *-commutative77.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*77.7%

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

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

        \[\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. Simplified77.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 angle around 0 64.8%

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

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

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

    if 1.22e157 < b

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

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

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

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

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

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

        \[\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*99.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-199.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. *-commutative99.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*99.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-eval99.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-eval99.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. Simplified99.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 43.1%

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
    8. Step-by-step derivation
      1. add-cbrt-cube49.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      2. pow1/349.5%

        \[\leadsto \color{blue}{{\left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}^{0.3333333333333333}} \]
      3. unswap-sqr49.5%

        \[\leadsto {\color{blue}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}}^{0.3333333333333333} \]
      4. pow349.5%

        \[\leadsto {\left(\color{blue}{{a}^{3}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      5. metadata-eval49.5%

        \[\leadsto {\left({a}^{\color{blue}{\left(\frac{6}{2}\right)}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      6. pow349.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot \color{blue}{{a}^{3}}\right)}^{0.3333333333333333} \]
      7. metadata-eval49.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot {a}^{\color{blue}{\left(\frac{6}{2}\right)}}\right)}^{0.3333333333333333} \]
      8. sqr-pow49.5%

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

      \[\leadsto \color{blue}{{\left({a}^{6}\right)}^{0.3333333333333333}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 57.3% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 4.9 \cdot 10^{+153}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{a}^{6}}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 4.9e+153) (* a a) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 4.9e+153) {
		tmp = a * a;
	} else {
		tmp = cbrt(pow(a, 6.0));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 4.9e+153) {
		tmp = a * a;
	} else {
		tmp = Math.cbrt(Math.pow(a, 6.0));
	}
	return tmp;
}
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (b <= 4.9e+153)
		tmp = Float64(a * a);
	else
		tmp = cbrt((a ^ 6.0));
	end
	return tmp
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[b, 4.9e+153], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

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


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

    1. Initial program 77.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/77.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-eval77.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-eval77.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-frac277.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-neg77.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-out77.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*77.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-177.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. *-commutative77.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*77.7%

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

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

        \[\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. Simplified77.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 angle around 0 64.8%

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

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

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

    if 4.90000000000000002e153 < b

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

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

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

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

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

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

        \[\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*99.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-199.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. *-commutative99.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*99.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-eval99.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-eval99.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. Simplified99.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 43.1%

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

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

      \[\leadsto \color{blue}{a \cdot a} \]
    8. Step-by-step derivation
      1. add-cbrt-cube49.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)}} \]
      2. pow1/349.5%

        \[\leadsto \color{blue}{{\left(\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right) \cdot \left(a \cdot a\right)\right)}^{0.3333333333333333}} \]
      3. unswap-sqr49.5%

        \[\leadsto {\color{blue}{\left(\left(\left(a \cdot a\right) \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}}^{0.3333333333333333} \]
      4. pow349.5%

        \[\leadsto {\left(\color{blue}{{a}^{3}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      5. metadata-eval49.5%

        \[\leadsto {\left({a}^{\color{blue}{\left(\frac{6}{2}\right)}} \cdot \left(\left(a \cdot a\right) \cdot a\right)\right)}^{0.3333333333333333} \]
      6. pow349.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot \color{blue}{{a}^{3}}\right)}^{0.3333333333333333} \]
      7. metadata-eval49.5%

        \[\leadsto {\left({a}^{\left(\frac{6}{2}\right)} \cdot {a}^{\color{blue}{\left(\frac{6}{2}\right)}}\right)}^{0.3333333333333333} \]
      8. sqr-pow49.5%

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

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

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

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

Alternative 13: 56.7% accurate, 139.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m) :precision binary64 (* a a))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return a * a;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    code = a * a
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return a * a;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return a * a
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64(a * a)
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = a * a;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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