ab-angle->ABCF C

Percentage Accurate: 80.3% → 80.3%
Time: 28.9s
Alternatives: 17
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 17 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.3% 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.3% accurate, 0.7× speedup?

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

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

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

    \[\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. Step-by-step derivation
    1. add-sqr-sqrt35.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.3% accurate, 0.7× speedup?

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

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

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

    \[\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. Step-by-step derivation
    1. add-sqr-sqrt35.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.3% accurate, 1.0× speedup?

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

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

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

    \[\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 inf 74.7%

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

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

Alternative 4: 80.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \frac{\pi}{-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 (* angle (/ PI -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 = angle * (((double) M_PI) / -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 = angle * (Math.PI / -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 = angle * (math.pi / -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(angle * Float64(pi / -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 = angle * (pi / -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[(angle * 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}

\\
\begin{array}{l}
t_0 := angle \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 74.7%

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

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

    \[\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 5: 80.2% accurate, 1.3× speedup?

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

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

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

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

    \[\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 inf 74.2%

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

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

Alternative 6: 80.2% accurate, 1.3× speedup?

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

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

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

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

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

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

Alternative 7: 75.6% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.59999999999999983e-12

    1. Initial program 85.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. Simplified85.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 84.9%

      \[\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 80.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. *-commutative80.5%

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

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

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

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

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

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

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

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

      \[\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)} \]
    11. Step-by-step derivation
      1. associate-*r*65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999983e-12 < angle

    1. Initial program 49.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. Simplified49.4%

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

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

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

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

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

        \[\leadsto {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot {\pi}^{2}\right) \cdot {b}^{2} \]
      5. metadata-eval40.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 74.7% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.45e172 < b

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.4% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot {\pi}^{2}\right) \cdot {b}^{2} \]
    5. metadata-eval58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

Alternative 11: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

Alternative 12: 75.1% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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)} \]
  11. Step-by-step derivation
    1. associate-*r*57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 73.5% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 73.5% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 73.5% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 75.1% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 75.1% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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