ab-angle->ABCF C

Percentage Accurate: 79.8% → 79.8%
Time: 6.2s
Alternatives: 11
Speedup: 0.5×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 79.8% accurate, 1.0× speedup?

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

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

Alternative 1: 79.8% accurate, 0.5× speedup?

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

\\
\left(1 - \left(0.5 - 0.5 \cdot \left(\left(\cos \left(\left(angle\_m \cdot \pi\right) \cdot -0.005555555555555556\right) + \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{\mathsf{fma}\left(\pi, 0.5, 0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)}{2}\right) \cdot \cos \left(\frac{\mathsf{fma}\left(\pi, 0.5, 0\right)}{2}\right)\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.8%

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    19. mult-flipN/A

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

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

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

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

    \[\leadsto \left(1 - \left(0.5 - 0.5 \cdot \left(\left(\cos \left(\left(angle \cdot \pi\right) \cdot -0.005555555555555556\right) + \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right) \cdot \color{blue}{\left(2 \cdot \left(\cos \left(\frac{\mathsf{fma}\left(\pi, 0.5, 0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)}{2}\right) \cdot \cos \left(\frac{\mathsf{fma}\left(\pi, 0.5, 0\right)}{2}\right)\right)\right)}\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  8. Add Preprocessing

Alternative 2: 79.8% accurate, 0.5× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    19. mult-flipN/A

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

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

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

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \left(\left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) + \sin \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \pi\right)\right) \cdot \left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) - \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. mult-flipN/A

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \left(\left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) + \sin \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right)\right) \cdot \left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) - \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    5. lift-/.f6479.8

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

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \left(\left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) + \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) - \sin \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \pi\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. mult-flipN/A

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \left(\left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) + \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(\cos \left(\left(angle \cdot \pi\right) \cdot \frac{-1}{180}\right) - \sin \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    5. lift-/.f6479.8

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

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

Alternative 3: 79.8% accurate, 0.5× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    19. mult-flipN/A

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

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

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

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

Alternative 4: 79.8% accurate, 0.8× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    19. mult-flipN/A

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

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

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\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)} \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\sqrt[3]{\pi \cdot \pi} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \frac{angle}{180}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    21. lower-cbrt.f6479.8

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\sqrt[3]{\pi \cdot \pi} \cdot \left(\sqrt[3]{\pi} \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    23. mult-flipN/A

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

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

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

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

Alternative 5: 79.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

Alternative 6: 79.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    19. mult-flipN/A

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

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

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

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    5. mult-flipN/A

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

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

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

      \[\leadsto \left(1 - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(2 \cdot \pi\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. mult-flipN/A

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

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

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

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

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

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

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

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

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

Alternative 7: 79.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.7% accurate, 1.8× speedup?

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

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

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

      \[\leadsto \color{blue}{{\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. unpow2N/A

      \[\leadsto \color{blue}{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. sqr-neg-revN/A

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

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

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

      \[\leadsto {\left(\mathsf{neg}\left(\color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot a}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    7. distribute-lft-neg-inN/A

      \[\leadsto {\color{blue}{\left(\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot a\right)}}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot {a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    9. lower-unsound-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. lower-pow.f32N/A

      \[\leadsto {\left(\mathsf{neg}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}^{2} \cdot \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow2N/A

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

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

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

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

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

    Alternative 9: 66.6% accurate, 1.9× speedup?

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

      1. Initial program 79.8%

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

        \[\leadsto \color{blue}{{a}^{2}} \]
      3. Step-by-step derivation
        1. lower-pow.f6457.1

          \[\leadsto {a}^{\color{blue}{2}} \]
      4. Applied rewrites57.1%

        \[\leadsto \color{blue}{{a}^{2}} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto {a}^{\color{blue}{2}} \]
        2. pow2N/A

          \[\leadsto a \cdot \color{blue}{a} \]
        3. lift-*.f6457.1

          \[\leadsto a \cdot \color{blue}{a} \]
      6. Applied rewrites57.1%

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

      if 1.55000000000000007e-5 < b

      1. Initial program 79.8%

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}} \]
        2. pow-to-expN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{e^{\log \left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot 2}} \]
        3. lower-unsound-exp.f64N/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{e^{\log \left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot 2}} \]
        4. lower-unsound-*.f64N/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\color{blue}{\log \left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot 2}} \]
        5. lower-unsound-log.f6445.0

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \color{blue}{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \cdot 2} \]
        7. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \color{blue}{\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot b\right)} \cdot 2} \]
        8. lower-*.f6445.0

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \left(\sin \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot b\right) \cdot 2} \]
        10. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \left(\sin \color{blue}{\left(\frac{angle}{180} \cdot \pi\right)} \cdot b\right) \cdot 2} \]
        11. lower-*.f6445.0

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \left(\sin \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right) \cdot b\right) \cdot 2} \]
        13. mult-flipN/A

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

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \left(\sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \pi\right) \cdot b\right) \cdot 2} \]
        16. metadata-eval44.8

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\log \color{blue}{\left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot b\right)} \cdot 2} \]
        3. log-prodN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\color{blue}{\left(\log \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) + \log b\right)} \cdot 2} \]
        4. lower-unsound-+.f64N/A

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) + \log b\right) \cdot 2} \]
        10. metadata-evalN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right) + \log b\right) \cdot 2} \]
        11. mult-flipN/A

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \color{blue}{\frac{angle}{180}}\right) + \log b\right) \cdot 2} \]
        13. lower-unsound-log.f64N/A

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \color{blue}{\frac{angle}{180}}\right) + \log b\right) \cdot 2} \]
        15. mult-flipN/A

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) + \log b\right) \cdot 2} \]
        16. metadata-evalN/A

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + e^{\left(\log \sin \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) + \log b\right) \cdot 2} \]
        18. lower-unsound-log.f6432.0

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

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

        \[\leadsto \color{blue}{e^{2 \cdot \left(\log angle + \left(\log b + \log \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)} + {a}^{2}} \]
      7. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto e^{2 \cdot \left(\log angle + \left(\log b + \log \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)} + \color{blue}{{a}^{2}} \]
      8. Applied rewrites37.1%

        \[\leadsto \color{blue}{e^{2 \cdot \left(\log angle + \left(\log b + \log \left(0.005555555555555556 \cdot \pi\right)\right)\right)} + {a}^{2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 57.1% accurate, 3.3× speedup?

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

      1. Initial program 79.8%

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

        \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
      3. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left({angle}^{2}, \color{blue}{\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, {a}^{2}\right) \]
      4. Applied rewrites41.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right), {a}^{2}\right)} \]
      5. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto {angle}^{2} \cdot \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) + \color{blue}{{a}^{2}} \]
        2. +-commutativeN/A

          \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right)} \]
        3. lift-pow.f64N/A

          \[\leadsto {a}^{2} + \color{blue}{{angle}^{2}} \cdot \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \]
        4. pow2N/A

          \[\leadsto a \cdot a + \color{blue}{{angle}^{2}} \cdot \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \]
        5. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, {angle}^{2} \cdot \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
        7. lift-pow.f64N/A

          \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
        9. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(a, a, \left(\mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot angle\right) \cdot angle\right) \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(a, a, \left(\mathsf{fma}\left(\frac{-1}{32400}, {a}^{2} \cdot {\pi}^{2}, \frac{1}{32400} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot angle\right) \cdot angle\right) \]
      6. Applied rewrites44.0%

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, a \cdot a, \left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot angle\right) \cdot angle\right) \]

      if 7.4999999999999996e107 < a

      1. Initial program 79.8%

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

        \[\leadsto \color{blue}{{a}^{2}} \]
      3. Step-by-step derivation
        1. lower-pow.f6457.1

          \[\leadsto {a}^{\color{blue}{2}} \]
      4. Applied rewrites57.1%

        \[\leadsto \color{blue}{{a}^{2}} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto {a}^{\color{blue}{2}} \]
        2. pow2N/A

          \[\leadsto a \cdot \color{blue}{a} \]
        3. lift-*.f6457.1

          \[\leadsto a \cdot \color{blue}{a} \]
      6. Applied rewrites57.1%

        \[\leadsto \color{blue}{a \cdot a} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 56.7% accurate, 29.7× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m) :precision binary64 (* a a))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return a * a;
    }
    
    angle_m =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, angle_m)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: angle_m
        code = a * a
    end function
    
    angle_m = Math.abs(angle);
    public static double code(double a, double b, double angle_m) {
    	return a * a;
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return a * a
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64(a * a)
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = a * a;
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    a \cdot a
    \end{array}
    
    Derivation
    1. Initial program 79.8%

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    3. Step-by-step derivation
      1. lower-pow.f6457.1

        \[\leadsto {a}^{\color{blue}{2}} \]
    4. Applied rewrites57.1%

      \[\leadsto \color{blue}{{a}^{2}} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto {a}^{\color{blue}{2}} \]
      2. pow2N/A

        \[\leadsto a \cdot \color{blue}{a} \]
      3. lift-*.f6457.1

        \[\leadsto a \cdot \color{blue}{a} \]
    6. Applied rewrites57.1%

      \[\leadsto \color{blue}{a \cdot a} \]
    7. Add Preprocessing

    Reproduce

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