ab-angle->ABCF C

Percentage Accurate: 80.0% → 80.1%
Time: 15.7s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

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

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

\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(a \cdot \cos \left(\frac{1}{\frac{1}{t\_0}}\right)\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.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 \left(\mathsf{PI}\left(\right) \cdot \frac{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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
    3. clear-numN/A

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\pi}{180} \cdot \frac{1}{\frac{1}{angle}}\right)}\right)}^{2} \]
  5. 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(\frac{\mathsf{PI}\left(\right)}{180} \cdot \frac{1}{\frac{1}{angle}}\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(\frac{\mathsf{PI}\left(\right)}{180} \cdot \frac{1}{\frac{1}{angle}}\right)\right)}^{2} \]
    3. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.0% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
    4. clear-numN/A

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

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

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

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

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

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

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

Alternative 3: 80.0% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
    4. div-invN/A

      \[\leadsto {\left(a \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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} \]
    5. metadata-evalN/A

      \[\leadsto {\left(a \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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} \]
    6. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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} \]
    7. *-commutativeN/A

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

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

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

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

Alternative 4: 79.9% accurate, 1.8× speedup?

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

\\
a \cdot a + {\left(b \cdot \sin \left(\frac{1}{\frac{\frac{180}{angle}}{\pi}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
    3. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.0% accurate, 1.9× speedup?

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

\\
a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
  4. Step-by-step derivation
    1. unpow2N/A

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

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

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

Alternative 6: 55.6% accurate, 8.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 6.4 \cdot 10^{+69}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot \left(\pi \cdot \pi\right)\right) \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right), angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 6.4e+69)
   (fma
    (*
     (* angle (* PI PI))
     (fma b (* b 3.08641975308642e-5) (* (* a a) -3.08641975308642e-5)))
    angle
    (* a a))
   (* a a)))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 6.4e+69) {
		tmp = fma(((angle * (((double) M_PI) * ((double) M_PI))) * fma(b, (b * 3.08641975308642e-5), ((a * a) * -3.08641975308642e-5))), angle, (a * a));
	} else {
		tmp = a * a;
	}
	return tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (a <= 6.4e+69)
		tmp = fma(Float64(Float64(angle * Float64(pi * pi)) * fma(b, Float64(b * 3.08641975308642e-5), Float64(Float64(a * a) * -3.08641975308642e-5))), angle, Float64(a * a));
	else
		tmp = Float64(a * a);
	end
	return tmp
end
code[a_, b_, angle_] := If[LessEqual[a, 6.4e+69], N[(N[(N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.4 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot \left(\pi \cdot \pi\right)\right) \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right), angle, a \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.3999999999999997e69

    1. Initial program 75.9%

      \[{\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 rewrites43.2%

      \[\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. Step-by-step derivation
      1. Applied rewrites46.5%

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

      if 6.3999999999999997e69 < a

      1. Initial program 84.6%

        \[{\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-*.f6482.1

          \[\leadsto \color{blue}{a \cdot a} \]
      5. Applied rewrites82.1%

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

    Alternative 7: 64.1% accurate, 9.1× speedup?

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

      1. Initial program 75.9%

        \[{\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-*.f6461.9

          \[\leadsto \color{blue}{a \cdot a} \]
      5. Applied rewrites61.9%

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

      if 2.70000000000000007e-36 < b < 2.99999999999999996e183

      1. Initial program 72.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}{{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 rewrites36.2%

        \[\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 rewrites59.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 2.99999999999999996e183 < b

        1. Initial program 99.7%

          \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
        2. 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 rewrites46.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 \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 rewrites63.2%

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.7 \cdot 10^{-36}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+183}:\\ \;\;\;\;\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}:\\ \;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot \left(angle \cdot b\right)\right) \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 62.9% accurate, 12.1× speedup?

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

            1. Initial program 74.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-*.f6459.4

                \[\leadsto \color{blue}{a \cdot a} \]
            5. Applied rewrites59.4%

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

            if 4.9000000000000001e149 < b

            1. Initial program 99.8%

              \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
            2. 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 rewrites47.3%

              \[\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 rewrites67.3%

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

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

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

              Alternative 9: 62.0% accurate, 12.1× speedup?

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

                1. Initial program 74.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-*.f6459.4

                    \[\leadsto \color{blue}{a \cdot a} \]
                5. Applied rewrites59.4%

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

                if 2.2e149 < b

                1. Initial program 99.8%

                  \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                2. 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 rewrites47.3%

                  \[\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 rewrites67.3%

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

                      \[\leadsto \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) \cdot angle \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification60.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.2 \cdot 10^{+149}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \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)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 10: 61.0% accurate, 12.1× speedup?

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

                    1. Initial program 74.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-*.f6459.4

                        \[\leadsto \color{blue}{a \cdot a} \]
                    5. Applied rewrites59.4%

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

                    if 4.9999999999999999e149 < b

                    1. Initial program 99.8%

                      \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    2. 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 rewrites47.3%

                      \[\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 rewrites67.3%

                        \[\leadsto \left(angle \cdot angle\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)} \]
                      2. 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)} \]
                      3. Step-by-step derivation
                        1. Applied rewrites67.3%

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

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

                      Alternative 11: 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 77.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-*.f6456.2

                          \[\leadsto \color{blue}{a \cdot a} \]
                      5. Applied rewrites56.2%

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

                      Reproduce

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