ab-angle->ABCF A

Percentage Accurate: 80.0% → 79.7%
Time: 17.0s
Alternatives: 10
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 80.0% accurate, 1.0× speedup?

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

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

Alternative 1: 79.7% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(\left(\left(\frac{1}{180} \cdot \left(angle \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  6. Step-by-step derivation
    1. Applied rewrites77.6%

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

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

    Alternative 2: 79.8% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(\frac{1}{180} \cdot \left(angle \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
    6. Step-by-step derivation
      1. Applied rewrites77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 67.8% accurate, 3.1× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), -0.5, 0.5\right), a, b \cdot \left(1 \cdot \left(b \cdot 1\right)\right)\right) \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (fma
        (* a (fma (cos (* angle (* PI 0.011111111111111112))) -0.5 0.5))
        a
        (* b (* 1.0 (* b 1.0)))))
      double code(double a, double b, double angle) {
      	return fma((a * fma(cos((angle * (((double) M_PI) * 0.011111111111111112))), -0.5, 0.5)), a, (b * (1.0 * (b * 1.0))));
      }
      
      function code(a, b, angle)
      	return fma(Float64(a * fma(cos(Float64(angle * Float64(pi * 0.011111111111111112))), -0.5, 0.5)), a, Float64(b * Float64(1.0 * Float64(b * 1.0))))
      end
      
      code[a_, b_, angle_] := N[(N[(a * N[(N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision] * a + N[(b * N[(1.0 * N[(b * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), -0.5, 0.5\right), a, b \cdot \left(1 \cdot \left(b \cdot 1\right)\right)\right)
      \end{array}
      
      Derivation
      1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \sin \left(\left(\left(\frac{1}{180} \cdot \left(angle \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{6}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
      6. Step-by-step derivation
        1. Applied rewrites77.6%

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), -0.5, 0.5\right), a, b \cdot \left(1 \cdot \left(b \cdot 1\right)\right)\right)} \]
        3. Add Preprocessing

        Alternative 4: 57.9% accurate, 4.9× speedup?

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

          1. Initial program 77.0%

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), b \cdot b\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites44.9%

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

            if 7.2000000000000001e-109 < b < 6.5e131

            1. Initial program 64.3%

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

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

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

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

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

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

              if 6.5e131 < b

              1. Initial program 95.4%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6495.6

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Applied rewrites95.6%

                \[\leadsto \color{blue}{b \cdot b} \]
            8. Recombined 3 regimes into one program.
            9. Final simplification54.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.2 \cdot 10^{-109}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle, b \cdot b\right)\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{+131}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(angle, angle \cdot \left(-3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right), \mathsf{fma}\left(a \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot \left(angle \cdot angle\right)\right)\right)\right), \frac{3.08641975308642 \cdot 10^{-5}}{b \cdot b}, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot b\\ \end{array} \]
            10. Add Preprocessing

            Alternative 5: 63.3% accurate, 6.3× speedup?

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

              1. Initial program 81.1%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6457.9

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Applied rewrites57.9%

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

              if 4.99999999999999992e-171 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000012e143

              1. Initial program 79.8%

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

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

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

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

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

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

                if 5.00000000000000012e143 < (/.f64 angle #s(literal 180 binary64))

                1. Initial program 59.4%

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

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

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

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

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

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

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

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

                  Alternative 6: 63.1% accurate, 6.3× speedup?

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

                    1. Initial program 81.1%

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

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

                        \[\leadsto \color{blue}{b \cdot b} \]
                      2. lower-*.f6457.9

                        \[\leadsto \color{blue}{b \cdot b} \]
                    5. Applied rewrites57.9%

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

                    if 4.99999999999999992e-171 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000001e132

                    1. Initial program 79.4%

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

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

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

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

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

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

                      if 5.0000000000000001e132 < (/.f64 angle #s(literal 180 binary64))

                      1. Initial program 60.4%

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

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

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

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

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

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

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

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

                        Alternative 7: 56.7% accurate, 8.3× speedup?

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

                          1. Initial program 73.9%

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

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), b \cdot b\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites45.3%

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

                            if 1.0500000000000001e117 < b

                            1. Initial program 96.0%

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

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

                                \[\leadsto \color{blue}{b \cdot b} \]
                              2. lower-*.f6491.8

                                \[\leadsto \color{blue}{b \cdot b} \]
                            5. Applied rewrites91.8%

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

                          Alternative 8: 61.1% accurate, 12.1× speedup?

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

                            1. Initial program 74.9%

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

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

                                \[\leadsto \color{blue}{b \cdot b} \]
                              2. lower-*.f6458.5

                                \[\leadsto \color{blue}{b \cdot b} \]
                            5. Applied rewrites58.5%

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

                            if 3.90000000000000011e152 < a

                            1. Initial program 96.5%

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

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

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

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

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

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

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

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

                              Alternative 9: 60.3% accurate, 12.1× speedup?

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

                                1. Initial program 74.9%

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

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

                                    \[\leadsto \color{blue}{b \cdot b} \]
                                  2. lower-*.f6458.5

                                    \[\leadsto \color{blue}{b \cdot b} \]
                                5. Applied rewrites58.5%

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

                                if 3.90000000000000011e152 < a

                                1. Initial program 96.5%

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

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

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

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

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

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

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

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

                                  Alternative 10: 56.9% accurate, 74.7× speedup?

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

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

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

                                      \[\leadsto \color{blue}{b \cdot b} \]
                                    2. lower-*.f6455.2

                                      \[\leadsto \color{blue}{b \cdot b} \]
                                  5. Applied rewrites55.2%

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

                                  Reproduce

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