ab-angle->ABCF C

Percentage Accurate: 79.5% → 79.4%
Time: 5.6s
Alternatives: 12
Speedup: N/A×

Specification

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

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 12 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

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

Alternative 1: 79.4% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\pi \cdot \mathsf{fma}\left(\color{blue}{\frac{1}{180}}, angle, \frac{1}{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    14. metadata-eval79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {a}^{2} \cdot {\sin \left(\pi \cdot \left(\frac{1}{2} - \frac{-1}{180} \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right)}^{2} \]
    8. lower-*.f6479.4%

      \[\leadsto {a}^{2} \cdot {\sin \left(\pi \cdot \left(0.5 - -0.005555555555555556 \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2} \]
  8. Applied rewrites79.4%

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

Alternative 2: 79.3% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{{\left(\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{1}}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{-1}} \]
    17. lower-unsound-pow.f6478.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{1}{{\left(\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)} \cdot b\right)}^{\left(\mathsf{neg}\left(2\right)\right)}} \]
    17. metadata-eval79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 78.9% accurate, 1.7× speedup?

    \[\begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 9.5 \cdot 10^{-11}:\\ \;\;\;\;{\left(a \cdot 1\right)}^{2} + \frac{1}{{\left(0.005555555555555556 \cdot \left(\left|angle\right| \cdot \left(b \cdot \pi\right)\right)\right)}^{-2}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right)\right)\right) \cdot b, b, \left(\left(1 \cdot a\right) \cdot a\right) \cdot 1\right)\\ \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (if (<= (fabs angle) 9.5e-11)
       (+
        (pow (* a 1.0) 2.0)
        (/ 1.0 (pow (* 0.005555555555555556 (* (fabs angle) (* b PI))) -2.0)))
       (fma
        (*
         (- 0.5 (* 0.5 (cos (* 2.0 (* (* 0.005555555555555556 (fabs angle)) PI)))))
         b)
        b
        (* (* (* 1.0 a) a) 1.0))))
    double code(double a, double b, double angle) {
    	double tmp;
    	if (fabs(angle) <= 9.5e-11) {
    		tmp = pow((a * 1.0), 2.0) + (1.0 / pow((0.005555555555555556 * (fabs(angle) * (b * ((double) M_PI)))), -2.0));
    	} else {
    		tmp = fma(((0.5 - (0.5 * cos((2.0 * ((0.005555555555555556 * fabs(angle)) * ((double) M_PI)))))) * b), b, (((1.0 * a) * a) * 1.0));
    	}
    	return tmp;
    }
    
    function code(a, b, angle)
    	tmp = 0.0
    	if (abs(angle) <= 9.5e-11)
    		tmp = Float64((Float64(a * 1.0) ^ 2.0) + Float64(1.0 / (Float64(0.005555555555555556 * Float64(abs(angle) * Float64(b * pi))) ^ -2.0)));
    	else
    		tmp = fma(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(0.005555555555555556 * abs(angle)) * pi))))) * b), b, Float64(Float64(Float64(1.0 * a) * a) * 1.0));
    	end
    	return tmp
    end
    
    code[a_, b_, angle_] := If[LessEqual[N[Abs[angle], $MachinePrecision], 9.5e-11], N[(N[Power[N[(a * 1.0), $MachinePrecision], 2.0], $MachinePrecision] + N[(1.0 / N[Power[N[(0.005555555555555556 * N[(N[Abs[angle], $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * b + N[(N[(N[(1.0 * a), $MachinePrecision] * a), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;\left|angle\right| \leq 9.5 \cdot 10^{-11}:\\
    \;\;\;\;{\left(a \cdot 1\right)}^{2} + \frac{1}{{\left(0.005555555555555556 \cdot \left(\left|angle\right| \cdot \left(b \cdot \pi\right)\right)\right)}^{-2}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right)\right)\right) \cdot b, b, \left(\left(1 \cdot a\right) \cdot a\right) \cdot 1\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if angle < 9.4999999999999995e-11

      1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{{\left(\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{1}}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{-1}} \]
        17. lower-unsound-pow.f6478.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{1}{{\left(\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)} \cdot b\right)}^{\left(\mathsf{neg}\left(2\right)\right)}} \]
        17. metadata-eval79.4%

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

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

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

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

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

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

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

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

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

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

        if 9.4999999999999995e-11 < angle

        1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{{\left(\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{1}}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{-1}} \]
          17. lower-unsound-pow.f6478.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{1}{{\left(\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)} \cdot b\right)}^{\left(\mathsf{neg}\left(2\right)\right)}} \]
          17. metadata-eval79.4%

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

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

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

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

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

        Alternative 4: 74.4% accurate, 2.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{{\left(\sin \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right) \cdot b\right)}^{1}}{{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{-1}} \]
          17. lower-unsound-pow.f6478.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \frac{1}{{\left(\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)} \cdot b\right)}^{\left(\mathsf{neg}\left(2\right)\right)}} \]
          17. metadata-eval79.4%

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 66.8% accurate, 2.5× speedup?

          \[\begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 2.7 \cdot 10^{-158}:\\ \;\;\;\;{a}^{2} \cdot \left(1 + -0.00030461741978670857 \cdot {\left(\left|angle\right|\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(\left|angle\right| \cdot \left|angle\right|\right)\right)\\ \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (if (<= (fabs angle) 2.7e-158)
             (* (pow a 2.0) (+ 1.0 (* -0.00030461741978670857 (pow (fabs angle) 2.0))))
             (fma
              a
              a
              (*
               (* (* PI PI) (* 3.08641975308642e-5 (pow b 2.0)))
               (* (fabs angle) (fabs angle))))))
          double code(double a, double b, double angle) {
          	double tmp;
          	if (fabs(angle) <= 2.7e-158) {
          		tmp = pow(a, 2.0) * (1.0 + (-0.00030461741978670857 * pow(fabs(angle), 2.0)));
          	} else {
          		tmp = fma(a, a, (((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * pow(b, 2.0))) * (fabs(angle) * fabs(angle))));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	tmp = 0.0
          	if (abs(angle) <= 2.7e-158)
          		tmp = Float64((a ^ 2.0) * Float64(1.0 + Float64(-0.00030461741978670857 * (abs(angle) ^ 2.0))));
          	else
          		tmp = fma(a, a, Float64(Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * (b ^ 2.0))) * Float64(abs(angle) * abs(angle))));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := If[LessEqual[N[Abs[angle], $MachinePrecision], 2.7e-158], N[(N[Power[a, 2.0], $MachinePrecision] * N[(1.0 + N[(-0.00030461741978670857 * N[Power[N[Abs[angle], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[angle], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          \mathbf{if}\;\left|angle\right| \leq 2.7 \cdot 10^{-158}:\\
          \;\;\;\;{a}^{2} \cdot \left(1 + -0.00030461741978670857 \cdot {\left(\left|angle\right|\right)}^{2}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(\left|angle\right| \cdot \left|angle\right|\right)\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if angle < 2.6999999999999998e-158

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

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

                \[\leadsto {a}^{2} \cdot \left(1 + \color{blue}{\frac{-555609333788003}{1823957849085050880} \cdot {angle}^{2}}\right) \]
              2. lower-pow.f64N/A

                \[\leadsto {a}^{2} \cdot \left(1 + \color{blue}{\frac{-555609333788003}{1823957849085050880}} \cdot {angle}^{2}\right) \]
              3. lower-+.f64N/A

                \[\leadsto {a}^{2} \cdot \left(1 + \frac{-555609333788003}{1823957849085050880} \cdot \color{blue}{{angle}^{2}}\right) \]
              4. lower-*.f64N/A

                \[\leadsto {a}^{2} \cdot \left(1 + \frac{-555609333788003}{1823957849085050880} \cdot {angle}^{\color{blue}{2}}\right) \]
              5. lower-pow.f6439.3%

                \[\leadsto {a}^{2} \cdot \left(1 + -0.00030461741978670857 \cdot {angle}^{2}\right) \]
            10. Applied rewrites39.3%

              \[\leadsto {a}^{2} \cdot \color{blue}{\left(1 + -0.00030461741978670857 \cdot {angle}^{2}\right)} \]

            if 2.6999999999999998e-158 < angle

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{1}{32400} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              2. lower-pow.f6463.8%

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Applied rewrites63.8%

              \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 6: 65.5% accurate, 0.8× speedup?

          \[\begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(-angle\right), -angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right)\\ \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* PI (/ angle 180.0))))
             (if (<= (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)) 4e+149)
               (fma
                (* (* (* -3.08641975308642e-5 (- (* a a) (* b b))) (* PI PI)) (- angle))
                (- angle)
                (* a a))
               (fma
                a
                a
                (* (* (* PI PI) (* 3.08641975308642e-5 (pow b 2.0))) (* angle angle))))))
          double code(double a, double b, double angle) {
          	double t_0 = ((double) M_PI) * (angle / 180.0);
          	double tmp;
          	if ((pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0)) <= 4e+149) {
          		tmp = fma((((-3.08641975308642e-5 * ((a * a) - (b * b))) * (((double) M_PI) * ((double) M_PI))) * -angle), -angle, (a * a));
          	} else {
          		tmp = fma(a, a, (((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * pow(b, 2.0))) * (angle * angle)));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(pi * Float64(angle / 180.0))
          	tmp = 0.0
          	if (Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) <= 4e+149)
          		tmp = fma(Float64(Float64(Float64(-3.08641975308642e-5 * Float64(Float64(a * a) - Float64(b * b))) * Float64(pi * pi)) * Float64(-angle)), Float64(-angle), Float64(a * a));
          	else
          		tmp = fma(a, a, Float64(Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * (b ^ 2.0))) * Float64(angle * angle)));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 4e+149], N[(N[(N[(N[(-3.08641975308642e-5 * N[(N[(a * a), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * (-angle)), $MachinePrecision] * (-angle) + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          t_0 := \pi \cdot \frac{angle}{180}\\
          \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+149}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(-angle\right), -angle, a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 4.0000000000000002e149

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

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

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

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

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

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

                \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right) + a \cdot a \]
              6. sqr-neg-revN/A

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

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

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

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

            if 4.0000000000000002e149 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(\frac{1}{32400} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              2. lower-pow.f6463.8%

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Applied rewrites63.8%

              \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {b}^{2}\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 7: 65.5% accurate, 0.8× speedup?

          \[\begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(-angle\right), -angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(0.00030461741978670857 \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right)\\ \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* PI (/ angle 180.0))))
             (if (<= (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)) 4e+149)
               (fma
                (* (* (* -3.08641975308642e-5 (- (* a a) (* b b))) (* PI PI)) (- angle))
                (- angle)
                (* a a))
               (fma a a (* (* 0.00030461741978670857 (pow b 2.0)) (* angle angle))))))
          double code(double a, double b, double angle) {
          	double t_0 = ((double) M_PI) * (angle / 180.0);
          	double tmp;
          	if ((pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0)) <= 4e+149) {
          		tmp = fma((((-3.08641975308642e-5 * ((a * a) - (b * b))) * (((double) M_PI) * ((double) M_PI))) * -angle), -angle, (a * a));
          	} else {
          		tmp = fma(a, a, ((0.00030461741978670857 * pow(b, 2.0)) * (angle * angle)));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(pi * Float64(angle / 180.0))
          	tmp = 0.0
          	if (Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) <= 4e+149)
          		tmp = fma(Float64(Float64(Float64(-3.08641975308642e-5 * Float64(Float64(a * a) - Float64(b * b))) * Float64(pi * pi)) * Float64(-angle)), Float64(-angle), Float64(a * a));
          	else
          		tmp = fma(a, a, Float64(Float64(0.00030461741978670857 * (b ^ 2.0)) * Float64(angle * angle)));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 4e+149], N[(N[(N[(N[(-3.08641975308642e-5 * N[(N[(a * a), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * (-angle)), $MachinePrecision] * (-angle) + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(0.00030461741978670857 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          t_0 := \pi \cdot \frac{angle}{180}\\
          \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+149}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(-angle\right), -angle, a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \left(0.00030461741978670857 \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 4.0000000000000002e149

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

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

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

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

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

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

                \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right) + a \cdot a \]
              6. sqr-neg-revN/A

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

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

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

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

            if 4.0000000000000002e149 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

              \[\leadsto \mathsf{fma}\left(a, a, \left(9.869604401089358 \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            8. Taylor expanded in a around 0

              \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{555609333788003}{1823957849085050880} \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{555609333788003}{1823957849085050880} \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
              2. lower-pow.f6463.8%

                \[\leadsto \mathsf{fma}\left(a, a, \left(0.00030461741978670857 \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
            10. Applied rewrites63.8%

              \[\leadsto \mathsf{fma}\left(a, a, \left(0.00030461741978670857 \cdot {b}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 8: 48.3% accurate, 3.2× speedup?

          \[\begin{array}{l} t_0 := \left|angle\right| \cdot \left|angle\right|\\ \mathbf{if}\;\left|angle\right| \leq 2.7 \cdot 10^{-158}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(-0.00030461741978670857 \cdot {a}^{2}\right) \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot t\_0\right)\\ \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* (fabs angle) (fabs angle))))
             (if (<= (fabs angle) 2.7e-158)
               (fma a a (* (* -0.00030461741978670857 (pow a 2.0)) t_0))
               (fma
                a
                a
                (*
                 (fma
                  (* 9.869604401089358 a)
                  (* -3.08641975308642e-5 a)
                  (* 0.00030461741978670857 (* b b)))
                 t_0)))))
          double code(double a, double b, double angle) {
          	double t_0 = fabs(angle) * fabs(angle);
          	double tmp;
          	if (fabs(angle) <= 2.7e-158) {
          		tmp = fma(a, a, ((-0.00030461741978670857 * pow(a, 2.0)) * t_0));
          	} else {
          		tmp = fma(a, a, (fma((9.869604401089358 * a), (-3.08641975308642e-5 * a), (0.00030461741978670857 * (b * b))) * t_0));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(abs(angle) * abs(angle))
          	tmp = 0.0
          	if (abs(angle) <= 2.7e-158)
          		tmp = fma(a, a, Float64(Float64(-0.00030461741978670857 * (a ^ 2.0)) * t_0));
          	else
          		tmp = fma(a, a, Float64(fma(Float64(9.869604401089358 * a), Float64(-3.08641975308642e-5 * a), Float64(0.00030461741978670857 * Float64(b * b))) * t_0));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[angle], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[angle], $MachinePrecision], 2.7e-158], N[(a * a + N[(N[(-0.00030461741978670857 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(N[(9.869604401089358 * a), $MachinePrecision] * N[(-3.08641975308642e-5 * a), $MachinePrecision] + N[(0.00030461741978670857 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          t_0 := \left|angle\right| \cdot \left|angle\right|\\
          \mathbf{if}\;\left|angle\right| \leq 2.7 \cdot 10^{-158}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \left(-0.00030461741978670857 \cdot {a}^{2}\right) \cdot t\_0\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot t\_0\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if angle < 2.6999999999999998e-158

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

              \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{-555609333788003}{1823957849085050880} \cdot {a}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{-555609333788003}{1823957849085050880} \cdot {a}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
              2. lower-pow.f6427.1%

                \[\leadsto \mathsf{fma}\left(a, a, \left(-0.00030461741978670857 \cdot {a}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]
            10. Applied rewrites27.1%

              \[\leadsto \mathsf{fma}\left(a, a, \left(-0.00030461741978670857 \cdot {a}^{2}\right) \cdot \left(angle \cdot angle\right)\right) \]

            if 2.6999999999999998e-158 < angle

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400} + \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              3. distribute-rgt-inN/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              5. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              6. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(a \cdot \left(a \cdot \frac{-1}{32400}\right)\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              7. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              9. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, a \cdot \frac{-1}{32400}, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              12. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              13. lift-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{2778046668940015}{281474976710656} \cdot \frac{1}{32400}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              15. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{555609333788003}{1823957849085050880} \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              16. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              17. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              18. metadata-eval45.8%

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Applied rewrites45.8%

              \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 9: 48.3% accurate, 3.1× speedup?

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

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

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

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

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

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

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

                \[\leadsto \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right) + a \cdot a \]
              6. sqr-neg-revN/A

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

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

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

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

            if 5e152 < a

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400} + \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              3. distribute-rgt-inN/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              5. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              6. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(a \cdot \left(a \cdot \frac{-1}{32400}\right)\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              7. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              9. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, a \cdot \frac{-1}{32400}, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              12. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              13. lift-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{2778046668940015}{281474976710656} \cdot \frac{1}{32400}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              15. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{555609333788003}{1823957849085050880} \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              16. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              17. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              18. metadata-eval45.8%

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Applied rewrites45.8%

              \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 10: 47.4% accurate, 0.8× speedup?

          \[\begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ t_1 := 0.00030461741978670857 \cdot \left(b \cdot b\right)\\ \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+305}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, t\_1\right) \cdot angle, angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, t\_1\right) \cdot \left(angle \cdot angle\right)\right)\\ \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* PI (/ angle 180.0))) (t_1 (* 0.00030461741978670857 (* b b))))
             (if (<= (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)) 4e+305)
               (fma (* (fma -0.00030461741978670857 (* a a) t_1) angle) angle (* a a))
               (fma
                a
                a
                (*
                 (fma (* 9.869604401089358 a) (* -3.08641975308642e-5 a) t_1)
                 (* angle angle))))))
          double code(double a, double b, double angle) {
          	double t_0 = ((double) M_PI) * (angle / 180.0);
          	double t_1 = 0.00030461741978670857 * (b * b);
          	double tmp;
          	if ((pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0)) <= 4e+305) {
          		tmp = fma((fma(-0.00030461741978670857, (a * a), t_1) * angle), angle, (a * a));
          	} else {
          		tmp = fma(a, a, (fma((9.869604401089358 * a), (-3.08641975308642e-5 * a), t_1) * (angle * angle)));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(pi * Float64(angle / 180.0))
          	t_1 = Float64(0.00030461741978670857 * Float64(b * b))
          	tmp = 0.0
          	if (Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) <= 4e+305)
          		tmp = fma(Float64(fma(-0.00030461741978670857, Float64(a * a), t_1) * angle), angle, Float64(a * a));
          	else
          		tmp = fma(a, a, Float64(fma(Float64(9.869604401089358 * a), Float64(-3.08641975308642e-5 * a), t_1) * Float64(angle * angle)));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.00030461741978670857 * N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 4e+305], N[(N[(N[(-0.00030461741978670857 * N[(a * a), $MachinePrecision] + t$95$1), $MachinePrecision] * angle), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(N[(9.869604401089358 * a), $MachinePrecision] * N[(-3.08641975308642e-5 * a), $MachinePrecision] + t$95$1), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          t_0 := \pi \cdot \frac{angle}{180}\\
          t_1 := 0.00030461741978670857 \cdot \left(b \cdot b\right)\\
          \mathbf{if}\;{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2} \leq 4 \cdot 10^{+305}:\\
          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, t\_1\right) \cdot angle, angle, a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, t\_1\right) \cdot \left(angle \cdot angle\right)\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 3.9999999999999998e305

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

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

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

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

                \[\leadsto \left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right) + \color{blue}{a} \cdot a \]
              5. lift-*.f64N/A

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot angle, \color{blue}{angle}, a \cdot a\right) \]
            9. Applied rewrites43.3%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle, \color{blue}{angle}, a \cdot a\right) \]

            if 3.9999999999999998e305 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
            6. Applied rewrites40.9%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            7. Evaluated real constant40.9%

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

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400} + \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              3. distribute-rgt-inN/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              5. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(\left(a \cdot a\right) \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              6. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \left(a \cdot \left(a \cdot \frac{-1}{32400}\right)\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              7. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right) \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(angle \cdot angle\right)\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot a\right) \cdot \left(a \cdot \frac{-1}{32400}\right) + \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              9. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, a \cdot \frac{-1}{32400}, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              12. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{2778046668940015}{281474976710656} \cdot \left(\frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              13. lift-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{2778046668940015}{281474976710656} \cdot \frac{1}{32400}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              15. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \frac{555609333788003}{1823957849085050880} \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              16. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              17. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(\frac{2778046668940015}{281474976710656} \cdot a, \frac{-1}{32400} \cdot a, \left(\frac{1}{32400} \cdot \frac{2778046668940015}{281474976710656}\right) \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
              18. metadata-eval45.8%

                \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            9. Applied rewrites45.8%

              \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(9.869604401089358 \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 11: 43.3% accurate, 4.8× speedup?

          \[\mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle, angle, a \cdot a\right) \]
          (FPCore (a b angle)
           :precision binary64
           (fma
            (*
             (fma -0.00030461741978670857 (* a a) (* 0.00030461741978670857 (* b b)))
             angle)
            angle
            (* a a)))
          double code(double a, double b, double angle) {
          	return fma((fma(-0.00030461741978670857, (a * a), (0.00030461741978670857 * (b * b))) * angle), angle, (a * a));
          }
          
          function code(a, b, angle)
          	return fma(Float64(fma(-0.00030461741978670857, Float64(a * a), Float64(0.00030461741978670857 * Float64(b * b))) * angle), angle, Float64(a * a))
          end
          
          code[a_, b_, angle_] := N[(N[(N[(-0.00030461741978670857 * N[(a * a), $MachinePrecision] + N[(0.00030461741978670857 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision]
          
          \mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle, angle, a \cdot a\right)
          
          Derivation
          1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
          6. Applied rewrites40.9%

            \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          7. Evaluated real constant40.9%

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

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

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

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

              \[\leadsto \left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right) + \color{blue}{a} \cdot a \]
            5. lift-*.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot angle, \color{blue}{angle}, a \cdot a\right) \]
          9. Applied rewrites43.3%

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle, \color{blue}{angle}, a \cdot a\right) \]
          10. Add Preprocessing

          Alternative 12: 43.3% accurate, 4.8× speedup?

          \[\mathsf{fma}\left(a, a, \left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot angle\right) \]
          (FPCore (a b angle)
           :precision binary64
           (fma
            a
            a
            (*
             (*
              (fma -0.00030461741978670857 (* a a) (* 0.00030461741978670857 (* b b)))
              angle)
             angle)))
          double code(double a, double b, double angle) {
          	return fma(a, a, ((fma(-0.00030461741978670857, (a * a), (0.00030461741978670857 * (b * b))) * angle) * angle));
          }
          
          function code(a, b, angle)
          	return fma(a, a, Float64(Float64(fma(-0.00030461741978670857, Float64(a * a), Float64(0.00030461741978670857 * Float64(b * b))) * angle) * angle))
          end
          
          code[a_, b_, angle_] := N[(a * a + N[(N[(N[(-0.00030461741978670857 * N[(a * a), $MachinePrecision] + N[(0.00030461741978670857 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]
          
          \mathsf{fma}\left(a, a, \left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot angle\right)
          
          Derivation
          1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(a, a, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, {a}^{2} \cdot {\pi}^{2}, 3.08641975308642 \cdot 10^{-5} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \cdot {angle}^{2}\right) \]
          6. Applied rewrites40.9%

            \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a \cdot a, -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
          7. Evaluated real constant40.9%

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

              \[\leadsto \mathsf{fma}\left(a, a, \left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot \left(angle \cdot angle\right)\right) \]
            2. lift-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot angle\right) \cdot angle\right) \]
            4. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a, a, \left(\left(\frac{2778046668940015}{281474976710656} \cdot \mathsf{fma}\left(a \cdot a, \frac{-1}{32400}, \frac{1}{32400} \cdot \left(b \cdot b\right)\right)\right) \cdot angle\right) \cdot angle\right) \]
          9. Applied rewrites43.3%

            \[\leadsto \mathsf{fma}\left(a, a, \left(\mathsf{fma}\left(-0.00030461741978670857, a \cdot a, 0.00030461741978670857 \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot angle\right) \]
          10. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025207 
          (FPCore (a b angle)
            :name "ab-angle->ABCF C"
            :precision binary64
            (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))