ab-angle->ABCF A

Percentage Accurate: 79.6% → 79.7%
Time: 5.2s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\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} \]
(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}
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}

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 14 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} 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} \]
(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}
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}

Alternative 1: 79.7% accurate, 0.7× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 0.8× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{\sin \color{blue}{\left(\mathsf{neg}\left(\frac{angle \cdot \pi}{180}\right)\right)} \cdot a}{\frac{1}{a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}}\right| + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    4. div-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{\sin \left(\mathsf{neg}\left(\color{blue}{1 \cdot \left(\frac{angle}{180} \cdot \pi\right)}\right)\right) \cdot a}{\frac{1}{a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}}\right| + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    19. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 0.9× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.6% accurate, 1.0× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.6% accurate, 1.0× speedup?

\[{\left(a \cdot \sin \left(\frac{\left|angle\right|}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \mathsf{fma}\left(0.005555555555555556, \left|angle\right|, 0.5\right)\right)\right)}^{2} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (pow (* a (sin (* (/ (fabs angle) 180.0) PI))) 2.0)
  (pow (* b (sin (* PI (fma 0.005555555555555556 (fabs angle) 0.5)))) 2.0)))
double code(double a, double b, double angle) {
	return pow((a * sin(((fabs(angle) / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin((((double) M_PI) * fma(0.005555555555555556, fabs(angle), 0.5)))), 2.0);
}
function code(a, b, angle)
	return Float64((Float64(a * sin(Float64(Float64(abs(angle) / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(pi * fma(0.005555555555555556, abs(angle), 0.5)))) ^ 2.0))
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(N[Abs[angle], $MachinePrecision] / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
{\left(a \cdot \sin \left(\frac{\left|angle\right|}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \mathsf{fma}\left(0.005555555555555556, \left|angle\right|, 0.5\right)\right)\right)}^{2}
Derivation
  1. Initial program 79.6%

    \[{\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. lift-cos.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.6% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \left(0.005555555555555556 \cdot \pi\right) \cdot angle\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (* 0.005555555555555556 PI) angle)))
   (+ (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 = (0.005555555555555556 * ((double) M_PI)) * angle;
	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 = (0.005555555555555556 * Math.PI) * angle;
	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 = (0.005555555555555556 * math.pi) * angle
	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(0.005555555555555556 * pi) * angle)
	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 = (0.005555555555555556 * pi) * angle;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0);
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * angle), $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}
t_0 := \left(0.005555555555555556 \cdot \pi\right) \cdot angle\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.6%

    \[{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.5% accurate, 1.4× speedup?

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

    \[{\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. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 9: 79.5% accurate, 1.5× speedup?

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

      \[{\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. Taylor expanded in angle around 0

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

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

      Alternative 10: 60.4% accurate, 1.7× speedup?

      \[\begin{array}{l} \mathbf{if}\;\left|b\right| \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;{a}^{2} \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|b\right| \cdot \left|b\right|\\ \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (if (<= (fabs b) 1.1e-158)
         (* (pow a 2.0) (- 0.5 (* 0.5 (cos (* 0.011111111111111112 (* angle PI))))))
         (* (fabs b) (fabs b))))
      double code(double a, double b, double angle) {
      	double tmp;
      	if (fabs(b) <= 1.1e-158) {
      		tmp = pow(a, 2.0) * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI))))));
      	} else {
      		tmp = fabs(b) * fabs(b);
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double angle) {
      	double tmp;
      	if (Math.abs(b) <= 1.1e-158) {
      		tmp = Math.pow(a, 2.0) * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI)))));
      	} else {
      		tmp = Math.abs(b) * Math.abs(b);
      	}
      	return tmp;
      }
      
      def code(a, b, angle):
      	tmp = 0
      	if math.fabs(b) <= 1.1e-158:
      		tmp = math.pow(a, 2.0) * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi)))))
      	else:
      		tmp = math.fabs(b) * math.fabs(b)
      	return tmp
      
      function code(a, b, angle)
      	tmp = 0.0
      	if (abs(b) <= 1.1e-158)
      		tmp = Float64((a ^ 2.0) * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi))))));
      	else
      		tmp = Float64(abs(b) * abs(b));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, angle)
      	tmp = 0.0;
      	if (abs(b) <= 1.1e-158)
      		tmp = (a ^ 2.0) * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi)))));
      	else
      		tmp = abs(b) * abs(b);
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, angle_] := If[LessEqual[N[Abs[b], $MachinePrecision], 1.1e-158], N[(N[Power[a, 2.0], $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      \mathbf{if}\;\left|b\right| \leq 1.1 \cdot 10^{-158}:\\
      \;\;\;\;{a}^{2} \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|b\right| \cdot \left|b\right|\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < 1.1000000000000001e-158

        1. Initial program 79.6%

          \[{\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. Applied rewrites62.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), a \cdot a, \left(\left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot b\right) \cdot b\right)} \]
        3. Taylor expanded in a around inf

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

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

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

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

            \[\leadsto {a}^{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
          5. lower-cos.f64N/A

            \[\leadsto {a}^{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
          6. lower-*.f64N/A

            \[\leadsto {a}^{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
          7. lower-*.f64N/A

            \[\leadsto {a}^{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
          8. lower-PI.f6426.4

            \[\leadsto {a}^{2} \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
        5. Applied rewrites26.4%

          \[\leadsto \color{blue}{{a}^{2} \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]

        if 1.1000000000000001e-158 < b

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

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

      Alternative 11: 59.0% accurate, 0.8× speedup?

      \[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+296}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\sqrt{{b}^{8}}}\\ \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* (/ angle 180.0) PI)))
         (if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 2e+296)
           (* b b)
           (sqrt (sqrt (pow b 8.0))))))
      double code(double a, double b, double angle) {
      	double t_0 = (angle / 180.0) * ((double) M_PI);
      	double tmp;
      	if ((pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0)) <= 2e+296) {
      		tmp = b * b;
      	} else {
      		tmp = sqrt(sqrt(pow(b, 8.0)));
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double angle) {
      	double t_0 = (angle / 180.0) * Math.PI;
      	double tmp;
      	if ((Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0)) <= 2e+296) {
      		tmp = b * b;
      	} else {
      		tmp = Math.sqrt(Math.sqrt(Math.pow(b, 8.0)));
      	}
      	return tmp;
      }
      
      def code(a, b, angle):
      	t_0 = (angle / 180.0) * math.pi
      	tmp = 0
      	if (math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)) <= 2e+296:
      		tmp = b * b
      	else:
      		tmp = math.sqrt(math.sqrt(math.pow(b, 8.0)))
      	return tmp
      
      function code(a, b, angle)
      	t_0 = Float64(Float64(angle / 180.0) * pi)
      	tmp = 0.0
      	if (Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) <= 2e+296)
      		tmp = Float64(b * b);
      	else
      		tmp = sqrt(sqrt((b ^ 8.0)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, angle)
      	t_0 = (angle / 180.0) * pi;
      	tmp = 0.0;
      	if ((((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0)) <= 2e+296)
      		tmp = b * b;
      	else
      		tmp = sqrt(sqrt((b ^ 8.0)));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[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], 2e+296], N[(b * b), $MachinePrecision], N[Sqrt[N[Sqrt[N[Power[b, 8.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \frac{angle}{180} \cdot \pi\\
      \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+296}:\\
      \;\;\;\;b \cdot b\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{\sqrt{{b}^{8}}}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 1.99999999999999996e296

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

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

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

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

          \[\leadsto b \cdot \color{blue}{b} \]
        7. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \sqrt{b \cdot b} \cdot \color{blue}{\sqrt{b \cdot b}} \]
          2. sqrt-unprodN/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          4. lower-*.f6449.4

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
        8. Applied rewrites49.4%

          \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
        9. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \sqrt{\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \cdot \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}} \]
          2. sqrt-unprodN/A

            \[\leadsto \sqrt{\sqrt{\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\sqrt{\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}} \]
          4. pow2N/A

            \[\leadsto \sqrt{\sqrt{{\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}^{2}}} \]
          5. lift-*.f64N/A

            \[\leadsto \sqrt{\sqrt{{\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}^{2}}} \]
          6. pow-prod-downN/A

            \[\leadsto \sqrt{\sqrt{{\left(b \cdot b\right)}^{2} \cdot {\left(b \cdot b\right)}^{2}}} \]
          7. pow-prod-upN/A

            \[\leadsto \sqrt{\sqrt{{\left(b \cdot b\right)}^{\left(2 + 2\right)}}} \]
          8. lift-*.f64N/A

            \[\leadsto \sqrt{\sqrt{{\left(b \cdot b\right)}^{\left(2 + 2\right)}}} \]
          9. pow-prod-downN/A

            \[\leadsto \sqrt{\sqrt{{b}^{\left(2 + 2\right)} \cdot {b}^{\left(2 + 2\right)}}} \]
          10. pow-prod-upN/A

            \[\leadsto \sqrt{\sqrt{{b}^{\left(\left(2 + 2\right) + \left(2 + 2\right)\right)}}} \]
          11. lower-pow.f64N/A

            \[\leadsto \sqrt{\sqrt{{b}^{\left(\left(2 + 2\right) + \left(2 + 2\right)\right)}}} \]
          12. metadata-evalN/A

            \[\leadsto \sqrt{\sqrt{{b}^{\left(4 + \left(2 + 2\right)\right)}}} \]
          13. metadata-evalN/A

            \[\leadsto \sqrt{\sqrt{{b}^{\left(4 + 4\right)}}} \]
          14. metadata-eval45.1

            \[\leadsto \sqrt{\sqrt{{b}^{8}}} \]
        10. Applied rewrites45.1%

          \[\leadsto \sqrt{\sqrt{{b}^{8}}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 12: 58.1% accurate, 0.8× speedup?

      \[\begin{array}{l} t_0 := \left|b\right| \cdot \left|b\right|\\ t_1 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;{\left(a \cdot \sin t\_1\right)}^{2} + {\left(\left|b\right| \cdot \cos t\_1\right)}^{2} \leq 2 \cdot 10^{+296}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t\_0 \cdot \left|b\right|} \cdot \sqrt{\left|b\right|}\\ \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* (fabs b) (fabs b))) (t_1 (* (/ angle 180.0) PI)))
         (if (<=
              (+ (pow (* a (sin t_1)) 2.0) (pow (* (fabs b) (cos t_1)) 2.0))
              2e+296)
           t_0
           (* (sqrt (* t_0 (fabs b))) (sqrt (fabs b))))))
      double code(double a, double b, double angle) {
      	double t_0 = fabs(b) * fabs(b);
      	double t_1 = (angle / 180.0) * ((double) M_PI);
      	double tmp;
      	if ((pow((a * sin(t_1)), 2.0) + pow((fabs(b) * cos(t_1)), 2.0)) <= 2e+296) {
      		tmp = t_0;
      	} else {
      		tmp = sqrt((t_0 * fabs(b))) * sqrt(fabs(b));
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double angle) {
      	double t_0 = Math.abs(b) * Math.abs(b);
      	double t_1 = (angle / 180.0) * Math.PI;
      	double tmp;
      	if ((Math.pow((a * Math.sin(t_1)), 2.0) + Math.pow((Math.abs(b) * Math.cos(t_1)), 2.0)) <= 2e+296) {
      		tmp = t_0;
      	} else {
      		tmp = Math.sqrt((t_0 * Math.abs(b))) * Math.sqrt(Math.abs(b));
      	}
      	return tmp;
      }
      
      def code(a, b, angle):
      	t_0 = math.fabs(b) * math.fabs(b)
      	t_1 = (angle / 180.0) * math.pi
      	tmp = 0
      	if (math.pow((a * math.sin(t_1)), 2.0) + math.pow((math.fabs(b) * math.cos(t_1)), 2.0)) <= 2e+296:
      		tmp = t_0
      	else:
      		tmp = math.sqrt((t_0 * math.fabs(b))) * math.sqrt(math.fabs(b))
      	return tmp
      
      function code(a, b, angle)
      	t_0 = Float64(abs(b) * abs(b))
      	t_1 = Float64(Float64(angle / 180.0) * pi)
      	tmp = 0.0
      	if (Float64((Float64(a * sin(t_1)) ^ 2.0) + (Float64(abs(b) * cos(t_1)) ^ 2.0)) <= 2e+296)
      		tmp = t_0;
      	else
      		tmp = Float64(sqrt(Float64(t_0 * abs(b))) * sqrt(abs(b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, angle)
      	t_0 = abs(b) * abs(b);
      	t_1 = (angle / 180.0) * pi;
      	tmp = 0.0;
      	if ((((a * sin(t_1)) ^ 2.0) + ((abs(b) * cos(t_1)) ^ 2.0)) <= 2e+296)
      		tmp = t_0;
      	else
      		tmp = sqrt((t_0 * abs(b))) * sqrt(abs(b));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(a * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Abs[b], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 2e+296], t$95$0, N[(N[Sqrt[N[(t$95$0 * N[Abs[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[b], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \left|b\right| \cdot \left|b\right|\\
      t_1 := \frac{angle}{180} \cdot \pi\\
      \mathbf{if}\;{\left(a \cdot \sin t\_1\right)}^{2} + {\left(\left|b\right| \cdot \cos t\_1\right)}^{2} \leq 2 \cdot 10^{+296}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{t\_0 \cdot \left|b\right|} \cdot \sqrt{\left|b\right|}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 1.99999999999999996e296

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

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

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

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

          \[\leadsto b \cdot \color{blue}{b} \]
        7. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \sqrt{b \cdot b} \cdot \color{blue}{\sqrt{b \cdot b}} \]
          2. sqrt-unprodN/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          4. lower-*.f6449.4

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
        8. Applied rewrites49.4%

          \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
        9. Step-by-step derivation
          1. lift-sqrt.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          2. lift-*.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          4. associate-*l*N/A

            \[\leadsto \sqrt{b \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]
          5. *-commutativeN/A

            \[\leadsto \sqrt{\left(b \cdot \left(b \cdot b\right)\right) \cdot b} \]
          6. sqrt-prodN/A

            \[\leadsto \sqrt{b \cdot \left(b \cdot b\right)} \cdot \color{blue}{\sqrt{b}} \]
          7. lower-unsound-*.f64N/A

            \[\leadsto \sqrt{b \cdot \left(b \cdot b\right)} \cdot \color{blue}{\sqrt{b}} \]
          8. lower-unsound-sqrt.f64N/A

            \[\leadsto \sqrt{b \cdot \left(b \cdot b\right)} \cdot \sqrt{\color{blue}{b}} \]
          9. *-commutativeN/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot b} \cdot \sqrt{b} \]
          10. lower-*.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot b} \cdot \sqrt{b} \]
          11. lower-unsound-sqrt.f6426.4

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot b} \cdot \sqrt{b} \]
        10. Applied rewrites26.4%

          \[\leadsto \sqrt{\left(b \cdot b\right) \cdot b} \cdot \color{blue}{\sqrt{b}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 13: 57.4% accurate, 0.9× speedup?

      \[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+296}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\\ \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* (/ angle 180.0) PI)))
         (if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 2e+296)
           (* b b)
           (sqrt (* (* b b) (* b b))))))
      double code(double a, double b, double angle) {
      	double t_0 = (angle / 180.0) * ((double) M_PI);
      	double tmp;
      	if ((pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0)) <= 2e+296) {
      		tmp = b * b;
      	} else {
      		tmp = sqrt(((b * b) * (b * b)));
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double angle) {
      	double t_0 = (angle / 180.0) * Math.PI;
      	double tmp;
      	if ((Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0)) <= 2e+296) {
      		tmp = b * b;
      	} else {
      		tmp = Math.sqrt(((b * b) * (b * b)));
      	}
      	return tmp;
      }
      
      def code(a, b, angle):
      	t_0 = (angle / 180.0) * math.pi
      	tmp = 0
      	if (math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)) <= 2e+296:
      		tmp = b * b
      	else:
      		tmp = math.sqrt(((b * b) * (b * b)))
      	return tmp
      
      function code(a, b, angle)
      	t_0 = Float64(Float64(angle / 180.0) * pi)
      	tmp = 0.0
      	if (Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) <= 2e+296)
      		tmp = Float64(b * b);
      	else
      		tmp = sqrt(Float64(Float64(b * b) * Float64(b * b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, angle)
      	t_0 = (angle / 180.0) * pi;
      	tmp = 0.0;
      	if ((((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0)) <= 2e+296)
      		tmp = b * b;
      	else
      		tmp = sqrt(((b * b) * (b * b)));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[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], 2e+296], N[(b * b), $MachinePrecision], N[Sqrt[N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \frac{angle}{180} \cdot \pi\\
      \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+296}:\\
      \;\;\;\;b \cdot b\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 1.99999999999999996e296

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

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

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

        1. Initial program 79.6%

          \[{\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. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. lower-pow.f6456.6

            \[\leadsto {b}^{\color{blue}{2}} \]
        4. Applied rewrites56.6%

          \[\leadsto \color{blue}{{b}^{2}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto {b}^{\color{blue}{2}} \]
          2. unpow2N/A

            \[\leadsto b \cdot \color{blue}{b} \]
          3. lower-*.f6456.6

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

          \[\leadsto b \cdot \color{blue}{b} \]
        7. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \sqrt{b \cdot b} \cdot \color{blue}{\sqrt{b \cdot b}} \]
          2. sqrt-unprodN/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          4. lower-*.f6449.4

            \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
        8. Applied rewrites49.4%

          \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 14: 56.6% accurate, 29.7× speedup?

      \[b \cdot b \]
      (FPCore (a b angle) :precision binary64 (* b b))
      double code(double a, double b, double angle) {
      	return b * b;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(a, b, angle)
      use fmin_fmax_functions
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: angle
          code = b * b
      end function
      
      public static double code(double a, double b, double angle) {
      	return b * b;
      }
      
      def code(a, b, angle):
      	return b * b
      
      function code(a, b, angle)
      	return Float64(b * b)
      end
      
      function tmp = code(a, b, angle)
      	tmp = b * b;
      end
      
      code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
      
      b \cdot b
      
      Derivation
      1. Initial program 79.6%

        \[{\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. Taylor expanded in angle around 0

        \[\leadsto \color{blue}{{b}^{2}} \]
      3. Step-by-step derivation
        1. lower-pow.f6456.6

          \[\leadsto {b}^{\color{blue}{2}} \]
      4. Applied rewrites56.6%

        \[\leadsto \color{blue}{{b}^{2}} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto {b}^{\color{blue}{2}} \]
        2. unpow2N/A

          \[\leadsto b \cdot \color{blue}{b} \]
        3. lower-*.f6456.6

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

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

      Reproduce

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