ab-angle->ABCF C

Percentage Accurate: 79.3% → 79.2%
Time: 5.4s
Alternatives: 7
Speedup: N/A×

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 7 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 79.2% accurate, 0.7× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{2}\right)} \]
  4. Applied rewrites79.3%

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left|\cos \left(\mathsf{fma}\left(\left|angle\right| \cdot 0.005555555555555556, \pi, \left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right) + \cos \left(\left(\left|angle\right| \cdot 0.005555555555555556\right) \cdot \pi - \left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right|}{2}}, a \cdot a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{2}\right) \]
  5. Applied rewrites79.2%

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

Alternative 2: 79.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := \sin \left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot b\\
\mathsf{fma}\left(1, a \cdot a, \frac{t\_0}{{t\_0}^{-1}}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{\color{blue}{\left(2 \cdot 1\right)}}\right) \]
    14. pow-sqrN/A

      \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1} \cdot {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1}}\right) \]
    15. pow-prod-downN/A

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

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

      \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\color{blue}{\left({\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}\right)}}^{1}\right) \]
    18. unpow179.3

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

    \[\leadsto \mathsf{fma}\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{\frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}}\right) \]
  6. Taylor expanded in angle around 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\frac{1}{180} \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right) \cdot b\right)}^{-1}}\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\color{blue}{\left(\pi \cdot \frac{1}{180}\right)} \cdot angle\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right) \cdot b\right)}^{-1}}\right) \]
      7. lower-*.f6477.1

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\color{blue}{\left(\pi \cdot 0.005555555555555556\right)} \cdot angle\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
    3. Applied rewrites77.1%

      \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \color{blue}{\left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\right)} \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot b}{{\left(\sin \left(\frac{1}{180} \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot b\right)}^{-1}}\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot b}{{\left(\sin \left(\color{blue}{\left(\pi \cdot \frac{1}{180}\right)} \cdot angle\right) \cdot b\right)}^{-1}}\right) \]
      7. lower-*.f6479.2

        \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\sin \left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\right) \cdot b}{{\left(\sin \left(\color{blue}{\left(\pi \cdot 0.005555555555555556\right)} \cdot angle\right) \cdot b\right)}^{-1}}\right) \]
    5. Applied rewrites79.2%

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

    Alternative 3: 79.2% accurate, 1.2× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\\ \mathsf{fma}\left(b, \frac{t\_0}{\frac{1}{b \cdot t\_0}}, \left(a \cdot 1\right) \cdot a\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (sin (* (* PI angle_m) 0.005555555555555556))))
       (fma b (/ t_0 (/ 1.0 (* b t_0))) (* (* a 1.0) a))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = sin(((((double) M_PI) * angle_m) * 0.005555555555555556));
    	return fma(b, (t_0 / (1.0 / (b * t_0))), ((a * 1.0) * a));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))
    	return fma(b, Float64(t_0 / Float64(1.0 / Float64(b * t_0))), Float64(Float64(a * 1.0) * a))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]}, N[(b * N[(t$95$0 / N[(1.0 / N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\\
    \mathsf{fma}\left(b, \frac{t\_0}{\frac{1}{b \cdot t\_0}}, \left(a \cdot 1\right) \cdot a\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{\color{blue}{\left(2 \cdot 1\right)}}\right) \]
      14. pow-sqrN/A

        \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1} \cdot {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1}}\right) \]
      15. pow-prod-downN/A

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

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

        \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\color{blue}{\left({\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}\right)}}^{1}\right) \]
      18. unpow179.3

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

      \[\leadsto \mathsf{fma}\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{\frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}}\right) \]
    6. Taylor expanded in angle around 0

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, \frac{\sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right) \cdot b\right)}^{-1}}, 1 \cdot \left(a \cdot a\right)\right)} \]
      3. Applied rewrites78.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}{\frac{1}{b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}}, \left(a \cdot 1\right) \cdot a\right)} \]
      4. Add Preprocessing

      Alternative 4: 79.1% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{\color{blue}{\left(2 \cdot 1\right)}}\right) \]
        14. pow-sqrN/A

          \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1} \cdot {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1}}\right) \]
        15. pow-prod-downN/A

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

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

          \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\color{blue}{\left({\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}\right)}}^{1}\right) \]
        18. unpow179.3

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

        \[\leadsto \mathsf{fma}\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{\frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}}\right) \]
      6. Taylor expanded in angle around 0

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{1}, a \cdot a, \frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
        2. Applied rewrites79.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot 1, a, {\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2}\right)} \]
        3. Add Preprocessing

        Alternative 5: 78.2% accurate, 1.8× speedup?

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{1}, a \cdot a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{2}\right) \]
          2. Add Preprocessing

          Alternative 6: 66.2% accurate, 2.4× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\\ \mathbf{if}\;b \leq 2.65 \cdot 10^{-104}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, a \cdot a, \frac{t\_0}{{t\_0}^{-1}}\right)\\ \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (let* ((t_0 (* 0.005555555555555556 (* angle_m (* b PI)))))
             (if (<= b 2.65e-104) (* a a) (fma 1.0 (* a a) (/ t_0 (pow t_0 -1.0))))))
          angle_m = fabs(angle);
          double code(double a, double b, double angle_m) {
          	double t_0 = 0.005555555555555556 * (angle_m * (b * ((double) M_PI)));
          	double tmp;
          	if (b <= 2.65e-104) {
          		tmp = a * a;
          	} else {
          		tmp = fma(1.0, (a * a), (t_0 / pow(t_0, -1.0)));
          	}
          	return tmp;
          }
          
          angle_m = abs(angle)
          function code(a, b, angle_m)
          	t_0 = Float64(0.005555555555555556 * Float64(angle_m * Float64(b * pi)))
          	tmp = 0.0
          	if (b <= 2.65e-104)
          		tmp = Float64(a * a);
          	else
          		tmp = fma(1.0, Float64(a * a), Float64(t_0 / (t_0 ^ -1.0)));
          	end
          	return tmp
          end
          
          angle_m = N[Abs[angle], $MachinePrecision]
          code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2.65e-104], N[(a * a), $MachinePrecision], N[(1.0 * N[(a * a), $MachinePrecision] + N[(t$95$0 / N[Power[t$95$0, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          \begin{array}{l}
          t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\\
          \mathbf{if}\;b \leq 2.65 \cdot 10^{-104}:\\
          \;\;\;\;a \cdot a\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(1, a \cdot a, \frac{t\_0}{{t\_0}^{-1}}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < 2.65000000000000009e-104

            1. Initial program 79.3%

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

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

                \[\leadsto {a}^{\color{blue}{2}} \]
            4. Applied rewrites55.6%

              \[\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-*.f6455.6

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

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

            if 2.65000000000000009e-104 < b

            1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{\color{blue}{\left(2 \cdot 1\right)}}\right) \]
              14. pow-sqrN/A

                \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1} \cdot {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{1}}\right) \]
              15. pow-prod-downN/A

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

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

                \[\leadsto \mathsf{fma}\left({\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, {\color{blue}{\left({\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}\right)}}^{1}\right) \]
              18. unpow179.3

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

              \[\leadsto \mathsf{fma}\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{2}, a \cdot a, \color{blue}{\frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}}\right) \]
            6. Taylor expanded in angle around 0

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{1}, a \cdot a, \frac{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
              2. Taylor expanded in angle around 0

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

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

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

                  \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right) \cdot b\right)}^{-1}}\right) \]
                4. lower-PI.f6468.2

                  \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
              4. Applied rewrites68.2%

                \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}}{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{-1}}\right) \]
              5. Taylor expanded in angle around 0

                \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{-1}}\right) \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\left(b \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{-1}}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\left(\frac{1}{180} \cdot \left(angle \cdot \left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)}^{-1}}\right) \]
                4. lower-PI.f6474.0

                  \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\left(0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}^{-1}}\right) \]
              7. Applied rewrites74.0%

                \[\leadsto \mathsf{fma}\left(1, a \cdot a, \frac{0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)}{{\color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{-1}}\right) \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 7: 55.6% 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.3%

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

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

                \[\leadsto {a}^{\color{blue}{2}} \]
            4. Applied rewrites55.6%

              \[\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-*.f6455.6

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

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

            Reproduce

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