ab-angle->ABCF C

Percentage Accurate: 79.6% → 79.6%
Time: 28.6s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.6% accurate, 0.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \sqrt[3]{angle_m \cdot 0.005555555555555556}\\ {\left(a \cdot \cos \left(e^{2 \cdot \log t_0} \cdot \left(t_0 \cdot \pi\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (cbrt (* angle_m 0.005555555555555556))))
   (+
    (pow (* a (cos (* (exp (* 2.0 (log t_0))) (* t_0 PI)))) 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) {
	double t_0 = cbrt((angle_m * 0.005555555555555556));
	return pow((a * cos((exp((2.0 * log(t_0))) * (t_0 * ((double) M_PI))))), 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) {
	double t_0 = Math.cbrt((angle_m * 0.005555555555555556));
	return Math.pow((a * Math.cos((Math.exp((2.0 * Math.log(t_0))) * (t_0 * Math.PI)))), 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)
	t_0 = cbrt(Float64(angle_m * 0.005555555555555556))
	return Float64((Float64(a * cos(Float64(exp(Float64(2.0 * log(t_0))) * Float64(t_0 * pi)))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(N[Exp[N[(2.0 * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

      \[\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 \frac{angle}{180}\right)\right)}^{2} \]
    3. div-inv80.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

      \[\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 \frac{angle}{180}\right)\right)}^{2} \]
    3. div-inv80.3%

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 0.7× speedup?

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

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

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Step-by-step derivation
    1. add-cube-cbrt80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left({\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{0.16666666666666666}\right)}^{9} \cdot {\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{0.16666666666666666}\right)}^{9}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  8. Step-by-step derivation
    1. pow-sqr38.5%

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

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

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

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

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

Alternative 5: 79.6% accurate, 0.7× speedup?

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

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

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Step-by-step derivation
    1. add-cube-cbrt80.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(e^{\log \left(\sqrt[3]{\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}}\right) \cdot 9}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  8. Step-by-step derivation
    1. exp-to-pow80.5%

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

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

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

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

Alternative 6: 79.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

Alternative 7: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 8: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

      \[\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 \frac{angle}{180}\right)\right)}^{2} \]
    3. div-inv80.3%

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

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

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

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

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

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

Alternative 9: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)}^{2} \]
  5. Final simplification64.0%

    \[\leadsto {a}^{2} + {\left(b \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}^{2} \]

Alternative 10: 79.5% accurate, 1.5× speedup?

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

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

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

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

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

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

Alternative 11: 79.5% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 67.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{-129}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(\left(\pi \cdot \left(angle_m \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle_m \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\\


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr76.1%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Taylor expanded in a around inf 63.2%

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 3.79999999999999985e-129 < b

    1. Initial program 76.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. Taylor expanded in angle around 0 76.8%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr72.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Step-by-step derivation
      1. unpow272.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(\pi \cdot \left(angle \cdot b\right)\right) \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)} \cdot 3.08641975308642 \cdot 10^{-5} \]
      2. associate-*r*72.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(\left(\pi \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)} \cdot 3.08641975308642 \cdot 10^{-5} \]
      3. *-commutative72.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(\color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)} \cdot \pi\right) \cdot \left(angle \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5} \]
      4. associate-*l*72.9%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(\color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)} \cdot \pi\right) \cdot \left(angle \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5} \]
    7. Applied egg-rr72.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)} \cdot 3.08641975308642 \cdot 10^{-5} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.8 \cdot 10^{-129}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(\left(\pi \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]

Alternative 13: 67.2% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.12 \cdot 10^{-129}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle_m \cdot \left(\pi \cdot b\right)\right)}^{2}\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 1.12e-129)
   (pow a 2.0)
   (fma a a (* 3.08641975308642e-5 (pow (* angle_m (* PI b)) 2.0)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.12e-129) {
		tmp = pow(a, 2.0);
	} else {
		tmp = fma(a, a, (3.08641975308642e-5 * pow((angle_m * (((double) M_PI) * b)), 2.0)));
	}
	return tmp;
}
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (b <= 1.12e-129)
		tmp = a ^ 2.0;
	else
		tmp = fma(a, a, Float64(3.08641975308642e-5 * (Float64(angle_m * Float64(pi * b)) ^ 2.0)));
	end
	return tmp
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.12e-129], N[Power[a, 2.0], $MachinePrecision], N[(a * a + N[(3.08641975308642e-5 * N[Power[N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.12 \cdot 10^{-129}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, a, 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle_m \cdot \left(\pi \cdot b\right)\right)}^{2}\right)\\


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr76.1%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Taylor expanded in a around inf 63.2%

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 1.12000000000000006e-129 < b

    1. Initial program 76.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. Taylor expanded in angle around 0 76.8%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr72.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Step-by-step derivation
      1. *-rgt-identity72.9%

        \[\leadsto {\color{blue}{a}}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5} \]
      2. pow272.9%

        \[\leadsto \color{blue}{a \cdot a} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5} \]
      3. fma-def72.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, a, {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
      4. *-commutative72.9%

        \[\leadsto \mathsf{fma}\left(a, a, {\color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)}}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
      5. associate-*l*72.9%

        \[\leadsto \mathsf{fma}\left(a, a, {\color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
    7. Applied egg-rr72.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, a, {\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.12 \cdot 10^{-129}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2}\right)\\ \end{array} \]

Alternative 14: 67.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-129}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle_m \cdot \left(\pi \cdot b\right)\right)\right)\right)}^{2}\\


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr76.1%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Taylor expanded in a around inf 63.2%

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 3.4999999999999997e-129 < b

    1. Initial program 76.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. Taylor expanded in angle around 0 76.8%

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
    5. Applied egg-rr72.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u72.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
      2. expm1-udef57.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)} - 1} \]
    7. Applied egg-rr57.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)}^{2}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def72.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)}^{2}\right)\right)} \]
      2. expm1-log1p72.9%

        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)}^{2}} \]
      3. *-commutative72.9%

        \[\leadsto {\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right)\right)}^{2} \]
    9. Simplified72.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-129}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(a, 0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)\right)}^{2}\\ \end{array} \]

Alternative 15: 56.8% accurate, 6.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {a}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m) :precision binary64 (pow a 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow(a, 2.0);
}
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 ** 2.0d0
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow(a, 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow(a, 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return a ^ 2.0
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = a ^ 2.0;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[Power[a, 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}} \]
  5. Applied egg-rr75.0%

    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{{\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
  6. Taylor expanded in a around inf 60.5%

    \[\leadsto \color{blue}{{a}^{2}} \]
  7. Final simplification60.5%

    \[\leadsto {a}^{2} \]

Reproduce

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