ab-angle->ABCF C

Percentage Accurate: 79.7% → 79.6%
Time: 28.1s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 79.7% accurate, 1.0× speedup?

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

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

Alternative 1: 79.6% accurate, 0.6× speedup?

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

\\
{\left(a \cdot \cos \left(\sqrt[3]{\pi} \cdot \left({\left(\sqrt[3]{\pi}\right)}^{2} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \left(\sqrt[3]{\pi} \cdot \left({\left(\sqrt[3]{\pi}\right)}^{2} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

Alternative 2: 79.6% accurate, 0.7× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)\right)}^{2} \]

Alternative 3: 79.6% accurate, 1.0× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.7% accurate, 1.0× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

Alternative 5: 79.7% accurate, 1.0× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

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

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

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

Alternative 6: 79.8% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

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

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

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

Alternative 7: 79.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(b \cdot \sin t_0\right)}^{2} + {\left(a \cdot \cos t_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 83.1%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Final simplification83.1%

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

Alternative 8: 79.7% accurate, 1.0× speedup?

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

\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

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

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

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

Alternative 9: 79.6% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.9 \cdot 10^{-114}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot 0\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.90000000000000002e-114

    1. Initial program 81.0%

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot 3}\right)}\right)}^{2} \]
      4. div-inv39.3%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right) \cdot 3}\right)\right)}^{2} \]
    4. Applied egg-rr39.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot 3}\right)}\right)}^{2} \]
    5. Taylor expanded in angle around 0 61.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{0}\right)}^{2} \]

    if 3.90000000000000002e-114 < b

    1. Initial program 87.3%

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(\left(angle \cdot \left(\pi \cdot b\right)\right) \cdot 0.005555555555555556\right)}}^{2} \]
      2. unpow-prod-down85.2%

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

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

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

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

Alternative 11: 67.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.4 \cdot 10^{-114}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot 0\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.39999999999999981e-114

    1. Initial program 81.0%

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot 3}\right)}\right)}^{2} \]
      4. div-inv39.3%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right) \cdot 3}\right)\right)}^{2} \]
    4. Applied egg-rr39.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot 3}\right)}\right)}^{2} \]
    5. Taylor expanded in angle around 0 61.7%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{0}\right)}^{2} \]

    if 3.39999999999999981e-114 < b

    1. Initial program 87.3%

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

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

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

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

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(\left(angle \cdot \left(\pi \cdot b\right)\right) \cdot 0.005555555555555556\right)}}^{2} \]
      2. unpow-prod-down85.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.4 \cdot 10^{-114}:\\ \;\;\;\;{a}^{2} + {\left(b \cdot 0\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]

Alternative 12: 57.0% accurate, 3.0× speedup?

\[\begin{array}{l} \\ {a}^{2} + {\left(b \cdot 0\right)}^{2} \end{array} \]
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b 0.0) 2.0)))
double code(double a, double b, double angle) {
	return pow(a, 2.0) + pow((b * 0.0), 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 = (a ** 2.0d0) + ((b * 0.0d0) ** 2.0d0)
end function
public static double code(double a, double b, double angle) {
	return Math.pow(a, 2.0) + Math.pow((b * 0.0), 2.0);
}
def code(a, b, angle):
	return math.pow(a, 2.0) + math.pow((b * 0.0), 2.0)
function code(a, b, angle)
	return Float64((a ^ 2.0) + (Float64(b * 0.0) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = (a ^ 2.0) + ((b * 0.0) ^ 2.0);
end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * 0.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{a}^{2} + {\left(b \cdot 0\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.1%

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

    \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  3. Step-by-step derivation
    1. add-cube-cbrt82.9%

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

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot 3}\right)}\right)}^{2} \]
    4. div-inv38.6%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right) \cdot 3}\right)\right)}^{2} \]
  4. Applied egg-rr38.6%

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot 3}\right)}\right)}^{2} \]
  5. Taylor expanded in angle around 0 60.8%

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{0}\right)}^{2} \]
  6. Final simplification60.8%

    \[\leadsto {a}^{2} + {\left(b \cdot 0\right)}^{2} \]

Reproduce

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