ab-angle->ABCF A

Percentage Accurate: 80.5% → 80.5%
Time: 19.5s
Alternatives: 12
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 80.5% accurate, 1.0× speedup?

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

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

Alternative 1: 80.5% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 40.3% accurate, 0.7× speedup?

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

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

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative79.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.5% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.5% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}, b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}\right)\right) \]
      3. *-commutative77.7%

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

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}, b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}\right)\right) \]
      5. associate-*r*77.5%

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

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

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right), b \cdot \cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)\right)}^{2}\right)\right) \]
    7. Simplified77.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right), b \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)\right)}^{2}\right)\right)} \]
    8. Taylor expanded in b around 0 35.4%

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

        \[\leadsto \mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}\right) \]
      2. unpow239.2%

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

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot a\right) \cdot {\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}}^{2}\right)\right) \]
      4. associate-*r*39.9%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot a\right) \cdot {\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{2}\right)\right) \]
      5. unpow239.9%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right)\right) \]
      6. swap-sqr46.1%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right)\right) \]
      7. unpow246.1%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}}\right)\right) \]
      8. associate-*r*45.4%

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

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot \sin \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right)\right)}^{2}\right)\right) \]
      10. associate-*r*45.9%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{2}\right)\right) \]
      11. associate-*r*45.4%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right) \]
      12. *-commutative45.4%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right)\right)}^{2}\right)\right) \]
      13. *-commutative45.4%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left({\left(a \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2}\right)\right) \]
    10. Simplified45.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt{{\left(a \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2} \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2}}\right)}^{2}} \]
    12. Applied egg-rr46.4%

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

    if 5.79999999999999961e-158 < b

    1. Initial program 79.9%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative79.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 67.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 3 \cdot 10^{-22}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}\\

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


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

    1. Initial program 77.9%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative77.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\left(0.005555555555555556 \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)}^{2} + {\left(b \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\cos \left(\frac{\pi}{180} \cdot angle\right)\right)} - 1\right)}\right)}^{2} \]
    10. Taylor expanded in a around 0 67.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(b \cdot \cos \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)\right)}^{2} \]
      11. associate-/r/67.7%

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

        \[\leadsto {\left(b \cdot \cos \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}\right)}^{2} \]
      13. *-lft-identity68.1%

        \[\leadsto {\left(b \cdot \cos \left(\frac{\color{blue}{\pi}}{\frac{180}{angle}}\right)\right)}^{2} \]
    12. Simplified68.1%

      \[\leadsto \color{blue}{{\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}} \]

    if 2.9999999999999999e-22 < a

    1. Initial program 84.0%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative84.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 63.0% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.2 \cdot 10^{+80}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.19999999999999963e80

    1. Initial program 76.9%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative76.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\left(0.005555555555555556 \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)}^{2} + {\left(b \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\cos \left(\frac{\pi}{180} \cdot angle\right)\right)} - 1\right)}\right)}^{2} \]
    10. Taylor expanded in a around 0 66.6%

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

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

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

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

        \[\leadsto \left(b \cdot b\right) \cdot \color{blue}{\left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      5. swap-sqr67.1%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow267.1%

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

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

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

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

        \[\leadsto {\left(b \cdot \cos \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)\right)}^{2} \]
      11. associate-/r/66.7%

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

        \[\leadsto {\left(b \cdot \cos \color{blue}{\left(\frac{1 \cdot \pi}{\frac{180}{angle}}\right)}\right)}^{2} \]
      13. *-lft-identity67.1%

        \[\leadsto {\left(b \cdot \cos \left(\frac{\color{blue}{\pi}}{\frac{180}{angle}}\right)\right)}^{2} \]
    12. Simplified67.1%

      \[\leadsto \color{blue}{{\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}} \]

    if 5.19999999999999963e80 < a

    1. Initial program 91.6%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
      4. swap-sqr70.3%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
      5. swap-sqr86.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      6. unpow286.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
      7. *-commutative86.1%

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

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

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

Alternative 10: 63.0% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 9.00000000000000013e80

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot b\right)} \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      5. swap-sqr67.1%

        \[\leadsto \color{blue}{\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} \]
      6. unpow267.1%

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

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

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

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

    if 9.00000000000000013e80 < a

    1. Initial program 91.6%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
      4. swap-sqr70.3%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
      5. swap-sqr86.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      6. unpow286.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
      7. *-commutative86.1%

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

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

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

Alternative 11: 63.1% accurate, 3.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 9.499999999999999e80

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

    if 9.499999999999999e80 < a

    1. Initial program 91.6%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
      4. swap-sqr70.3%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \]
      5. swap-sqr86.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      6. unpow286.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(a \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
      7. *-commutative86.1%

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

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

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

Alternative 12: 56.9% accurate, 139.0× speedup?

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

\\
b \cdot b
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

Reproduce

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