ab-angle->ABCF A

Percentage Accurate: 79.7% → 79.6%
Time: 16.6s
Alternatives: 13
Speedup: 1.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 79.7% accurate, 1.0× speedup?

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

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

Alternative 1: 79.6% accurate, 0.8× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
    2. lift-/.f64N/A

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
    4. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
    5. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
    6. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{180}\right)\right)}^{2} \]
    7. metadata-eval76.9

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    2. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    3. add-cube-cbrtN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    4. associate-*r*N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    5. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    6. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    7. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\color{blue}{\frac{angle}{180}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    8. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    9. metadata-evalN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    10. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    11. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    12. pow1/3N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \left(\color{blue}{{\mathsf{PI}\left(\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    13. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    14. pow1/3N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{3}} \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    15. pow-sqrN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{\left(2 \cdot \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    16. lower-pow.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{\left(2 \cdot \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    17. metadata-evalN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{\frac{2}{3}}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    18. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    19. lower-cbrt.f6476.9

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

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    2. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    3. associate-*l*N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{2}{3}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    4. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \left({\mathsf{PI}\left(\right)}^{\frac{2}{3}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    5. lift-pow.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \left(\color{blue}{{\mathsf{PI}\left(\right)}^{\frac{2}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    6. lift-cbrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{2}{3}} \cdot \color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    7. pow1/3N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{2}{3}} \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{\frac{1}{3}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    8. pow-prod-upN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \color{blue}{{\mathsf{PI}\left(\right)}^{\left(\frac{2}{3} + \frac{1}{3}\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    9. metadata-evalN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{1}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    10. unpow1N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    11. associate-*l*N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    12. *-commutativeN/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    13. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    14. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    15. rem-square-sqrtN/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    16. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    17. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    18. associate-*l*N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \frac{1}{180}\right)\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    19. metadata-evalN/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    20. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    21. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
  8. Applied rewrites76.9%

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot \sqrt{\pi}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\pi}}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2} \]
  9. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    2. sqrt-unprodN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    3. rem-square-sqrtN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    4. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    5. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\mathsf{PI}\left(\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    6. associate-*r*N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    7. sqrt-prodN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    8. sqrt-unprodN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    9. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    10. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    11. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    12. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    13. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    14. lift-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    15. sqrt-unprodN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    16. lower-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    17. lower-*.f6476.9

      \[\leadsto {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot \sqrt{\pi}\right) \cdot \frac{angle}{\frac{1}{\sqrt{\pi}}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \left(\sqrt{\color{blue}{\pi \cdot \sqrt{\pi}}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.005555555555555556\right)\right)}^{2} \]
  10. Applied rewrites76.9%

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

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

Alternative 2: 79.7% accurate, 1.0× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
    2. lift-/.f64N/A

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
    4. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
    5. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
    6. lower-*.f64N/A

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

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

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

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

Reproduce

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