ab-angle->ABCF C

Percentage Accurate: 80.2% → 79.9%
Time: 16.2s
Alternatives: 17
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 80.2% accurate, 1.0× speedup?

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

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

Alternative 1: 79.9% accurate, 0.8× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    4. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    5. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    6. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    9. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    10. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    12. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    14. /-lowering-/.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.1%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right) - \cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right), 2\right)\right) \]
    2. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    4. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    7. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    9. cos-lowering-cos.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\left(\frac{angle}{180}\right)\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right), \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
  11. Applied egg-rr79.1%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{1 + \mathsf{PI}\left(\right)}{180} \cdot angle\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    3. associate-*l/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{\left(1 + \mathsf{PI}\left(\right)\right) \cdot angle}{180}\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot angle\right), 180\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), angle\right), 180\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), angle\right), 180\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
    7. PI-lowering-PI.f6479.2%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), angle\right), 180\right)\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)\right), 2\right)\right) \]
  13. Applied egg-rr79.2%

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

Alternative 2: 80.0% accurate, 1.9× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    4. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    5. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    6. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    9. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    10. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    12. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    14. /-lowering-/.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.1%

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

Alternative 3: 80.0% accurate, 1.9× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    4. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    5. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    6. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    9. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    10. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    12. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    14. /-lowering-/.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.1%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\frac{180}{angle}}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot \frac{angle}{180}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    3. div-invN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{180}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\left(1 + \mathsf{PI}\left(\right)\right) \cdot angle\right), \left(\frac{1}{180}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), angle\right), \left(\frac{1}{180}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), angle\right), \left(\frac{1}{180}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), angle\right), \left(\frac{1}{180}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    9. metadata-eval79.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), angle\right), \frac{1}{180}\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  11. Applied egg-rr79.1%

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

Alternative 4: 80.0% accurate, 1.9× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    4. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    5. div-subN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    6. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    9. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    10. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    12. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    14. /-lowering-/.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.1%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    2. sub-divN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\left(1 + \mathsf{PI}\left(\right)\right) - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. rem-exp-logN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\log \left(1 + \mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    4. log1p-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    5. expm1-undefineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    6. expm1-log1p-uN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}}\right)\right)\right), 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 2\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{180}{angle}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(180, angle\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
    11. PI-lowering-PI.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(180, angle\right), \mathsf{PI.f64}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
  11. Applied egg-rr79.1%

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

Alternative 5: 80.0% accurate, 1.9× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
    3. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}}\right)\right)\right), 2\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right)\right)\right)\right), 2\right)\right) \]
    5. associate-/l/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{180}{\mathsf{PI}\left(\right) \cdot angle}\right)\right)\right)\right), 2\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(180, \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right)\right)\right), 2\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(180, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right)\right)\right)\right)\right), 2\right)\right) \]
    8. PI-lowering-PI.f6479.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(180, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.1%

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

Alternative 6: 80.0% accurate, 2.0× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
  3. Simplified78.7%

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
  7. Simplified79.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right)\right), 2\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right)\right), 2\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), \frac{1}{180}\right)\right)\right), 2\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), \frac{1}{180}\right)\right)\right), 2\right)\right) \]
    5. PI-lowering-PI.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), \frac{1}{180}\right)\right)\right), 2\right)\right) \]
  9. Applied egg-rr79.0%

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

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

Alternative 7: 80.1% accurate, 2.0× speedup?

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)}, 2\right)\right) \]
    2. *-lowering-*.f6479.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right)}, 2\right)\right) \]
  5. Simplified79.0%

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

Alternative 8: 76.5% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + \left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999999e-16

    1. Initial program 83.9%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified84.0%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6484.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified84.1%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\left(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}, 2\right)\right) \]
    9. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right) + angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      2. fma-defineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(\mathsf{fma}\left(angle, \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right), angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(\mathsf{fma}\left(angle, \frac{-1}{34992000} \cdot \left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right), angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(\mathsf{fma}\left(angle, \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}, angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), 2\right)\right) \]
      5. fma-undefineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right) + angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2} + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right), 2\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)\right), 2\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)\right), 2\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \frac{-1}{34992000} \cdot \left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)\right)\right), 2\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(angle, \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right), 2\right)\right) \]
    10. Simplified78.9%

      \[\leadsto a \cdot a + {\color{blue}{\left(angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + \left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)}}^{2} \]

    if 3.9999999999999999e-16 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 59.4%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified59.5%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6460.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified60.2%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right), \color{blue}{b}\right)\right) \]
    9. Applied egg-rr60.3%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(b \cdot \left(\sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), b\right)\right) \]
      2. pow2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(b \cdot {\sin \left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)}^{2}\right), b\right)\right) \]
      4. associate-*l/N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({\sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}^{2} \cdot b\right), b\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}^{2}\right), b\right), b\right)\right) \]
    11. Applied egg-rr60.3%

      \[\leadsto a \cdot a + \color{blue}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) \cdot b\right)} \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\ \;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + \left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 77.2% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\
