ab-angle->ABCF A

Percentage Accurate: 79.6% → 79.5%
Time: 25.6s
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: 79.6% 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.5% accurate, 1.5× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{\pi \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2} + {b}^{2}
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutative79.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  6. Step-by-step derivation
    1. associate-*r/79.8%

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\sqrt[3]{\left(\left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(\frac{angle}{180} \cdot \pi\right)}\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    4. pow1/336.6%

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

      \[\leadsto {\left(a \cdot \sin \left({\color{blue}{\left({\left(\frac{angle}{180} \cdot \pi\right)}^{3}\right)}}^{0.3333333333333333}\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    6. associate-*l/36.6%

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left({\left({\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
  8. Step-by-step derivation
    1. unpow1/350.9%

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\sqrt[3]{{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{3}}\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    2. rem-cbrt-cube79.8%

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    9. div-inv79.8%

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

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

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

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

Alternative 2: 79.5% accurate, 1.5× speedup?

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

\\
{b}^{2} + {\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutative79.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 1.5× speedup?

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

\\
{b}^{2} + {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutative79.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.5% accurate, 1.5× speedup?

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

\\
{b}^{2} + {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutative79.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  6. Step-by-step derivation
    1. associate-*r/79.8%

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    4. clear-num79.8%

      \[\leadsto {\left(a \cdot \sin \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    5. un-div-inv79.8%

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

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

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

Alternative 5: 67.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.2 \cdot 10^{-75}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{b}^{2} + \left(0.005555555555555556 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(a \cdot \pi\right)\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 1.2e-75)
   (pow b 2.0)
   (+
    (pow b 2.0)
    (*
     (* 0.005555555555555556 (* angle (* 0.005555555555555556 (* a PI))))
     (* angle (* a PI))))))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 1.2e-75) {
		tmp = pow(b, 2.0);
	} else {
		tmp = pow(b, 2.0) + ((0.005555555555555556 * (angle * (0.005555555555555556 * (a * ((double) M_PI))))) * (angle * (a * ((double) M_PI))));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 1.2e-75) {
		tmp = Math.pow(b, 2.0);
	} else {
		tmp = Math.pow(b, 2.0) + ((0.005555555555555556 * (angle * (0.005555555555555556 * (a * Math.PI)))) * (angle * (a * Math.PI)));
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if a <= 1.2e-75:
		tmp = math.pow(b, 2.0)
	else:
		tmp = math.pow(b, 2.0) + ((0.005555555555555556 * (angle * (0.005555555555555556 * (a * math.pi)))) * (angle * (a * math.pi)))
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (a <= 1.2e-75)
		tmp = b ^ 2.0;
	else
		tmp = Float64((b ^ 2.0) + Float64(Float64(0.005555555555555556 * Float64(angle * Float64(0.005555555555555556 * Float64(a * pi)))) * Float64(angle * Float64(a * pi))));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 1.2e-75)
		tmp = b ^ 2.0;
	else
		tmp = (b ^ 2.0) + ((0.005555555555555556 * (angle * (0.005555555555555556 * (a * pi)))) * (angle * (a * pi)));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[a, 1.2e-75], N[Power[b, 2.0], $MachinePrecision], N[(N[Power[b, 2.0], $MachinePrecision] + N[(N[(0.005555555555555556 * N[(angle * N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.2 \cdot 10^{-75}:\\
\;\;\;\;{b}^{2}\\

\mathbf{else}:\\
\;\;\;\;{b}^{2} + \left(0.005555555555555556 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(a \cdot \pi\right)\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.2000000000000001e-75

    1. Initial program 81.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. Step-by-step derivation
      1. *-commutative81.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*77.9%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified77.9%

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*64.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr64.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow277.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified77.9%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Taylor expanded in angle around 0 60.0%

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 1.2000000000000001e-75 < a

    1. Initial program 75.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. *-commutative75.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*70.7%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified70.7%

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

        \[\leadsto \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*r*70.8%

        \[\leadsto \color{blue}{\left(\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right) \cdot 0.005555555555555556\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. *-commutative70.8%

        \[\leadsto \left(\color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot 0.005555555555555556\right)} \cdot 0.005555555555555556\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. associate-*l*70.8%

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot \left(\left(\pi \cdot a\right) \cdot 0.005555555555555556\right)\right) \cdot 0.005555555555555556\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.5%

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

Alternative 6: 67.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{-68}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{b}^{2} + {\left(\left(\pi \cdot angle\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 3.5e-68)
   (pow b 2.0)
   (+ (pow b 2.0) (pow (* (* PI angle) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 3.5e-68) {
		tmp = pow(b, 2.0);
	} else {
		tmp = pow(b, 2.0) + pow(((((double) M_PI) * angle) * (a * 0.005555555555555556)), 2.0);
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 3.5e-68) {
		tmp = Math.pow(b, 2.0);
	} else {
		tmp = Math.pow(b, 2.0) + Math.pow(((Math.PI * angle) * (a * 0.005555555555555556)), 2.0);
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if a <= 3.5e-68:
		tmp = math.pow(b, 2.0)
	else:
		tmp = math.pow(b, 2.0) + math.pow(((math.pi * angle) * (a * 0.005555555555555556)), 2.0)
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (a <= 3.5e-68)
		tmp = b ^ 2.0;
	else
		tmp = Float64((b ^ 2.0) + (Float64(Float64(pi * angle) * Float64(a * 0.005555555555555556)) ^ 2.0));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 3.5e-68)
		tmp = b ^ 2.0;
	else
		tmp = (b ^ 2.0) + (((pi * angle) * (a * 0.005555555555555556)) ^ 2.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[a, 3.5e-68], N[Power[b, 2.0], $MachinePrecision], N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(N[(Pi * angle), $MachinePrecision] * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.5 \cdot 10^{-68}:\\
\;\;\;\;{b}^{2}\\

\mathbf{else}:\\
\;\;\;\;{b}^{2} + {\left(\left(\pi \cdot angle\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 3.50000000000000013e-68

    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. Step-by-step derivation
      1. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative77.6%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*77.6%

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow277.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified77.6%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Taylor expanded in angle around 0 59.7%

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 3.50000000000000013e-68 < a

    1. Initial program 76.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. Step-by-step derivation
      1. *-commutative76.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. associate-*r*71.3%

        \[\leadsto {\color{blue}{\left(\left(0.005555555555555556 \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified71.3%

      \[\leadsto {\color{blue}{\left(\left(0.005555555555555556 \cdot a\right) \cdot \left(angle \cdot \pi\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.5%

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

Alternative 7: 67.0% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{-75}:\\
\;\;\;\;{b}^{2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, {\left(a \cdot \left(\pi \cdot angle\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.9000000000000002e-75

    1. Initial program 81.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. Step-by-step derivation
      1. *-commutative81.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative78.0%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*77.9%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified77.9%

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*64.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow264.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr64.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow277.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*77.9%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified77.9%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Taylor expanded in angle around 0 60.0%

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 2.9000000000000002e-75 < a

    1. Initial program 75.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Step-by-step derivation
      1. *-commutative75.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*70.7%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified70.7%

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*56.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow256.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow256.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow256.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr56.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr70.7%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow270.7%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*70.8%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative70.8%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*70.8%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified70.8%

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

        \[\leadsto \color{blue}{{\left(b \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} \]
      2. *-rgt-identity70.8%

        \[\leadsto {\color{blue}{b}}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} \]
      3. pow270.8%

        \[\leadsto \color{blue}{b \cdot b} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} \]
      4. fma-def70.8%

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

        \[\leadsto \mathsf{fma}\left(b, b, \color{blue}{{\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}}\right) \]
      6. associate-*r*70.8%

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

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

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

Alternative 8: 67.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 6.5 \cdot 10^{-69}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 6.5e-69)
   (pow b 2.0)
   (pow (hypot b (* 0.005555555555555556 (* PI (* a angle)))) 2.0)))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 6.5e-69) {
		tmp = pow(b, 2.0);
	} else {
		tmp = pow(hypot(b, (0.005555555555555556 * (((double) M_PI) * (a * angle)))), 2.0);
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 6.5e-69) {
		tmp = Math.pow(b, 2.0);
	} else {
		tmp = Math.pow(Math.hypot(b, (0.005555555555555556 * (Math.PI * (a * angle)))), 2.0);
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if a <= 6.5e-69:
		tmp = math.pow(b, 2.0)
	else:
		tmp = math.pow(math.hypot(b, (0.005555555555555556 * (math.pi * (a * angle)))), 2.0)
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (a <= 6.5e-69)
		tmp = b ^ 2.0;
	else
		tmp = hypot(b, Float64(0.005555555555555556 * Float64(pi * Float64(a * angle)))) ^ 2.0;
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 6.5e-69)
		tmp = b ^ 2.0;
	else
		tmp = hypot(b, (0.005555555555555556 * (pi * (a * angle)))) ^ 2.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[a, 6.5e-69], N[Power[b, 2.0], $MachinePrecision], N[Power[N[Sqrt[b ^ 2 + N[(0.005555555555555556 * N[(Pi * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.5 \cdot 10^{-69}:\\
\;\;\;\;{b}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.49999999999999951e-69

    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. Step-by-step derivation
      1. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative77.6%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*77.6%

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow277.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified77.6%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Taylor expanded in angle around 0 59.7%

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 6.49999999999999951e-69 < a

    1. Initial program 76.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. Step-by-step derivation
      1. *-commutative76.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative71.4%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*71.4%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified71.4%

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*57.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr57.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr71.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow271.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*71.5%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative71.5%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*71.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified71.4%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Step-by-step derivation
      1. expm1-log1p-u70.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}\right)\right)} \]
      2. expm1-udef57.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}\right)} - 1} \]
    13. Applied egg-rr57.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\left(\pi \cdot angle\right) \cdot a\right)\right)\right)}^{2}\right)} - 1} \]
    14. Step-by-step derivation
      1. expm1-def70.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\left(\pi \cdot angle\right) \cdot a\right)\right)\right)}^{2}\right)\right)} \]
      2. expm1-log1p71.4%

        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\left(\pi \cdot angle\right) \cdot a\right)\right)\right)}^{2}} \]
      3. associate-*l*71.4%

        \[\leadsto {\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}\right)\right)}^{2} \]
    15. Simplified71.4%

      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot a\right)\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 6.5 \cdot 10^{-69}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 67.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4.4 \cdot 10^{-66}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 4.4e-66)
   (pow b 2.0)
   (pow (hypot b (* 0.005555555555555556 (* a (* PI angle)))) 2.0)))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 4.4e-66) {
		tmp = pow(b, 2.0);
	} else {
		tmp = pow(hypot(b, (0.005555555555555556 * (a * (((double) M_PI) * angle)))), 2.0);
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 4.4e-66) {
		tmp = Math.pow(b, 2.0);
	} else {
		tmp = Math.pow(Math.hypot(b, (0.005555555555555556 * (a * (Math.PI * angle)))), 2.0);
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if a <= 4.4e-66:
		tmp = math.pow(b, 2.0)
	else:
		tmp = math.pow(math.hypot(b, (0.005555555555555556 * (a * (math.pi * angle)))), 2.0)
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (a <= 4.4e-66)
		tmp = b ^ 2.0;
	else
		tmp = hypot(b, Float64(0.005555555555555556 * Float64(a * Float64(pi * angle)))) ^ 2.0;
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 4.4e-66)
		tmp = b ^ 2.0;
	else
		tmp = hypot(b, (0.005555555555555556 * (a * (pi * angle)))) ^ 2.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[a, 4.4e-66], N[Power[b, 2.0], $MachinePrecision], N[Power[N[Sqrt[b ^ 2 + N[(0.005555555555555556 * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.4 \cdot 10^{-66}:\\
\;\;\;\;{b}^{2}\\

\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.4000000000000002e-66

    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. Step-by-step derivation
      1. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative77.6%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*77.6%

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

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow264.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr64.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow277.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*77.6%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified77.6%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Taylor expanded in angle around 0 59.7%

      \[\leadsto \color{blue}{{b}^{2}} \]

    if 4.4000000000000002e-66 < a

    1. Initial program 76.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. Step-by-step derivation
      1. *-commutative76.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    7. Step-by-step derivation
      1. *-commutative71.4%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*71.4%

        \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    8. Simplified71.4%

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

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

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
      2. associate-*l*57.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      3. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      5. unpow257.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      6. swap-sqr57.1%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
      7. swap-sqr71.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
      8. unpow271.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
      9. associate-*r*71.5%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
      10. *-commutative71.5%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
      11. associate-*l*71.4%

        \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. Simplified71.4%

      \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt71.4%

        \[\leadsto \color{blue}{\sqrt{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}} \cdot \sqrt{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}}} \]
      2. pow271.4%

        \[\leadsto \color{blue}{{\left(\sqrt{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}}\right)}^{2}} \]
    13. Applied egg-rr71.4%

      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(\left(\pi \cdot angle\right) \cdot a\right)\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.4 \cdot 10^{-66}:\\ \;\;\;\;{b}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(b, 0.005555555555555556 \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 56.5% accurate, 6.0× speedup?

\[\begin{array}{l} \\ {b}^{2} \end{array} \]
(FPCore (a b angle) :precision binary64 (pow b 2.0))
double code(double a, double b, double angle) {
	return pow(b, 2.0);
}
real(8) function code(a, b, angle)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = b ** 2.0d0
end function
public static double code(double a, double b, double angle) {
	return Math.pow(b, 2.0);
}
def code(a, b, angle):
	return math.pow(b, 2.0)
function code(a, b, angle)
	return b ^ 2.0
end
function tmp = code(a, b, angle)
	tmp = b ^ 2.0;
end
code[a_, b_, angle_] := N[Power[b, 2.0], $MachinePrecision]
\begin{array}{l}

\\
{b}^{2}
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutative79.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\color{blue}{\left(0.005555555555555556 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
  7. Step-by-step derivation
    1. *-commutative75.6%

      \[\leadsto {\left(0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    2. associate-*l*75.6%

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

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

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

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left({angle}^{2} \cdot {\pi}^{2}\right) \cdot {a}^{2}\right)} + {\left(b \cdot 1\right)}^{2} \]
    2. associate-*l*62.2%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({angle}^{2} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
    3. unpow262.2%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({\pi}^{2} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
    4. unpow262.2%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {a}^{2}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
    5. unpow262.2%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) + {\left(b \cdot 1\right)}^{2} \]
    6. swap-sqr62.2%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(\pi \cdot a\right)\right)}\right) + {\left(b \cdot 1\right)}^{2} \]
    7. swap-sqr75.6%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot a\right)\right)\right)} + {\left(b \cdot 1\right)}^{2} \]
    8. unpow275.6%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(angle \cdot \left(\pi \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
    9. associate-*r*75.6%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\left(angle \cdot \pi\right) \cdot a\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
    10. *-commutative75.6%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot a\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
    11. associate-*l*75.6%

      \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot {\color{blue}{\left(\pi \cdot \left(angle \cdot a\right)\right)}}^{2} + {\left(b \cdot 1\right)}^{2} \]
  11. Simplified75.6%

    \[\leadsto \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot a\right)\right)}^{2}} + {\left(b \cdot 1\right)}^{2} \]
  12. Taylor expanded in angle around 0 52.9%

    \[\leadsto \color{blue}{{b}^{2}} \]
  13. Final simplification52.9%

    \[\leadsto {b}^{2} \]
  14. Add Preprocessing

Reproduce

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