ab-angle->ABCF A

Percentage Accurate: 80.3% → 80.3%
Time: 3.2s
Alternatives: 13
Speedup: 0.7×

Specification

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 80.3% accurate, 1.0× speedup?

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

Alternative 1: 80.3% accurate, 0.7× speedup?

\[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{2} - \frac{1}{180} \cdot angle\right)\right)\right)\right)}^{2} \]
(FPCore (a b angle)
  :precision binary64
  (+
 (pow (* a (sin (* (/ angle 180) PI))) 2)
 (pow
  (* b (sin (* (pow PI 2/3) (* (cbrt PI) (- 1/2 (* 1/180 angle))))))
  2)))
double code(double a, double b, double angle) {
	return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin((pow(((double) M_PI), 0.6666666666666666) * (cbrt(((double) M_PI)) * (0.5 - (0.005555555555555556 * angle)))))), 2.0);
}
public static double code(double a, double b, double angle) {
	return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin((Math.pow(Math.PI, 0.6666666666666666) * (Math.cbrt(Math.PI) * (0.5 - (0.005555555555555556 * angle)))))), 2.0);
}
function code(a, b, angle)
	return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64((pi ^ 0.6666666666666666) * Float64(cbrt(pi) * Float64(0.5 - Float64(0.005555555555555556 * angle)))))) ^ 2.0))
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[Power[Pi, 2/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(1/2 - N[(1/180 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision]
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{2} - \frac{1}{180} \cdot angle\right)\right)\right)\right)}^{2}
Derivation
  1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{2} + \color{blue}{\frac{-1}{180} \cdot angle}\right)\right)\right)\right)}^{2} \]
    19. fp-cancel-sign-sub-invN/A

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{2} - \color{blue}{\frac{1}{180} \cdot angle}\right)\right)\right)\right)}^{2} \]
    22. lower--.f6480.2%

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

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

Alternative 2: 80.3% accurate, 1.2× speedup?

\[{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{\left|angle\right|}}\right)\right)}^{2} + \left(\frac{1}{2} + \frac{1}{2} \cdot \sin \left(\pi \cdot \left(\frac{1}{2} - \frac{1}{90} \cdot \left|angle\right|\right)\right)\right) \cdot \left(b \cdot b\right) \]
(FPCore (a b angle)
  :precision binary64
  (+
 (pow (* a (sin (/ PI (/ 180 (fabs angle))))) 2)
 (*
  (+ 1/2 (* 1/2 (sin (* PI (- 1/2 (* 1/90 (fabs angle)))))))
  (* b b))))
double code(double a, double b, double angle) {
	return pow((a * sin((((double) M_PI) / (180.0 / fabs(angle))))), 2.0) + ((0.5 + (0.5 * sin((((double) M_PI) * (0.5 - (0.011111111111111112 * fabs(angle))))))) * (b * b));
}
public static double code(double a, double b, double angle) {
	return Math.pow((a * Math.sin((Math.PI / (180.0 / Math.abs(angle))))), 2.0) + ((0.5 + (0.5 * Math.sin((Math.PI * (0.5 - (0.011111111111111112 * Math.abs(angle))))))) * (b * b));
}
def code(a, b, angle):
	return math.pow((a * math.sin((math.pi / (180.0 / math.fabs(angle))))), 2.0) + ((0.5 + (0.5 * math.sin((math.pi * (0.5 - (0.011111111111111112 * math.fabs(angle))))))) * (b * b))
function code(a, b, angle)
	return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / abs(angle))))) ^ 2.0) + Float64(Float64(0.5 + Float64(0.5 * sin(Float64(pi * Float64(0.5 - Float64(0.011111111111111112 * abs(angle))))))) * Float64(b * b)))