\;\;\;\;a \cdot a + \left(b \cdot angle\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot angle\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999999e-16

    1. Initial program 83.9%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified84.0%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6484.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified84.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified63.5%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot \left(angle \cdot angle\right)\right)}\right)\right) \]
      2. unswap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(b \cdot angle\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right), \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(\color{blue}{b} \cdot angle\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      9. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      11. *-lowering-*.f6480.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \mathsf{*.f64}\left(b, \color{blue}{angle}\right)\right)\right) \]
    12. Applied egg-rr80.5%

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

    if 3.9999999999999999e-16 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 59.4%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified59.5%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6460.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified60.2%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right), \color{blue}{b}\right)\right) \]
    9. Applied egg-rr60.3%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(b \cdot \left(\sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), b\right)\right) \]
      2. pow2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(b \cdot {\sin \left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)}^{2}\right), b\right)\right) \]
      4. associate-*l/N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({\sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}^{2} \cdot b\right), b\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}^{2}\right), b\right), b\right)\right) \]
    11. Applied egg-rr60.3%

      \[\leadsto a \cdot a + \color{blue}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) \cdot b\right)} \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\ \;\;\;\;a \cdot a + \left(b \cdot angle\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 77.2% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\
\;\;\;\;a \cdot a + \left(b \cdot angle\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot angle\right)\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999999e-16

    1. Initial program 83.9%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified84.0%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6484.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified84.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified63.5%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot \left(angle \cdot angle\right)\right)}\right)\right) \]
      2. unswap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(b \cdot angle\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right), \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(\color{blue}{b} \cdot angle\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      9. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      11. *-lowering-*.f6480.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \mathsf{*.f64}\left(b, \color{blue}{angle}\right)\right)\right) \]
    12. Applied egg-rr80.5%

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

    if 3.9999999999999999e-16 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 59.4%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified59.5%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6460.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified60.2%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), 2\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
      3. expm1-log1p-uN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)\right)}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
      4. expm1-undefineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)} - 1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
      5. div-subN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{1}{\frac{180}{angle}}\right)\right)\right), 2\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}} - \frac{angle}{180}\right)\right)\right), 2\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}}{\frac{180}{angle}}\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\mathsf{log1p}\left(\mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      9. log1p-undefineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \mathsf{PI}\left(\right)\right)}\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      10. rem-exp-logN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      12. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      14. /-lowering-/.f6460.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), 2\right)\right) \]
    9. Applied egg-rr60.6%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right) - \cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right), 2\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      4. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\left(1 + \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      7. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \left(\frac{180}{angle}\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \cos \left(\frac{angle}{180}\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      9. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\left(\frac{angle}{180}\right)\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{PI.f64}\left(\right)\right), \mathsf{/.f64}\left(180, angle\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(angle, 180\right)\right)\right), \mathsf{*.f64}\left(\cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right), \sin \left(\frac{angle}{180}\right)\right)\right)\right), 2\right)\right) \]
    11. Applied egg-rr60.6%

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \left(\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right) - \cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \cos \left(\frac{angle}{180}\right) - \cos \left(\frac{1 + \mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \sin \left(\frac{angle}{180}\right)\right)}\right)\right)\right)\right) \]
    13. Applied egg-rr60.1%

      \[\leadsto a \cdot a + \color{blue}{b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-16}:\\ \;\;\;\;a \cdot a + \left(b \cdot angle\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.4% accurate, 18.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.2 \cdot 10^{-80}:\\
\;\;\;\;a \cdot a\\

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


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

    1. Initial program 77.5%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6459.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified59.2%

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

    if 2.2000000000000001e-80 < b

    1. Initial program 82.3%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified82.3%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6481.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified81.6%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified54.8%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot \left(angle \cdot angle\right)\right)}\right)\right) \]
      2. unswap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(b \cdot angle\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right) \cdot \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(b \cdot angle\right)\right), \color{blue}{\left(b \cdot angle\right)}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(\color{blue}{b} \cdot angle\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      9. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \left(b \cdot angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \left(b \cdot angle\right)\right)\right) \]
      11. *-lowering-*.f6476.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right), \mathsf{*.f64}\left(b, angle\right)\right), \mathsf{*.f64}\left(b, \color{blue}{angle}\right)\right)\right) \]
    12. Applied egg-rr76.9%

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

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

