ab-angle->ABCF C

Percentage Accurate: 80.1% → 80.0%
Time: 31.8s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 80.0% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.0% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 3: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 4: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 5: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 6: 79.9% accurate, 1.3× speedup?

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

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

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

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

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

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

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

Alternative 7: 79.9% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.9% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 66.9% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. add-sqr-sqrt45.8%

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(0.005555555555555556 \cdot \sqrt{\color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}}\right)\right) \]
      14. sqrt-unprod31.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(0.005555555555555556 \cdot \color{blue}{\left(\sqrt{angle \cdot \left(b \cdot \pi\right)} \cdot \sqrt{angle \cdot \left(b \cdot \pi\right)}\right)}\right)\right) \]
      15. add-sqr-sqrt50.9%

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

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

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

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

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

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

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

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

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

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

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

    if 4e-52 < b

    1. Initial program 88.6%

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Taylor expanded in angle around 0 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.9% accurate, 3.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{a}^{2} + t\_0 \cdot t\_0\\


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. add-sqr-sqrt45.8%

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(0.005555555555555556 \cdot \sqrt{\color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}}\right)\right) \]
      14. sqrt-unprod31.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(0.005555555555555556 \cdot \color{blue}{\left(\sqrt{angle \cdot \left(b \cdot \pi\right)} \cdot \sqrt{angle \cdot \left(b \cdot \pi\right)}\right)}\right)\right) \]
      15. add-sqr-sqrt50.9%

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

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

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

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

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

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

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

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

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

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

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

    if 7.1999999999999998e-53 < b

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(0.005555555555555556 \cdot \color{blue}{\left(\sqrt{angle \cdot \left(b \cdot \pi\right)} \cdot \sqrt{angle \cdot \left(b \cdot \pi\right)}\right)}\right) \cdot \sqrt{{-0.005555555555555556}^{2} \cdot {\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2}} \]
      8. add-sqr-sqrt69.0%

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(\color{blue}{0.005555555555555556} \cdot \sqrt{{\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2}}\right) \]
      14. pow269.0%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \color{blue}{\left(\sqrt{angle \cdot \left(b \cdot \pi\right)} \cdot \sqrt{angle \cdot \left(b \cdot \pi\right)}\right)}\right) \]
      16. add-sqr-sqrt86.4%

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

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

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

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

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

Alternative 11: 57.2% accurate, 4.1× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
    6. add-sqr-sqrt42.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{a}^{2}} \]
  11. Final simplification58.1%

    \[\leadsto {a}^{2} \]
  12. Add Preprocessing

Reproduce

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