ab-angle->ABCF C

Percentage Accurate: 79.4% → 79.4%
Time: 52.8s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 79.4% 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.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ {\left(a \cdot \left(e^{\mathsf{log1p}\left(\cos t\_0\right)} + -1\right)\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 0.005555555555555556))))
   (+
    (pow (* a (+ (exp (log1p (cos t_0))) -1.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 * 0.005555555555555556);
	return pow((a * (exp(log1p(cos(t_0))) + -1.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 * 0.005555555555555556);
	return Math.pow((a * (Math.exp(Math.log1p(Math.cos(t_0))) + -1.0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle):
	t_0 = math.pi * (angle * 0.005555555555555556)
	return math.pow((a * (math.exp(math.log1p(math.cos(t_0))) + -1.0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	return Float64((Float64(a * Float64(exp(log1p(cos(t_0))) + -1.0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[(N[Exp[N[Log[1 + N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + -1.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 \left(angle \cdot 0.005555555555555556\right)\\
{\left(a \cdot \left(e^{\mathsf{log1p}\left(\cos t\_0\right)} + -1\right)\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Derivation
  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. Simplified82.5%

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. metadata-eval82.5%

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

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

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

        \[\leadsto {\left(a \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\cos \left(\pi \cdot \frac{angle}{180}\right)\right)} - 1\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      5. div-inv82.5%

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

        \[\leadsto {\left(a \cdot \left(e^{\mathsf{log1p}\left(\cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)\right)} - 1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    4. Applied egg-rr82.5%

      \[\leadsto {\left(a \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} - 1\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    5. Final simplification82.5%

      \[\leadsto {\left(a \cdot \left(e^{\mathsf{log1p}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} + -1\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
    6. Add Preprocessing

    Alternative 2: 79.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ {\left(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \log \left(e^{\cos t\_0}\right)\right)}^{2} \end{array} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (let* ((t_0 (* PI (* angle 0.005555555555555556))))
       (+ (pow (* b (sin t_0)) 2.0) (pow (* a (log (exp (cos t_0)))) 2.0))))
    double code(double a, double b, double angle) {
    	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
    	return pow((b * sin(t_0)), 2.0) + pow((a * log(exp(cos(t_0)))), 2.0);
    }
    
    public static double code(double a, double b, double angle) {
    	double t_0 = Math.PI * (angle * 0.005555555555555556);
    	return Math.pow((b * Math.sin(t_0)), 2.0) + Math.pow((a * Math.log(Math.exp(Math.cos(t_0)))), 2.0);
    }
    
    def code(a, b, angle):
    	t_0 = math.pi * (angle * 0.005555555555555556)
    	return math.pow((b * math.sin(t_0)), 2.0) + math.pow((a * math.log(math.exp(math.cos(t_0)))), 2.0)
    
    function code(a, b, angle)
    	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
    	return Float64((Float64(b * sin(t_0)) ^ 2.0) + (Float64(a * log(exp(cos(t_0)))) ^ 2.0))
    end
    
    function tmp = code(a, b, angle)
    	t_0 = pi * (angle * 0.005555555555555556);
    	tmp = ((b * sin(t_0)) ^ 2.0) + ((a * log(exp(cos(t_0)))) ^ 2.0);
    end
    
    code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
    {\left(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \log \left(e^{\cos t\_0}\right)\right)}^{2}
    \end{array}
    \end{array}
    
    Derivation
    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. Simplified82.5%

        \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. add-log-exp82.5%

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

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

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

      Alternative 3: 79.4% accurate, 1.0× speedup?

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

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

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

        Alternative 4: 79.4% accurate, 1.0× speedup?

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

            \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}} \]
          2. Add Preprocessing
          3. Taylor expanded in angle around inf 82.3%

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

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

          Alternative 5: 79.2% accurate, 1.3× speedup?

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

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

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

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

            Alternative 6: 74.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 74.3% accurate, 3.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\pi \cdot 0.005555555555555556\right) \cdot \left(angle \cdot b\right)\\ {a}^{2} + t\_0 \cdot t\_0 \end{array} \end{array} \]
              (FPCore (a b angle)
               :precision binary64
               (let* ((t_0 (* (* PI 0.005555555555555556) (* angle b))))
                 (+ (pow a 2.0) (* t_0 t_0))))
              double code(double a, double b, double angle) {
              	double t_0 = (((double) M_PI) * 0.005555555555555556) * (angle * b);
              	return pow(a, 2.0) + (t_0 * t_0);
              }
              
              public static double code(double a, double b, double angle) {
              	double t_0 = (Math.PI * 0.005555555555555556) * (angle * b);
              	return Math.pow(a, 2.0) + (t_0 * t_0);
              }
              
              def code(a, b, angle):
              	t_0 = (math.pi * 0.005555555555555556) * (angle * b)
              	return math.pow(a, 2.0) + (t_0 * t_0)
              
              function code(a, b, angle)
              	t_0 = Float64(Float64(pi * 0.005555555555555556) * Float64(angle * b))
              	return Float64((a ^ 2.0) + Float64(t_0 * t_0))
              end
              
              function tmp = code(a, b, angle)
              	t_0 = (pi * 0.005555555555555556) * (angle * b);
              	tmp = (a ^ 2.0) + (t_0 * t_0);
              end
              
              code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[a, 2.0], $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(\pi \cdot 0.005555555555555556\right) \cdot \left(angle \cdot b\right)\\
              {a}^{2} + t\_0 \cdot t\_0
              \end{array}
              \end{array}
              
              Derivation
              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. Simplified82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 8: 73.5% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 9: 73.5% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Reproduce

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