ab-angle->ABCF C

Percentage Accurate: 80.0% → 79.9%
Time: 14.4s
Alternatives: 10
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 80.0% 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.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{1}{\pi \cdot angle}}\right)\right)}^{2} \]
  11. Applied rewrites80.6%

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

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

Alternative 3: 79.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 64.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 1.22 \cdot 10^{-194}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b \cdot 0.5, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 1.22e-194)
   (* a a)
   (if (<= (/ angle 180.0) 1e-9)
     (fma
      (* angle angle)
      (* PI (* PI (* b (* b 3.08641975308642e-5))))
      (* a a))
     (fma
      b
      (* b 0.5)
      (* (* a a) (fma 0.5 (cos (* (* PI angle) 0.011111111111111112)) 0.5))))))
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 1.22e-194) {
		tmp = a * a;
	} else if ((angle / 180.0) <= 1e-9) {
		tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
	} else {
		tmp = fma(b, (b * 0.5), ((a * a) * fma(0.5, cos(((((double) M_PI) * angle) * 0.011111111111111112)), 0.5)));
	}
	return tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 1.22e-194)
		tmp = Float64(a * a);
	elseif (Float64(angle / 180.0) <= 1e-9)
		tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a));
	else
		tmp = fma(b, Float64(b * 0.5), Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(pi * angle) * 0.011111111111111112)), 0.5)));
	end
	return tmp
end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1.22e-194], N[(a * a), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-9], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * 0.5), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 1.22 \cdot 10^{-194}:\\
\;\;\;\;a \cdot a\\

