ab-angle->ABCF A

Percentage Accurate: 80.1% → 80.1%
Time: 16.6s
Alternatives: 2
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 2 alternatives:

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

Initial Program: 80.1% 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: 80.1% accurate, 1.0× speedup?

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

\\
{\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 83.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. unpow283.1%

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    3. associate-/l*83.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) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    4. unpow283.1%

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
  3. Simplified83.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 a around 0 74.0%

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

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

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

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

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

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

      \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} + {b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
    7. swap-sqr83.1%

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)\right)}^{2} \]
    2. metadata-eval83.1%

      \[\leadsto {\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \left(\left(\color{blue}{\frac{1}{180}} \cdot angle\right) \cdot \pi\right)\right)\right)}^{2} \]
    3. associate-/r/83.1%

      \[\leadsto {\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \left(\color{blue}{\frac{1}{\frac{180}{angle}}} \cdot \pi\right)\right)\right)}^{2} \]
    4. associate-*l/83.3%

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

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

    \[\leadsto {\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right)\right)}^{2} \]
  10. Add Preprocessing

Alternative 2: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 83.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. unpow283.1%

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \pi}{180}\right)}\right)}^{2} + \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    3. associate-/l*83.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) \cdot \left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right) \]
    4. unpow283.1%

      \[\leadsto {\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + \color{blue}{{\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}} \]
  3. Simplified83.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 a around 0 74.0%

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

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

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

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

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

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

      \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)} + {b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
    7. swap-sqr83.1%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}^{2}} \]
  8. Add Preprocessing

Reproduce

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