end
function tmp = code(a, b, angle)
	tmp = ((a * sin((pi / (180.0 / abs(angle))))) ^ 2.0) + ((0.5 + (0.5 * sin((pi * (0.5 - (0.011111111111111112 * abs(angle))))))) * (b * b));
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180 / N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2], $MachinePrecision] + N[(N[(1/2 + N[(1/2 * N[Sin[N[(Pi * N[(1/2 - N[(1/90 * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{\left|angle\right|}}\right)\right)}^{2} + \left(\frac{1}{2} + \frac{1}{2} \cdot \sin \left(\pi \cdot \left(\frac{1}{2} - \frac{1}{90} \cdot \left|angle\right|\right)\right)\right) \cdot \left(b \cdot b\right)
Derivation
  1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + \left(\frac{1}{2} + \frac{1}{2} \cdot \sin \color{blue}{\left(\frac{1}{2} \cdot \pi + \frac{-1}{90} \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \left(b \cdot b\right) \]
    16. lift-sin.f6480.2%

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + \left(\frac{1}{2} + \frac{1}{2} \cdot \sin \left(\frac{1}{2} \cdot \pi + \color{blue}{\frac{-1}{90} \cdot \left(\pi \cdot angle\right)}\right)\right) \cdot \left(b \cdot b\right) \]
    19. fp-cancel-sign-sub-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + \left(\frac{1}{2} + \frac{1}{2} \cdot \sin \color{blue}{\left(\frac{1}{2} \cdot \pi - \left(\mathsf{neg}\left(\frac{-1}{90}\right)\right) \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot \left(b \cdot b\right) \]
  7. Applied rewrites80.2%

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

Alternative 3: 80.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.1% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 80.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 76.1% accurate, 1.8× speedup?

      \[\begin{array}{l} t_0 := \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b\\ \mathbf{if}\;\left|angle\right| \leq \frac{5224175567749775}{18014398509481984}:\\ \;\;\;\;\left(\frac{1}{32400} \cdot \left(a \cdot \left({\left(\left|angle\right|\right)}^{2} \cdot {\pi}^{2}\right)\right)\right) \cdot a + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(\left|angle\right| \cdot \pi\right)\right)\right)\right) \cdot a + t\_0\\ \end{array} \]
      (FPCore (a b angle)
        :precision binary64
        (let* ((t_0 (* (* (+ 1/2 1/2) b) b)))
        (if (<= (fabs angle) 5224175567749775/18014398509481984)
          (+
           (* (* 1/32400 (* a (* (pow (fabs angle) 2) (pow PI 2)))) a)
           t_0)
          (+
           (* (* a (- 1/2 (* 1/2 (cos (* 1/90 (* (fabs angle) PI)))))) a)
           t_0))))
      double code(double a, double b, double angle) {
      	double t_0 = ((0.5 + 0.5) * b) * b;
      	double tmp;
      	if (fabs(angle) <= 0.29) {
      		tmp = ((3.08641975308642e-5 * (a * (pow(fabs(angle), 2.0) * pow(((double) M_PI), 2.0)))) * a) + t_0;
      	} else {
      		tmp = ((a * (0.5 - (0.5 * cos((0.011111111111111112 * (fabs(angle) * ((double) M_PI))))))) * a) + t_0;
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double angle) {
      	double t_0 = ((0.5 + 0.5) * b) * b;
      	double tmp;
      	if (Math.abs(angle) <= 0.29) {
      		tmp = ((3.08641975308642e-5 * (a * (Math.pow(Math.abs(angle), 2.0) * Math.pow(Math.PI, 2.0)))) * a) + t_0;
      	} else {
      		tmp = ((a * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (Math.abs(angle) * Math.PI)))))) * a) + t_0;
      	}
      	return tmp;
      }
      
      def code(a, b, angle):
      	t_0 = ((0.5 + 0.5) * b) * b
      	tmp = 0
      	if math.fabs(angle) <= 0.29:
      		tmp = ((3.08641975308642e-5 * (a * (math.pow(math.fabs(angle), 2.0) * math.pow(math.pi, 2.0)))) * a) + t_0
      	else:
      		tmp = ((a * (0.5 - (0.5 * math.cos((0.011111111111111112 * (math.fabs(angle) * math.pi)))))) * a) + t_0
      	return tmp
      
      function code(a, b, angle)
      	t_0 = Float64(Float64(Float64(0.5 + 0.5) * b) * b)
      	tmp = 0.0
      	if (abs(angle) <= 0.29)
      		tmp = Float64(Float64(Float64(3.08641975308642e-5 * Float64(a * Float64((abs(angle) ^ 2.0) * (pi ^ 2.0)))) * a) + t_0);
      	else
      		tmp = Float64(Float64(Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(abs(angle) * pi)))))) * a) + t_0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, angle)
      	t_0 = ((0.5 + 0.5) * b) * b;
      	tmp = 0.0;
      	if (abs(angle) <= 0.29)
      		tmp = ((3.08641975308642e-5 * (a * ((abs(angle) ^ 2.0) * (pi ^ 2.0)))) * a) + t_0;
      	else
      		tmp = ((a * (0.5 - (0.5 * cos((0.011111111111111112 * (abs(angle) * pi)))))) * a) + t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(N[(1/2 + 1/2), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[Abs[angle], $MachinePrecision], 5224175567749775/18014398509481984], N[(N[(N[(1/32400 * N[(a * N[(N[Power[N[Abs[angle], $MachinePrecision], 2], $MachinePrecision] * N[Power[Pi, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(a * N[(1/2 - N[(1/2 * N[Cos[N[(1/90 * N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] + t$95$0), $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b\\
      \mathbf{if}\;\left|angle\right| \leq \frac{5224175567749775}{18014398509481984}:\\
      \;\;\;\;\left(\frac{1}{32400} \cdot \left(a \cdot \left({\left(\left|angle\right|\right)}^{2} \cdot {\pi}^{2}\right)\right)\right) \cdot a + t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(\left|angle\right| \cdot \pi\right)\right)\right)\right) \cdot a + t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if angle < 0.28999999999999998

        1. Initial program 80.3%

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

          \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
        3. Taylor expanded in angle around 0

          \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
        4. Step-by-step derivation
          1. Applied rewrites57.6%

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

            \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
          3. Step-by-step derivation
            1. Applied rewrites57.7%

              \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
            2. Taylor expanded in angle around 0

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

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

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

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

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

                \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{2}}\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
              6. lower-PI.f6471.0%

                \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
            4. Applied rewrites71.0%

              \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left(a \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)\right)} \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]

            if 0.28999999999999998 < angle

            1. Initial program 80.3%

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

              \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
            3. Taylor expanded in angle around 0

              \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
            4. Step-by-step derivation
              1. Applied rewrites57.6%

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

                \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
              3. Step-by-step derivation
                1. Applied rewrites57.7%

                  \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto \left(a \cdot \color{blue}{\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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                  2. lower--.f64N/A

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

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

                    \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                  7. lower-PI.f6468.4%

                    \[\leadsto \left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                4. Applied rewrites68.4%

                  \[\leadsto \color{blue}{\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 8: 71.3% accurate, 2.9× speedup?

              \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq \frac{7642277889662869}{463168356949264781694283940034751631413079938662562256157830336031652518559744}:\\ \;\;\;\;\left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\ \end{array} \]
              (FPCore (a b angle)
                :precision binary64
                (let* ((t_0 (* (fabs b) (fabs b))))
                (if (<=
                     (fabs b)
                     7642277889662869/463168356949264781694283940034751631413079938662562256157830336031652518559744)
                  (+
                   (*
                    (*
                     (- (* t_0 -1/32400) (* (* a a) -1/32400))
                     (* (* PI PI) angle))
                    angle)
                   t_0)
                  (+
                   (* (* a (- 1/2 (* 1/2 (cos (* 1/90 (* angle PI)))))) a)
                   (* (* (+ 1/2 1/2) (fabs b)) (fabs b))))))
              double code(double a, double b, double angle) {
              	double t_0 = fabs(b) * fabs(b);
              	double tmp;
              	if (fabs(b) <= 1.65e-62) {
              		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((((double) M_PI) * ((double) M_PI)) * angle)) * angle) + t_0;
              	} else {
              		tmp = ((a * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI))))))) * a) + (((0.5 + 0.5) * fabs(b)) * fabs(b));
              	}
              	return tmp;
              }
              
              public static double code(double a, double b, double angle) {
              	double t_0 = Math.abs(b) * Math.abs(b);
              	double tmp;
              	if (Math.abs(b) <= 1.65e-62) {
              		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((Math.PI * Math.PI) * angle)) * angle) + t_0;
              	} else {
              		tmp = ((a * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI)))))) * a) + (((0.5 + 0.5) * Math.abs(b)) * Math.abs(b));
              	}
              	return tmp;
              }
              
              def code(a, b, angle):
              	t_0 = math.fabs(b) * math.fabs(b)
              	tmp = 0
              	if math.fabs(b) <= 1.65e-62:
              		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((math.pi * math.pi) * angle)) * angle) + t_0
              	else:
              		tmp = ((a * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi)))))) * a) + (((0.5 + 0.5) * math.fabs(b)) * math.fabs(b))
              	return tmp
              
              function code(a, b, angle)
              	t_0 = Float64(abs(b) * abs(b))
              	tmp = 0.0
              	if (abs(b) <= 1.65e-62)
              		tmp = Float64(Float64(Float64(Float64(Float64(t_0 * -3.08641975308642e-5) - Float64(Float64(a * a) * -3.08641975308642e-5)) * Float64(Float64(pi * pi) * angle)) * angle) + t_0);
              	else
              		tmp = Float64(Float64(Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi)))))) * a) + Float64(Float64(Float64(0.5 + 0.5) * abs(b)) * abs(b)));
              	end
              	return tmp
              end
              
              function tmp_2 = code(a, b, angle)
              	t_0 = abs(b) * abs(b);
              	tmp = 0.0;
              	if (abs(b) <= 1.65e-62)
              		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((pi * pi) * angle)) * angle) + t_0;
              	else
              		tmp = ((a * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi)))))) * a) + (((0.5 + 0.5) * abs(b)) * abs(b));
              	end
              	tmp_2 = tmp;
              end
              
              code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 7642277889662869/463168356949264781694283940034751631413079938662562256157830336031652518559744], N[(N[(N[(N[(N[(t$95$0 * -1/32400), $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * -1/32400), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(a * N[(1/2 - N[(1/2 * N[Cos[N[(1/90 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              t_0 := \left|b\right| \cdot \left|b\right|\\
              \mathbf{if}\;\left|b\right| \leq \frac{7642277889662869}{463168356949264781694283940034751631413079938662562256157830336031652518559744}:\\
              \;\;\;\;\left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + t\_0\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < 1.65e-62

                1. Initial program 80.3%

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

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

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

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

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

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

                      \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                    3. associate-*r*N/A

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

                      \[\leadsto \left(\left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot angle\right) \cdot angle + \color{blue}{b} \cdot b \]
                  3. Applied rewrites43.1%

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + \color{blue}{b} \cdot b \]

                  if 1.65e-62 < b

                  1. Initial program 80.3%

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

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                  3. Taylor expanded in angle around 0

                    \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                  4. Step-by-step derivation
                    1. Applied rewrites57.6%

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

                      \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                    3. Step-by-step derivation
                      1. Applied rewrites57.7%

                        \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                      2. Taylor expanded in a around 0

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

                          \[\leadsto \left(a \cdot \color{blue}{\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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                        2. lower--.f64N/A

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

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

                          \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                        5. lower-*.f64N/A

                          \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                        6. lower-*.f64N/A

                          \[\leadsto \left(a \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) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                        7. lower-PI.f6468.4%

                          \[\leadsto \left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                      4. Applied rewrites68.4%

                        \[\leadsto \color{blue}{\left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 9: 68.6% accurate, 6.6× speedup?

                    \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\ \;\;\;\;\left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\ \end{array} \]
                    (FPCore (a b angle)
                      :precision binary64
                      (let* ((t_0 (* (fabs b) (fabs b))))
                      (if (<=
                           (fabs b)
                           2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432)
                        (+
                         (*
                          (*
                           (- (* t_0 -1/32400) (* (* a a) -1/32400))
                           (* (* PI PI) angle))
                          angle)
                         t_0)
                        (+
                         (* (* (- 1/2 1/2) a) a)
                         (* (* (+ 1/2 1/2) (fabs b)) (fabs b))))))
                    double code(double a, double b, double angle) {
                    	double t_0 = fabs(b) * fabs(b);
                    	double tmp;
                    	if (fabs(b) <= 2.95e+147) {
                    		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((((double) M_PI) * ((double) M_PI)) * angle)) * angle) + t_0;
                    	} else {
                    		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * fabs(b)) * fabs(b));
                    	}
                    	return tmp;
                    }
                    
                    public static double code(double a, double b, double angle) {
                    	double t_0 = Math.abs(b) * Math.abs(b);
                    	double tmp;
                    	if (Math.abs(b) <= 2.95e+147) {
                    		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((Math.PI * Math.PI) * angle)) * angle) + t_0;
                    	} else {
                    		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * Math.abs(b)) * Math.abs(b));
                    	}
                    	return tmp;
                    }
                    
                    def code(a, b, angle):
                    	t_0 = math.fabs(b) * math.fabs(b)
                    	tmp = 0
                    	if math.fabs(b) <= 2.95e+147:
                    		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((math.pi * math.pi) * angle)) * angle) + t_0
                    	else:
                    		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * math.fabs(b)) * math.fabs(b))
                    	return tmp
                    
                    function code(a, b, angle)
                    	t_0 = Float64(abs(b) * abs(b))
                    	tmp = 0.0
                    	if (abs(b) <= 2.95e+147)
                    		tmp = Float64(Float64(Float64(Float64(Float64(t_0 * -3.08641975308642e-5) - Float64(Float64(a * a) * -3.08641975308642e-5)) * Float64(Float64(pi * pi) * angle)) * angle) + t_0);
                    	else
                    		tmp = Float64(Float64(Float64(Float64(0.5 - 0.5) * a) * a) + Float64(Float64(Float64(0.5 + 0.5) * abs(b)) * abs(b)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(a, b, angle)
                    	t_0 = abs(b) * abs(b);
                    	tmp = 0.0;
                    	if (abs(b) <= 2.95e+147)
                    		tmp = ((((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((pi * pi) * angle)) * angle) + t_0;
                    	else
                    		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * abs(b)) * abs(b));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432], N[(N[(N[(N[(N[(t$95$0 * -1/32400), $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * -1/32400), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(N[(1/2 - 1/2), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    t_0 := \left|b\right| \cdot \left|b\right|\\
                    \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\
                    \;\;\;\;\left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + t\_0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if b < 2.9500000000000001e147

                      1. Initial program 80.3%

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

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

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

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

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

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

                            \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                          3. associate-*r*N/A

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

                            \[\leadsto \left(\left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot angle\right) \cdot angle + \color{blue}{b} \cdot b \]
                        3. Applied rewrites43.1%

                          \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot angle\right)\right) \cdot angle + \color{blue}{b} \cdot b \]

                        if 2.9500000000000001e147 < b

                        1. Initial program 80.3%

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

                          \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                        3. Taylor expanded in angle around 0

                          \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                        4. Step-by-step derivation
                          1. Applied rewrites57.6%

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

                            \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                          3. Step-by-step derivation
                            1. Applied rewrites57.7%

                              \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                          4. Recombined 2 regimes into one program.
                          5. Add Preprocessing

                          Alternative 10: 66.3% accurate, 6.6× speedup?

                          \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\ \;\;\;\;\left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot t\_0 + \left(\frac{1}{32400} \cdot a\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\ \end{array} \]
                          (FPCore (a b angle)
                            :precision binary64
                            (let* ((t_0 (* (fabs b) (fabs b))))
                            (if (<=
                                 (fabs b)
                                 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432)
                              (+
                               (*
                                (* (* PI PI) (+ (* -1/32400 t_0) (* (* 1/32400 a) a)))
                                (* angle angle))
                               t_0)
                              (+
                               (* (* (- 1/2 1/2) a) a)
                               (* (* (+ 1/2 1/2) (fabs b)) (fabs b))))))
                          double code(double a, double b, double angle) {
                          	double t_0 = fabs(b) * fabs(b);
                          	double tmp;
                          	if (fabs(b) <= 2.95e+147) {
                          		tmp = (((((double) M_PI) * ((double) M_PI)) * ((-3.08641975308642e-5 * t_0) + ((3.08641975308642e-5 * a) * a))) * (angle * angle)) + t_0;
                          	} else {
                          		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * fabs(b)) * fabs(b));
                          	}
                          	return tmp;
                          }
                          
                          public static double code(double a, double b, double angle) {
                          	double t_0 = Math.abs(b) * Math.abs(b);
                          	double tmp;
                          	if (Math.abs(b) <= 2.95e+147) {
                          		tmp = (((Math.PI * Math.PI) * ((-3.08641975308642e-5 * t_0) + ((3.08641975308642e-5 * a) * a))) * (angle * angle)) + t_0;
                          	} else {
                          		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * Math.abs(b)) * Math.abs(b));
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b, angle):
                          	t_0 = math.fabs(b) * math.fabs(b)
                          	tmp = 0
                          	if math.fabs(b) <= 2.95e+147:
                          		tmp = (((math.pi * math.pi) * ((-3.08641975308642e-5 * t_0) + ((3.08641975308642e-5 * a) * a))) * (angle * angle)) + t_0
                          	else:
                          		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * math.fabs(b)) * math.fabs(b))
                          	return tmp
                          
                          function code(a, b, angle)
                          	t_0 = Float64(abs(b) * abs(b))
                          	tmp = 0.0
                          	if (abs(b) <= 2.95e+147)
                          		tmp = Float64(Float64(Float64(Float64(pi * pi) * Float64(Float64(-3.08641975308642e-5 * t_0) + Float64(Float64(3.08641975308642e-5 * a) * a))) * Float64(angle * angle)) + t_0);
                          	else
                          		tmp = Float64(Float64(Float64(Float64(0.5 - 0.5) * a) * a) + Float64(Float64(Float64(0.5 + 0.5) * abs(b)) * abs(b)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(a, b, angle)
                          	t_0 = abs(b) * abs(b);
                          	tmp = 0.0;
                          	if (abs(b) <= 2.95e+147)
                          		tmp = (((pi * pi) * ((-3.08641975308642e-5 * t_0) + ((3.08641975308642e-5 * a) * a))) * (angle * angle)) + t_0;
                          	else
                          		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * abs(b)) * abs(b));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432], N[(N[(N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(-1/32400 * t$95$0), $MachinePrecision] + N[(N[(1/32400 * a), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(N[(1/2 - 1/2), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          t_0 := \left|b\right| \cdot \left|b\right|\\
                          \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\
                          \;\;\;\;\left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot t\_0 + \left(\frac{1}{32400} \cdot a\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + t\_0\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\
                          
                          
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if b < 2.9500000000000001e147

                            1. Initial program 80.3%

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

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

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

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

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

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                2. lift-*.f64N/A

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                3. associate-*l*N/A

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + a \cdot \left(a \cdot \frac{1}{32400}\right)\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                4. *-commutativeN/A

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot \frac{1}{32400}\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                5. lower-*.f64N/A

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot \frac{1}{32400}\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                6. *-commutativeN/A

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(\frac{1}{32400} \cdot a\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                7. lower-*.f6440.9%

                                  \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(\frac{1}{32400} \cdot a\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                              3. Applied rewrites40.9%

                                \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(\frac{1}{32400} \cdot a\right) \cdot a\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]

                              if 2.9500000000000001e147 < b

                              1. Initial program 80.3%

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

                                \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                              3. Taylor expanded in angle around 0

                                \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                              4. Step-by-step derivation
                                1. Applied rewrites57.6%

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

                                  \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                3. Step-by-step derivation
                                  1. Applied rewrites57.7%

                                    \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                4. Recombined 2 regimes into one program.
                                5. Add Preprocessing

                                Alternative 11: 66.2% accurate, 6.6× speedup?

                                \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\ \;\;\;\;\left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \pi\right) + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\ \end{array} \]
                                (FPCore (a b angle)
                                  :precision binary64
                                  (let* ((t_0 (* (fabs b) (fabs b))))
                                  (if (<=
                                       (fabs b)
                                       2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432)
                                    (+
                                     (*
                                      (* (* angle angle) PI)
                                      (* (- (* t_0 -1/32400) (* (* a a) -1/32400)) PI))
                                     t_0)
                                    (+
                                     (* (* (- 1/2 1/2) a) a)
                                     (* (* (+ 1/2 1/2) (fabs b)) (fabs b))))))
                                double code(double a, double b, double angle) {
                                	double t_0 = fabs(b) * fabs(b);
                                	double tmp;
                                	if (fabs(b) <= 2.95e+147) {
                                		tmp = (((angle * angle) * ((double) M_PI)) * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * ((double) M_PI))) + t_0;
                                	} else {
                                		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * fabs(b)) * fabs(b));
                                	}
                                	return tmp;
                                }
                                
                                public static double code(double a, double b, double angle) {
                                	double t_0 = Math.abs(b) * Math.abs(b);
                                	double tmp;
                                	if (Math.abs(b) <= 2.95e+147) {
                                		tmp = (((angle * angle) * Math.PI) * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * Math.PI)) + t_0;
                                	} else {
                                		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * Math.abs(b)) * Math.abs(b));
                                	}
                                	return tmp;
                                }
                                
                                def code(a, b, angle):
                                	t_0 = math.fabs(b) * math.fabs(b)
                                	tmp = 0
                                	if math.fabs(b) <= 2.95e+147:
                                		tmp = (((angle * angle) * math.pi) * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * math.pi)) + t_0
                                	else:
                                		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * math.fabs(b)) * math.fabs(b))
                                	return tmp
                                
                                function code(a, b, angle)
                                	t_0 = Float64(abs(b) * abs(b))
                                	tmp = 0.0
                                	if (abs(b) <= 2.95e+147)
                                		tmp = Float64(Float64(Float64(Float64(angle * angle) * pi) * Float64(Float64(Float64(t_0 * -3.08641975308642e-5) - Float64(Float64(a * a) * -3.08641975308642e-5)) * pi)) + t_0);
                                	else
                                		tmp = Float64(Float64(Float64(Float64(0.5 - 0.5) * a) * a) + Float64(Float64(Float64(0.5 + 0.5) * abs(b)) * abs(b)));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(a, b, angle)
                                	t_0 = abs(b) * abs(b);
                                	tmp = 0.0;
                                	if (abs(b) <= 2.95e+147)
                                		tmp = (((angle * angle) * pi) * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * pi)) + t_0;
                                	else
                                		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * abs(b)) * abs(b));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432], N[(N[(N[(N[(angle * angle), $MachinePrecision] * Pi), $MachinePrecision] * N[(N[(N[(t$95$0 * -1/32400), $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * -1/32400), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(N[(1/2 - 1/2), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                t_0 := \left|b\right| \cdot \left|b\right|\\
                                \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\
                                \;\;\;\;\left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \pi\right) + t\_0\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if b < 2.9500000000000001e147

                                  1. Initial program 80.3%

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) + b \cdot b \]
                                      5. associate-*l*N/A

                                        \[\leadsto \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right)\right) + b \cdot b \]
                                      6. associate-*r*N/A

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

                                        \[\leadsto \left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\pi \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) + \color{blue}{b} \cdot b \]
                                      8. lower-*.f64N/A

                                        \[\leadsto \left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\pi \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) + b \cdot b \]
                                      9. *-commutativeN/A

                                        \[\leadsto \left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \pi\right) + b \cdot b \]
                                      10. lower-*.f6440.8%

                                        \[\leadsto \left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \pi\right) + b \cdot b \]
                                    3. Applied rewrites40.8%

                                      \[\leadsto \left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \pi\right) + \color{blue}{b} \cdot b \]

                                    if 2.9500000000000001e147 < b

                                    1. Initial program 80.3%

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

                                      \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                                    3. Taylor expanded in angle around 0

                                      \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites57.6%

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

                                        \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites57.7%

                                          \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                      4. Recombined 2 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 12: 66.2% accurate, 6.6× speedup?

                                      \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\ \;\;\;\;\pi \cdot \left(\pi \cdot \left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\ \end{array} \]
                                      (FPCore (a b angle)
                                        :precision binary64
                                        (let* ((t_0 (* (fabs b) (fabs b))))
                                        (if (<=
                                             (fabs b)
                                             2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432)
                                          (+
                                           (*
                                            PI
                                            (*
                                             PI
                                             (* (- (* t_0 -1/32400) (* (* a a) -1/32400)) (* angle angle))))
                                           t_0)
                                          (+
                                           (* (* (- 1/2 1/2) a) a)
                                           (* (* (+ 1/2 1/2) (fabs b)) (fabs b))))))
                                      double code(double a, double b, double angle) {
                                      	double t_0 = fabs(b) * fabs(b);
                                      	double tmp;
                                      	if (fabs(b) <= 2.95e+147) {
                                      		tmp = (((double) M_PI) * (((double) M_PI) * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * (angle * angle)))) + t_0;
                                      	} else {
                                      		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * fabs(b)) * fabs(b));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      public static double code(double a, double b, double angle) {
                                      	double t_0 = Math.abs(b) * Math.abs(b);
                                      	double tmp;
                                      	if (Math.abs(b) <= 2.95e+147) {
                                      		tmp = (Math.PI * (Math.PI * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * (angle * angle)))) + t_0;
                                      	} else {
                                      		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * Math.abs(b)) * Math.abs(b));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(a, b, angle):
                                      	t_0 = math.fabs(b) * math.fabs(b)
                                      	tmp = 0
                                      	if math.fabs(b) <= 2.95e+147:
                                      		tmp = (math.pi * (math.pi * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * (angle * angle)))) + t_0
                                      	else:
                                      		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * math.fabs(b)) * math.fabs(b))
                                      	return tmp
                                      
                                      function code(a, b, angle)
                                      	t_0 = Float64(abs(b) * abs(b))
                                      	tmp = 0.0
                                      	if (abs(b) <= 2.95e+147)
                                      		tmp = Float64(Float64(pi * Float64(pi * Float64(Float64(Float64(t_0 * -3.08641975308642e-5) - Float64(Float64(a * a) * -3.08641975308642e-5)) * Float64(angle * angle)))) + t_0);
                                      	else
                                      		tmp = Float64(Float64(Float64(Float64(0.5 - 0.5) * a) * a) + Float64(Float64(Float64(0.5 + 0.5) * abs(b)) * abs(b)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(a, b, angle)
                                      	t_0 = abs(b) * abs(b);
                                      	tmp = 0.0;
                                      	if (abs(b) <= 2.95e+147)
                                      		tmp = (pi * (pi * (((t_0 * -3.08641975308642e-5) - ((a * a) * -3.08641975308642e-5)) * (angle * angle)))) + t_0;
                                      	else
                                      		tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * abs(b)) * abs(b));
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432], N[(N[(Pi * N[(Pi * N[(N[(N[(t$95$0 * -1/32400), $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * -1/32400), $MachinePrecision]), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(N[(1/2 - 1/2), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      t_0 := \left|b\right| \cdot \left|b\right|\\
                                      \mathbf{if}\;\left|b\right| \leq 2950000000000000059304930393302603223489185923540163102230528049495911188363352314194466435490646428401669785291287477296199626375736899804365586432:\\
                                      \;\;\;\;\pi \cdot \left(\pi \cdot \left(\left(t\_0 \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + t\_0\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot \left|b\right|\right) \cdot \left|b\right|\\
                                      
                                      
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if b < 2.9500000000000001e147

                                        1. Initial program 80.3%

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

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

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

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

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

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

                                              \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
                                            3. associate-*l*N/A

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

                                              \[\leadsto \left(\pi \cdot \pi\right) \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)\right) + b \cdot b \]
                                            5. associate-*l*N/A

                                              \[\leadsto \pi \cdot \left(\pi \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + \color{blue}{b} \cdot b \]
                                            6. lower-*.f64N/A

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

                                              \[\leadsto \pi \cdot \left(\pi \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + b \cdot b \]
                                            8. lower-*.f6440.8%

                                              \[\leadsto \pi \cdot \left(\pi \cdot \left(\left(\frac{-1}{32400} \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + b \cdot b \]
                                          3. Applied rewrites40.8%

                                            \[\leadsto \pi \cdot \left(\pi \cdot \left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} - \left(a \cdot a\right) \cdot \frac{-1}{32400}\right) \cdot \left(angle \cdot angle\right)\right)\right) + \color{blue}{b} \cdot b \]

                                          if 2.9500000000000001e147 < b

                                          1. Initial program 80.3%

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

                                            \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                                          3. Taylor expanded in angle around 0

                                            \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites57.6%

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

                                              \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites57.7%

                                                \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                            4. Recombined 2 regimes into one program.
                                            5. Add Preprocessing

                                            Alternative 13: 57.7% accurate, 14.9× speedup?

                                            \[\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b \]
                                            (FPCore (a b angle)
                                              :precision binary64
                                              (+ (* (* (- 1/2 1/2) a) a) (* (* (+ 1/2 1/2) b) b)))
                                            double code(double a, double b, double angle) {
                                            	return (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * b) * b);
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(a, b, angle)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: a
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: angle
                                                code = (((0.5d0 - 0.5d0) * a) * a) + (((0.5d0 + 0.5d0) * b) * b)
                                            end function
                                            
                                            public static double code(double a, double b, double angle) {
                                            	return (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * b) * b);
                                            }
                                            
                                            def code(a, b, angle):
                                            	return (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * b) * b)
                                            
                                            function code(a, b, angle)
                                            	return Float64(Float64(Float64(Float64(0.5 - 0.5) * a) * a) + Float64(Float64(Float64(0.5 + 0.5) * b) * b))
                                            end
                                            
                                            function tmp = code(a, b, angle)
                                            	tmp = (((0.5 - 0.5) * a) * a) + (((0.5 + 0.5) * b) * b);
                                            end
                                            
                                            code[a_, b_, angle_] := N[(N[(N[(N[(1/2 - 1/2), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(1/2 + 1/2), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
                                            
                                            \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2}\right) \cdot b\right) \cdot b
                                            
                                            Derivation
                                            1. Initial program 80.3%

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

                                              \[\leadsto \color{blue}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b} \]
                                            3. Taylor expanded in angle around 0

                                              \[\leadsto \left(\left(\frac{1}{2} - \color{blue}{\frac{1}{2}}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{90}\right)\right) \cdot b\right) \cdot b \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites57.6%

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

                                                \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites57.7%

                                                  \[\leadsto \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot a\right) \cdot a + \left(\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right) \cdot b\right) \cdot b \]
                                                2. Add Preprocessing

                                                Reproduce

                                                ?
                                                herbie shell --seed 2025285 -o generate:evaluate
                                                (FPCore (a b angle)
                                                  :name "ab-angle->ABCF A"
                                                  :precision binary64
                                                  (+ (pow (* a (sin (* (/ angle 180) PI))) 2) (pow (* b (cos (* (/ angle 180) PI))) 2)))