\mathbf{elif}\;\frac{angle}{180} \leq 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b \cdot 0.5, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 1.2200000000000001e-194

    1. Initial program 83.2%

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

      \[\leadsto \color{blue}{{a}^{2}} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \color{blue}{a \cdot a} \]
      2. lower-*.f6457.0

        \[\leadsto \color{blue}{a \cdot a} \]
    5. Applied rewrites57.0%

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

    if 1.2200000000000001e-194 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000006e-9

    1. Initial program 99.7%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
    5. Applied rewrites77.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
    6. Taylor expanded in b around inf

      \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{32400} \cdot \color{blue}{{b}^{2}}\right)\right), a \cdot a\right) \]
    7. Step-by-step derivation
      1. Applied rewrites91.7%

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

      if 1.00000000000000006e-9 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 65.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, b \cdot 0.5, \mathsf{fma}\left(b \cdot b, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot -0.5, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\right)} \]
      6. Taylor expanded in b around 0

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(b, b \cdot \frac{1}{2}, \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right)\right) \]
        7. *-commutativeN/A

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

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

          \[\leadsto \mathsf{fma}\left(b, b \cdot \frac{1}{2}, \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{90}\right), \frac{1}{2}\right)\right) \]
        10. lower-PI.f6464.2

          \[\leadsto \mathsf{fma}\left(b, b \cdot 0.5, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \color{blue}{\pi}\right) \cdot 0.011111111111111112\right), 0.5\right)\right) \]
      8. Applied rewrites64.2%

        \[\leadsto \mathsf{fma}\left(b, b \cdot 0.5, \color{blue}{\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right)}\right) \]
    8. Recombined 3 regimes into one program.
    9. Final simplification63.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 1.22 \cdot 10^{-194}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b \cdot 0.5, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 5: 65.1% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (if (<= b 8.2e-129)
       (* (* a a) (fma 0.5 (cos (* (* PI angle) 0.011111111111111112)) 0.5))
       (if (<= b 1.1e+156)
         (fma
          (* angle angle)
          (* PI (* PI (* b (* b 3.08641975308642e-5))))
          (* a a))
         (* (* angle b) (* angle (* b (* 3.08641975308642e-5 (* PI PI))))))))
    double code(double a, double b, double angle) {
    	double tmp;
    	if (b <= 8.2e-129) {
    		tmp = (a * a) * fma(0.5, cos(((((double) M_PI) * angle) * 0.011111111111111112)), 0.5);
    	} else if (b <= 1.1e+156) {
    		tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
    	} else {
    		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))));
    	}
    	return tmp;
    }
    
    function code(a, b, angle)
    	tmp = 0.0
    	if (b <= 8.2e-129)
    		tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(pi * angle) * 0.011111111111111112)), 0.5));
    	elseif (b <= 1.1e+156)
    		tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a));
    	else
    		tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(3.08641975308642e-5 * Float64(pi * pi)))));
    	end
    	return tmp
    end
    
    code[a_, b_, angle_] := If[LessEqual[b, 8.2e-129], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+156], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\
    \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\\
    
    \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\
    \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < 8.1999999999999999e-129

      1. Initial program 79.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot a, 0.5, \left(a \cdot a\right) \cdot \left(0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
      6. Taylor expanded in a around inf

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

          \[\leadsto \color{blue}{{a}^{2} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
        2. unpow2N/A

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

          \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
        4. +-commutativeN/A

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

          \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), \frac{1}{2}\right)} \]
        6. lower-cos.f64N/A

          \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right) \]
        7. *-commutativeN/A

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

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

          \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{90}\right), \frac{1}{2}\right) \]
        10. lower-PI.f6462.6

          \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \color{blue}{\pi}\right) \cdot 0.011111111111111112\right), 0.5\right) \]
      8. Applied rewrites62.6%

        \[\leadsto \color{blue}{\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right)} \]

      if 8.1999999999999999e-129 < b < 1.10000000000000002e156

      1. Initial program 71.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. Add Preprocessing
      3. 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}} \]
      4. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
      5. Applied rewrites31.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
      6. Taylor expanded in b around inf

        \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{32400} \cdot \color{blue}{{b}^{2}}\right)\right), a \cdot a\right) \]
      7. Step-by-step derivation
        1. Applied rewrites61.8%

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

        if 1.10000000000000002e156 < b

        1. Initial program 97.4%

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

            \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
        5. Applied rewrites59.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
        6. Taylor expanded in b around inf

          \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites77.0%

            \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)} \]
          2. Step-by-step derivation
            1. Applied rewrites88.4%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 6: 65.3% accurate, 9.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (if (<= b 8.2e-129)
             (* a a)
             (if (<= b 1.1e+156)
               (fma
                (* angle angle)
                (* PI (* PI (* b (* b 3.08641975308642e-5))))
                (* a a))
               (* (* angle b) (* angle (* b (* 3.08641975308642e-5 (* PI PI))))))))
          double code(double a, double b, double angle) {
          	double tmp;
          	if (b <= 8.2e-129) {
          		tmp = a * a;
          	} else if (b <= 1.1e+156) {
          		tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
          	} else {
          		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	tmp = 0.0
          	if (b <= 8.2e-129)
          		tmp = Float64(a * a);
          	elseif (b <= 1.1e+156)
          		tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a));
          	else
          		tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(3.08641975308642e-5 * Float64(pi * pi)))));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := If[LessEqual[b, 8.2e-129], N[(a * a), $MachinePrecision], If[LessEqual[b, 1.1e+156], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\
          \;\;\;\;a \cdot a\\
          
          \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\
          \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if b < 8.1999999999999999e-129

            1. Initial program 79.2%

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

              \[\leadsto \color{blue}{{a}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{a \cdot a} \]
              2. lower-*.f6462.7

                \[\leadsto \color{blue}{a \cdot a} \]
            5. Applied rewrites62.7%

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

            if 8.1999999999999999e-129 < b < 1.10000000000000002e156

            1. Initial program 71.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. Add Preprocessing
            3. 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}} \]
            4. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
            5. Applied rewrites31.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
            6. Taylor expanded in b around inf

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{32400} \cdot \color{blue}{{b}^{2}}\right)\right), a \cdot a\right) \]
            7. Step-by-step derivation
              1. Applied rewrites61.8%

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

              if 1.10000000000000002e156 < b

              1. Initial program 97.4%

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
              5. Applied rewrites59.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
              6. Taylor expanded in b around inf

                \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites77.0%

                  \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)} \]
                2. Step-by-step derivation
                  1. Applied rewrites88.4%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 7: 65.3% accurate, 9.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\\ \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, b \cdot t\_0, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot t\_0\right)\\ \end{array} \end{array} \]
                (FPCore (a b angle)
                 :precision binary64
                 (let* ((t_0 (* b (* 3.08641975308642e-5 (* PI PI)))))
                   (if (<= b 8.2e-129)
                     (* a a)
                     (if (<= b 1.1e+156)
                       (fma (* angle angle) (* b t_0) (* a a))
                       (* (* angle b) (* angle t_0))))))
                double code(double a, double b, double angle) {
                	double t_0 = b * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)));
                	double tmp;
                	if (b <= 8.2e-129) {
                		tmp = a * a;
                	} else if (b <= 1.1e+156) {
                		tmp = fma((angle * angle), (b * t_0), (a * a));
                	} else {
                		tmp = (angle * b) * (angle * t_0);
                	}
                	return tmp;
                }
                
                function code(a, b, angle)
                	t_0 = Float64(b * Float64(3.08641975308642e-5 * Float64(pi * pi)))
                	tmp = 0.0
                	if (b <= 8.2e-129)
                		tmp = Float64(a * a);
                	elseif (b <= 1.1e+156)
                		tmp = fma(Float64(angle * angle), Float64(b * t_0), Float64(a * a));
                	else
                		tmp = Float64(Float64(angle * b) * Float64(angle * t_0));
                	end
                	return tmp
                end
                
                code[a_, b_, angle_] := Block[{t$95$0 = N[(b * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 8.2e-129], N[(a * a), $MachinePrecision], If[LessEqual[b, 1.1e+156], N[(N[(angle * angle), $MachinePrecision] * N[(b * t$95$0), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\\
                \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\
                \;\;\;\;a \cdot a\\
                
                \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\
                \;\;\;\;\mathsf{fma}\left(angle \cdot angle, b \cdot t\_0, a \cdot a\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot t\_0\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if b < 8.1999999999999999e-129

                  1. Initial program 79.2%

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

                    \[\leadsto \color{blue}{{a}^{2}} \]
                  4. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \color{blue}{a \cdot a} \]
                    2. lower-*.f6462.7

                      \[\leadsto \color{blue}{a \cdot a} \]
                  5. Applied rewrites62.7%

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

                  if 8.1999999999999999e-129 < b < 1.10000000000000002e156

                  1. Initial program 71.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. Add Preprocessing
                  3. 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}} \]
                  4. Step-by-step derivation
                    1. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
                  5. Applied rewrites31.5%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                  6. Taylor expanded in b around inf

                    \[\leadsto \mathsf{fma}\left(angle \cdot angle, \frac{1}{32400} \cdot \color{blue}{\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, a \cdot a\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites61.7%

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

                    if 1.10000000000000002e156 < b

                    1. Initial program 97.4%

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
                    5. Applied rewrites59.6%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                    6. Taylor expanded in b around inf

                      \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites77.0%

                        \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)} \]
                      2. Step-by-step derivation
                        1. Applied rewrites88.4%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, b \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 8: 63.0% accurate, 12.1× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.8 \cdot 10^{+71}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
                      (FPCore (a b angle)
                       :precision binary64
                       (if (<= b 1.8e+71)
                         (* a a)
                         (* (* angle b) (* angle (* b (* 3.08641975308642e-5 (* PI PI)))))))
                      double code(double a, double b, double angle) {
                      	double tmp;
                      	if (b <= 1.8e+71) {
                      		tmp = a * a;
                      	} else {
                      		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))));
                      	}
                      	return tmp;
                      }
                      
                      public static double code(double a, double b, double angle) {
                      	double tmp;
                      	if (b <= 1.8e+71) {
                      		tmp = a * a;
                      	} else {
                      		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (Math.PI * Math.PI))));
                      	}
                      	return tmp;
                      }
                      
                      def code(a, b, angle):
                      	tmp = 0
                      	if b <= 1.8e+71:
                      		tmp = a * a
                      	else:
                      		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (math.pi * math.pi))))
                      	return tmp
                      
                      function code(a, b, angle)
                      	tmp = 0.0
                      	if (b <= 1.8e+71)
                      		tmp = Float64(a * a);
                      	else
                      		tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(3.08641975308642e-5 * Float64(pi * pi)))));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(a, b, angle)
                      	tmp = 0.0;
                      	if (b <= 1.8e+71)
                      		tmp = a * a;
                      	else
                      		tmp = (angle * b) * (angle * (b * (3.08641975308642e-5 * (pi * pi))));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[a_, b_, angle_] := If[LessEqual[b, 1.8e+71], N[(a * a), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;b \leq 1.8 \cdot 10^{+71}:\\
                      \;\;\;\;a \cdot a\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if b < 1.8e71

                        1. Initial program 77.1%

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

                          \[\leadsto \color{blue}{{a}^{2}} \]
                        4. Step-by-step derivation
                          1. unpow2N/A

                            \[\leadsto \color{blue}{a \cdot a} \]
                          2. lower-*.f6462.0

                            \[\leadsto \color{blue}{a \cdot a} \]
                        5. Applied rewrites62.0%

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

                        if 1.8e71 < b

                        1. Initial program 92.2%

                          \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        2. Add Preprocessing
                        3. Taylor expanded in angle around 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}} \]
                        4. Step-by-step derivation
                          1. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
                        5. Applied rewrites55.8%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                        6. Taylor expanded in b around inf

                          \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites70.6%

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

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

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

                          Alternative 9: 61.6% accurate, 12.1× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.8 \cdot 10^{+71}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
                          (FPCore (a b angle)
                           :precision binary64
                           (if (<= b 1.8e+71)
                             (* a a)
                             (* angle (* angle (* b (* b (* 3.08641975308642e-5 (* PI PI))))))))
                          double code(double a, double b, double angle) {
                          	double tmp;
                          	if (b <= 1.8e+71) {
                          		tmp = a * a;
                          	} else {
                          		tmp = angle * (angle * (b * (b * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI))))));
                          	}
                          	return tmp;
                          }
                          
                          public static double code(double a, double b, double angle) {
                          	double tmp;
                          	if (b <= 1.8e+71) {
                          		tmp = a * a;
                          	} else {
                          		tmp = angle * (angle * (b * (b * (3.08641975308642e-5 * (Math.PI * Math.PI)))));
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b, angle):
                          	tmp = 0
                          	if b <= 1.8e+71:
                          		tmp = a * a
                          	else:
                          		tmp = angle * (angle * (b * (b * (3.08641975308642e-5 * (math.pi * math.pi)))))
                          	return tmp
                          
                          function code(a, b, angle)
                          	tmp = 0.0
                          	if (b <= 1.8e+71)
                          		tmp = Float64(a * a);
                          	else
                          		tmp = Float64(angle * Float64(angle * Float64(b * Float64(b * Float64(3.08641975308642e-5 * Float64(pi * pi))))));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(a, b, angle)
                          	tmp = 0.0;
                          	if (b <= 1.8e+71)
                          		tmp = a * a;
                          	else
                          		tmp = angle * (angle * (b * (b * (3.08641975308642e-5 * (pi * pi)))));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_, angle_] := If[LessEqual[b, 1.8e+71], N[(a * a), $MachinePrecision], N[(angle * N[(angle * N[(b * N[(b * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;b \leq 1.8 \cdot 10^{+71}:\\
                          \;\;\;\;a \cdot a\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;angle \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if b < 1.8e71

                            1. Initial program 77.1%

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

                              \[\leadsto \color{blue}{{a}^{2}} \]
                            4. Step-by-step derivation
                              1. unpow2N/A

                                \[\leadsto \color{blue}{a \cdot a} \]
                              2. lower-*.f6462.0

                                \[\leadsto \color{blue}{a \cdot a} \]
                            5. Applied rewrites62.0%

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

                            if 1.8e71 < b

                            1. Initial program 92.2%

                              \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            2. Add Preprocessing
                            3. Taylor expanded in angle around 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}} \]
                            4. Step-by-step derivation
                              1. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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)} \]
                            5. Applied rewrites55.8%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                            6. Taylor expanded in b around inf

                              \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites70.6%

                                \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)} \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification63.9%

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

                            Alternative 10: 57.0% accurate, 74.7× speedup?

                            \[\begin{array}{l} \\ a \cdot a \end{array} \]
                            (FPCore (a b angle) :precision binary64 (* a a))
                            double code(double a, double b, double angle) {
                            	return a * a;
                            }
                            
                            real(8) function code(a, b, angle)
                                real(8), intent (in) :: a
                                real(8), intent (in) :: b
                                real(8), intent (in) :: angle
                                code = a * a
                            end function
                            
                            public static double code(double a, double b, double angle) {
                            	return a * a;
                            }
                            
                            def code(a, b, angle):
                            	return a * a
                            
                            function code(a, b, angle)
                            	return Float64(a * a)
                            end
                            
                            function tmp = code(a, b, angle)
                            	tmp = a * a;
                            end
                            
                            code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            a \cdot a
                            \end{array}
                            
                            Derivation
                            1. Initial program 80.5%

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

                              \[\leadsto \color{blue}{{a}^{2}} \]
                            4. Step-by-step derivation
                              1. unpow2N/A

                                \[\leadsto \color{blue}{a \cdot a} \]
                              2. lower-*.f6454.0

                                \[\leadsto \color{blue}{a \cdot a} \]
                            5. Applied rewrites54.0%

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

                            Reproduce

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