Alternative 12: 66.0% accurate, 18.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{-82}:\\
\;\;\;\;a \cdot a\\

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


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

    1. Initial program 77.5%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6459.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified59.2%

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

    if 1.3500000000000001e-82 < b

    1. Initial program 82.3%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified82.3%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6481.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified81.6%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified54.8%

      \[\leadsto \color{blue}{a \cdot a + \left(\left(b \cdot b\right) \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
    11. Step-by-step derivation
      1. unswap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(\left(b \cdot angle\right) \cdot \left(b \cdot angle\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)}, \frac{1}{32400}\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left(b \cdot \left(angle \cdot \left(b \cdot angle\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)}, \frac{1}{32400}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(angle \cdot \left(b \cdot angle\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right)}, \frac{1}{32400}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \left(b \cdot angle\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{PI.f64}\left(\right)}\right), \frac{1}{32400}\right)\right)\right) \]
      5. *-lowering-*.f6474.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(b, angle\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right)\right)\right) \]
    12. Applied egg-rr74.3%

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

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

Alternative 13: 62.3% accurate, 20.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(\pi \cdot \frac{angle}{180}\right)\\ \mathbf{if}\;b \leq 1.9 \cdot 10^{+129}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* b (* PI (/ angle 180.0)))))
   (if (<= b 1.9e+129) (* a a) (* t_0 t_0))))
double code(double a, double b, double angle) {
	double t_0 = b * (((double) M_PI) * (angle / 180.0));
	double tmp;
	if (b <= 1.9e+129) {
		tmp = a * a;
	} else {
		tmp = t_0 * t_0;
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = b * (Math.PI * (angle / 180.0));
	double tmp;
	if (b <= 1.9e+129) {
		tmp = a * a;
	} else {
		tmp = t_0 * t_0;
	}
	return tmp;
}
def code(a, b, angle):
	t_0 = b * (math.pi * (angle / 180.0))
	tmp = 0
	if b <= 1.9e+129:
		tmp = a * a
	else:
		tmp = t_0 * t_0
	return tmp
function code(a, b, angle)
	t_0 = Float64(b * Float64(pi * Float64(angle / 180.0)))
	tmp = 0.0
	if (b <= 1.9e+129)
		tmp = Float64(a * a);
	else
		tmp = Float64(t_0 * t_0);
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	t_0 = b * (pi * (angle / 180.0));
	tmp = 0.0;
	if (b <= 1.9e+129)
		tmp = a * a;
	else
		tmp = t_0 * t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(b * N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.9e+129], N[(a * a), $MachinePrecision], N[(t$95$0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b \cdot \left(\pi \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;b \leq 1.9 \cdot 10^{+129}:\\
\;\;\;\;a \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.90000000000000003e129

    1. Initial program 76.0%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified57.5%

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

    if 1.90000000000000003e129 < b

    1. Initial program 95.2%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified95.1%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6495.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified95.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified59.8%

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

      \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{b}^{2}}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{{b}^{2}} \]
      4. *-commutativeN/A

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot {\color{blue}{angle}}^{2}\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      13. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {angle}^{2}\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({angle}^{2}\right)}\right)\right)\right)\right) \]
      15. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{angle}}^{2}\right)\right)\right)\right)\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{angle}\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{angle}\right)\right)\right)\right)\right) \]
    13. Simplified54.3%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\pi \cdot \left(angle \cdot angle\right)\right)\right)\right)} \]
    14. Step-by-step derivation
      1. metadata-evalN/A

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

        \[\leadsto \left(b \cdot b\right) \cdot \left({\frac{1}{180}}^{2} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot angle\right)}\right)\right) \]
      3. pow2N/A

        \[\leadsto \left(b \cdot b\right) \cdot \left({\frac{1}{180}}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \left(\color{blue}{angle} \cdot angle\right)\right)\right) \]
      4. pow2N/A

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

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

        \[\leadsto \left(b \cdot b\right) \cdot \left({\frac{1}{180}}^{2} \cdot {\left(angle \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \left(b \cdot b\right) \cdot {\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{\color{blue}{2}} \]
      8. unpow2N/A

        \[\leadsto \left(b \cdot b\right) \cdot \left(\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      9. swap-sqrN/A

        \[\leadsto \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{b} \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      16. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\frac{angle}{180}\right)\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      18. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right), \left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
    15. Applied egg-rr81.2%

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

Alternative 14: 60.7% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.9 \cdot 10^{+147}:\\
\;\;\;\;a \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.89999999999999985e147

    1. Initial program 76.1%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified57.2%

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

    if 1.89999999999999985e147 < b

    1. Initial program 97.1%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified97.1%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6497.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified97.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified59.4%

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

      \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{b}^{2}}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{{b}^{2}} \]
      4. *-commutativeN/A

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot {\color{blue}{angle}}^{2}\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      13. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {angle}^{2}\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({angle}^{2}\right)}\right)\right)\right)\right) \]
      15. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{angle}}^{2}\right)\right)\right)\right)\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{angle}\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f6459.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{angle}\right)\right)\right)\right)\right) \]
    13. Simplified59.4%

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

      \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
    15. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400} \]
      3. associate-*l*N/A

        \[\leadsto \left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({angle}^{2} \cdot \left(b \cdot b\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left({angle}^{2} \cdot b\right) \cdot b\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({angle}^{2} \cdot b\right), b\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({angle}^{2}\right), b\right), b\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(angle \cdot angle\right), b\right), b\right), \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \mathsf{*.f64}\left(\left({\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{\frac{1}{32400}}\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right)\right) \]
      14. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI}\left(\right)\right), \frac{1}{32400}\right)\right) \]
      15. PI-lowering-PI.f6475.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, angle\right), b\right), b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{32400}\right)\right) \]
    16. Simplified75.0%

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

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

Alternative 15: 60.7% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.25 \cdot 10^{+148}:\\
\;\;\;\;a \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.25000000000000006e148

    1. Initial program 76.1%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified57.2%

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

    if 1.25000000000000006e148 < b

    1. Initial program 97.1%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified97.1%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6497.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified97.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified59.4%

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

      \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{b}^{2}}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{{b}^{2}} \]
      4. *-commutativeN/A

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot {\color{blue}{angle}}^{2}\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      13. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {angle}^{2}\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({angle}^{2}\right)}\right)\right)\right)\right) \]
      15. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{angle}}^{2}\right)\right)\right)\right)\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{angle}\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f6459.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{angle}\right)\right)\right)\right)\right) \]
    13. Simplified59.4%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\pi \cdot \left(angle \cdot angle\right)\right)\right)\right)} \]
    14. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto b \cdot \color{blue}{\left(b \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot angle\right)\right)\right)\right)\right) \cdot \color{blue}{b} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot angle\right)\right)\right)\right)\right), \color{blue}{b}\right) \]
    15. Applied egg-rr75.0%

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

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

Alternative 16: 60.2% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.5 \cdot 10^{+148}:\\
\;\;\;\;a \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.50000000000000007e148

    1. Initial program 76.1%

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

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

        \[\leadsto a \cdot \color{blue}{a} \]
      2. *-lowering-*.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
    5. Simplified57.2%

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

    if 1.50000000000000007e148 < b

    1. Initial program 97.1%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \left({\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(a, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right), 2\right), \mathsf{pow.f64}\left(\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right), \color{blue}{2}\right)\right) \]
    3. Simplified97.1%

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

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

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
      2. *-lowering-*.f6497.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{*.f64}\left(b, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), 180\right)\right)\right)}, 2\right)\right) \]
    7. Simplified97.1%

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

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

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

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

        \[\leadsto {angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2} \]
      4. +-commutativeN/A

        \[\leadsto {a}^{2} + \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({a}^{2}\right), \color{blue}{\left({angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{{angle}^{2}} \cdot \left(\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left({angle}^{2} \cdot \left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\left({angle}^{2} \cdot {b}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({angle}^{2} \cdot {b}^{2}\right), \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{1}{32400}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\left({b}^{2} \cdot {angle}^{2}\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({b}^{2}\right), \left({angle}^{2}\right)\right), \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left({angle}^{2}\right)\right), \left({\color{blue}{\mathsf{PI}\left(\right)}}^{2} \cdot \frac{1}{32400}\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(angle \cdot angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(angle, angle\right)\right), \left({\mathsf{PI}\left(\right)}^{\color{blue}{2}} \cdot \frac{1}{32400}\right)\right)\right) \]
    10. Simplified59.4%

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

      \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{b}^{2}}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{{b}^{2}} \]
      4. *-commutativeN/A

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\color{blue}{\frac{1}{32400}} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot {\color{blue}{angle}}^{2}\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {angle}^{2}\right)}\right)\right)\right) \]
      13. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {angle}^{2}\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({angle}^{2}\right)}\right)\right)\right)\right) \]
      15. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{angle}}^{2}\right)\right)\right)\right)\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{angle}\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f6459.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\frac{1}{32400}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{angle}\right)\right)\right)\right)\right) \]
    13. Simplified59.4%

      \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\pi \cdot \left(angle \cdot angle\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 56.6% accurate, 139.0× speedup?

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

\\
a \cdot a
\end{array}
Derivation
  1. Initial program 78.7%

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

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

      \[\leadsto a \cdot \color{blue}{a} \]
    2. *-lowering-*.f6453.2%

      \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{a}\right) \]
  5. Simplified53.2%

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

Reproduce

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