ab-angle->ABCF B

Percentage Accurate: 54.4% → 67.3%
Time: 7.3s
Alternatives: 16
Speedup: 6.6×

Specification

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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: 54.4% accurate, 1.0× speedup?

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

Alternative 1: 67.3% accurate, 0.8× speedup?

\[\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 5 \cdot 10^{+116}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right)\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot \left|angle\right|, \pi \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left|angle\right| \cdot \left(\left(\sqrt[3]{\pi} \cdot 2.1450293971110255\right) \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (copysign 1.0 angle)
  (if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) 5e+116)
    (*
     (*
      (+ b a)
      (* (- b a) (* 2.0 (sin (* (* 0.005555555555555556 (fabs angle)) PI)))))
     (sin (fma -0.005555555555555556 (* PI (fabs angle)) (* PI 0.5))))
    (*
     (+ a b)
     (*
      (- b a)
      (sin
       (*
        (fabs angle)
        (* (* (cbrt PI) 2.1450293971110255) 0.011111111111111112))))))))
double code(double a, double b, double angle) {
	double tmp;
	if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 5e+116) {
		tmp = ((b + a) * ((b - a) * (2.0 * sin(((0.005555555555555556 * fabs(angle)) * ((double) M_PI)))))) * sin(fma(-0.005555555555555556, (((double) M_PI) * fabs(angle)), (((double) M_PI) * 0.5)));
	} else {
		tmp = (a + b) * ((b - a) * sin((fabs(angle) * ((cbrt(((double) M_PI)) * 2.1450293971110255) * 0.011111111111111112))));
	}
	return copysign(1.0, angle) * tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 5e+116)
		tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(Float64(0.005555555555555556 * abs(angle)) * pi))))) * sin(fma(-0.005555555555555556, Float64(pi * abs(angle)), Float64(pi * 0.5))));
	else
		tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(abs(angle) * Float64(Float64(cbrt(pi) * 2.1450293971110255) * 0.011111111111111112)))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+116], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(-0.005555555555555556 * N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[Abs[angle], $MachinePrecision] * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * 2.1450293971110255), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 5 \cdot 10^{+116}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right)\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot \left|angle\right|, \pi \cdot 0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left|angle\right| \cdot \left(\left(\sqrt[3]{\pi} \cdot 2.1450293971110255\right) \cdot 0.011111111111111112\right)\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 5.00000000000000025e116

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(\left(\left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot 2\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      14. lower--.f6457.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}\right) \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{180}, \pi \cdot angle, \pi \cdot \frac{1}{2}\right)\right) \]
      11. lower-*.f6466.9%

        \[\leadsto \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(2 \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle, \pi \cdot 0.5\right)\right) \]
      12. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \pi\right)\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{180}, \pi \cdot angle, \pi \cdot \frac{1}{2}\right)\right) \]
      19. lift-*.f6466.9%

        \[\leadsto \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle, \pi \cdot 0.5\right)\right) \]
    7. Applied rewrites66.9%

      \[\leadsto \color{blue}{\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)\right)\right)} \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle, \pi \cdot 0.5\right)\right) \]

    if 5.00000000000000025e116 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      3. add-cube-cbrtN/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{1}{90}\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{1}{90}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      7. lift-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      8. pow1/3N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left(\color{blue}{{\pi}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left({\pi}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\pi}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      10. pow1/3N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left({\pi}^{\frac{1}{3}} \cdot \color{blue}{{\pi}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      11. pow-prod-upN/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\color{blue}{\pi}}\right) \cdot \frac{1}{90}\right)\right) \]
      15. lower-cbrt.f6466.8%

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot {\pi}^{0.6666666666666666}\right) \cdot \color{blue}{\sqrt[3]{\pi}}\right) \cdot 0.011111111111111112\right)\right) \]
    5. Applied rewrites66.8%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)} \cdot 0.011111111111111112\right)\right) \]
    6. Evaluated real constant66.8%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \color{blue}{2.1450293971110255}\right) \cdot \sqrt[3]{\pi}\right) \cdot 0.011111111111111112\right)\right) \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\left(angle \cdot \frac{4830176796763987}{2251799813685248}\right) \cdot \sqrt[3]{\pi}\right) \cdot \frac{1}{90}\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \frac{4830176796763987}{2251799813685248}\right) \cdot \sqrt[3]{\pi}\right)} \cdot \frac{1}{90}\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \frac{4830176796763987}{2251799813685248}\right)} \cdot \sqrt[3]{\pi}\right) \cdot \frac{1}{90}\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \left(\frac{4830176796763987}{2251799813685248} \cdot \sqrt[3]{\pi}\right)\right)} \cdot \frac{1}{90}\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(angle \cdot \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \sqrt[3]{\pi}\right) \cdot \frac{1}{90}\right)\right)}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(angle \cdot \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \sqrt[3]{\pi}\right) \cdot \frac{1}{90}\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \color{blue}{\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \sqrt[3]{\pi}\right) \cdot \frac{1}{90}\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\color{blue}{\left(\sqrt[3]{\pi} \cdot \frac{4830176796763987}{2251799813685248}\right)} \cdot \frac{1}{90}\right)\right)\right) \]
      9. lower-*.f6466.7%

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\color{blue}{\left(\sqrt[3]{\pi} \cdot 2.1450293971110255\right)} \cdot 0.011111111111111112\right)\right)\right) \]
    8. Applied rewrites66.7%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot 2.1450293971110255\right) \cdot 0.011111111111111112\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 67.0% accurate, 1.1× speedup?

\[\begin{array}{l} t_0 := b + \left|a\right|\\ t_1 := b - \left|a\right|\\ t_2 := 0.005555555555555556 \cdot \left|angle\right|\\ \mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 10^{+58}:\\ \;\;\;\;t\_1 \cdot \left(\left(2 \cdot t\_0\right) \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot \left|angle\right|\right)\right) \cdot \sin \left(t\_2 \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 \cdot t\_0\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot t\_2\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (+ b (fabs a)))
        (t_1 (- b (fabs a)))
        (t_2 (* 0.005555555555555556 (fabs angle))))
   (*
    (copysign 1.0 angle)
    (if (<= (fabs angle) 1e+58)
      (*
       t_1
       (*
        (* 2.0 t_0)
        (*
         (cos (* -0.005555555555555556 (* PI (fabs angle))))
         (sin (* t_2 PI)))))
      (*
       (* t_1 t_0)
       (sin (* 2.0 (* (pow PI 0.6666666666666666) (* (cbrt PI) t_2)))))))))
double code(double a, double b, double angle) {
	double t_0 = b + fabs(a);
	double t_1 = b - fabs(a);
	double t_2 = 0.005555555555555556 * fabs(angle);
	double tmp;
	if (fabs(angle) <= 1e+58) {
		tmp = t_1 * ((2.0 * t_0) * (cos((-0.005555555555555556 * (((double) M_PI) * fabs(angle)))) * sin((t_2 * ((double) M_PI)))));
	} else {
		tmp = (t_1 * t_0) * sin((2.0 * (pow(((double) M_PI), 0.6666666666666666) * (cbrt(((double) M_PI)) * t_2))));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = b + Math.abs(a);
	double t_1 = b - Math.abs(a);
	double t_2 = 0.005555555555555556 * Math.abs(angle);
	double tmp;
	if (Math.abs(angle) <= 1e+58) {
		tmp = t_1 * ((2.0 * t_0) * (Math.cos((-0.005555555555555556 * (Math.PI * Math.abs(angle)))) * Math.sin((t_2 * Math.PI))));
	} else {
		tmp = (t_1 * t_0) * Math.sin((2.0 * (Math.pow(Math.PI, 0.6666666666666666) * (Math.cbrt(Math.PI) * t_2))));
	}
	return Math.copySign(1.0, angle) * tmp;
}
function code(a, b, angle)
	t_0 = Float64(b + abs(a))
	t_1 = Float64(b - abs(a))
	t_2 = Float64(0.005555555555555556 * abs(angle))
	tmp = 0.0
	if (abs(angle) <= 1e+58)
		tmp = Float64(t_1 * Float64(Float64(2.0 * t_0) * Float64(cos(Float64(-0.005555555555555556 * Float64(pi * abs(angle)))) * sin(Float64(t_2 * pi)))));
	else
		tmp = Float64(Float64(t_1 * t_0) * sin(Float64(2.0 * Float64((pi ^ 0.6666666666666666) * Float64(cbrt(pi) * t_2)))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(b + N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 1e+58], N[(t$95$1 * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(N[Cos[N[(-0.005555555555555556 * N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$2 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * t$95$0), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[Power[Pi, 0.6666666666666666], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := b + \left|a\right|\\
t_1 := b - \left|a\right|\\
t_2 := 0.005555555555555556 \cdot \left|angle\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 10^{+58}:\\
\;\;\;\;t\_1 \cdot \left(\left(2 \cdot t\_0\right) \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot \left|angle\right|\right)\right) \cdot \sin \left(t\_2 \cdot \pi\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot t\_0\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot t\_2\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 9.99999999999999944e57

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(\left(\left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot 2\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      14. lower--.f6457.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999944e57 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(\left(\left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot 2\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      14. lower--.f6457.8%

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right) \]
      4. add-cube-cbrtN/A

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(\left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right)\right) \]
      10. pow1/3N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \color{blue}{\left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)\right) \]
    7. Applied rewrites57.7%

      \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 67.0% accurate, 1.2× speedup?

\[\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 2 \cdot 10^{+96}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot \left|angle\right|\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot \left|angle\right|\right)\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (copysign 1.0 angle)
  (if (<= (fabs angle) 2e+96)
    (* (+ a b) (* (- b a) (sin (* (* 0.011111111111111112 PI) (fabs angle)))))
    (*
     (* (- b a) (+ b a))
     (sin
      (*
       2.0
       (*
        (pow PI 0.6666666666666666)
        (* (cbrt PI) (* 0.005555555555555556 (fabs angle))))))))))
double code(double a, double b, double angle) {
	double tmp;
	if (fabs(angle) <= 2e+96) {
		tmp = (a + b) * ((b - a) * sin(((0.011111111111111112 * ((double) M_PI)) * fabs(angle))));
	} else {
		tmp = ((b - a) * (b + a)) * sin((2.0 * (pow(((double) M_PI), 0.6666666666666666) * (cbrt(((double) M_PI)) * (0.005555555555555556 * fabs(angle))))));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.abs(angle) <= 2e+96) {
		tmp = (a + b) * ((b - a) * Math.sin(((0.011111111111111112 * Math.PI) * Math.abs(angle))));
	} else {
		tmp = ((b - a) * (b + a)) * Math.sin((2.0 * (Math.pow(Math.PI, 0.6666666666666666) * (Math.cbrt(Math.PI) * (0.005555555555555556 * Math.abs(angle))))));
	}
	return Math.copySign(1.0, angle) * tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (abs(angle) <= 2e+96)
		tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(0.011111111111111112 * pi) * abs(angle)))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(2.0 * Float64((pi ^ 0.6666666666666666) * Float64(cbrt(pi) * Float64(0.005555555555555556 * abs(angle)))))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 2e+96], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[Power[Pi, 0.6666666666666666], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 2 \cdot 10^{+96}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot \left|angle\right|\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot \left|angle\right|\right)\right)\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.0000000000000001e96

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\frac{1}{90} \cdot \pi\right)} \cdot angle\right)\right) \]
      7. lower-*.f6467.0%

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(0.011111111111111112 \cdot \pi\right)} \cdot angle\right)\right) \]
    5. Applied rewrites67.0%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)}\right) \]

    if 2.0000000000000001e96 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(\left(\left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot 2\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      14. lower--.f6457.8%

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right) \]
      4. add-cube-cbrtN/A

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(\left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\pi} \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right)\right) \]
      10. pow1/3N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left({\pi}^{0.6666666666666666} \cdot \color{blue}{\left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)\right) \]
    7. Applied rewrites57.7%

      \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 66.9% accurate, 1.9× speedup?

\[\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 10^{-26}:\\ \;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot \left|angle\right|\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (copysign 1.0 angle)
  (if (<= (fabs angle) 1e-26)
    (* (+ a b) (* 0.011111111111111112 (* (fabs angle) (* PI (- b a)))))
    (*
     (* (- b a) (+ b a))
     (sin (* (* 0.011111111111111112 PI) (fabs angle)))))))
double code(double a, double b, double angle) {
	double tmp;
	if (fabs(angle) <= 1e-26) {
		tmp = (a + b) * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (b - a))));
	} else {
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * ((double) M_PI)) * fabs(angle)));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.abs(angle) <= 1e-26) {
		tmp = (a + b) * (0.011111111111111112 * (Math.abs(angle) * (Math.PI * (b - a))));
	} else {
		tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * Math.PI) * Math.abs(angle)));
	}
	return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle):
	tmp = 0
	if math.fabs(angle) <= 1e-26:
		tmp = (a + b) * (0.011111111111111112 * (math.fabs(angle) * (math.pi * (b - a))))
	else:
		tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * math.pi) * math.fabs(angle)))
	return math.copysign(1.0, angle) * tmp
function code(a, b, angle)
	tmp = 0.0
	if (abs(angle) <= 1e-26)
		tmp = Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(b - a)))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * pi) * abs(angle))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (abs(angle) <= 1e-26)
		tmp = (a + b) * (0.011111111111111112 * (abs(angle) * (pi * (b - a))));
	else
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * pi) * abs(angle)));
	end
	tmp_2 = (sign(angle) * abs(1.0)) * tmp;
end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 1e-26], N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 10^{-26}:\\
\;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot \left|angle\right|\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1e-26

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b} - a\right)\right)\right)\right) \]
      5. lower--.f6462.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - \color{blue}{a}\right)\right)\right)\right) \]
    12. Applied rewrites62.3%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]

    if 1e-26 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. difference-of-squaresN/A

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

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

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

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

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

        \[\leadsto \left(\left(\left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot 2\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      14. lower--.f6457.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\color{blue}{\left(\frac{1}{90} \cdot \pi\right)} \cdot angle\right) \]
      13. lower-*.f6457.7%

        \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\color{blue}{\left(0.011111111111111112 \cdot \pi\right)} \cdot angle\right) \]
    7. Applied rewrites57.7%

      \[\leadsto \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \color{blue}{\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 66.8% accurate, 1.8× speedup?

\[\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot 2.1450293971110255\right) \cdot \sqrt[3]{\pi}\right) \cdot 0.011111111111111112\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (*
  (+ a b)
  (*
   (- b a)
   (sin (* (* (* angle 2.1450293971110255) (cbrt PI)) 0.011111111111111112)))))
double code(double a, double b, double angle) {
	return (a + b) * ((b - a) * sin((((angle * 2.1450293971110255) * cbrt(((double) M_PI))) * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
	return (a + b) * ((b - a) * Math.sin((((angle * 2.1450293971110255) * Math.cbrt(Math.PI)) * 0.011111111111111112)));
}
function code(a, b, angle)
	return Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(Float64(angle * 2.1450293971110255) * cbrt(pi)) * 0.011111111111111112))))
end
code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(N[(angle * 2.1450293971110255), $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot 2.1450293971110255\right) \cdot \sqrt[3]{\pi}\right) \cdot 0.011111111111111112\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    3. add-cube-cbrtN/A

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{1}{90}\right)\right) \]
    5. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{1}{90}\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    7. lift-PI.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    8. pow1/3N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left(\color{blue}{{\pi}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    9. lift-PI.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left({\pi}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\pi}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    10. pow1/3N/A

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \left({\pi}^{\frac{1}{3}} \cdot \color{blue}{{\pi}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    11. pow-prod-upN/A

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
    13. metadata-evalN/A

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\color{blue}{\pi}}\right) \cdot \frac{1}{90}\right)\right) \]
    15. lower-cbrt.f6466.8%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot {\pi}^{0.6666666666666666}\right) \cdot \color{blue}{\sqrt[3]{\pi}}\right) \cdot 0.011111111111111112\right)\right) \]
  5. Applied rewrites66.8%

    \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\left(angle \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)} \cdot 0.011111111111111112\right)\right) \]
  6. Evaluated real constant66.8%

    \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \color{blue}{2.1450293971110255}\right) \cdot \sqrt[3]{\pi}\right) \cdot 0.011111111111111112\right)\right) \]
  7. Add Preprocessing

Alternative 6: 66.8% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(\frac{1}{90} \cdot \pi\right)} \cdot angle\right)\right) \]
    7. lower-*.f6467.0%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(0.011111111111111112 \cdot \pi\right)} \cdot angle\right)\right) \]
  5. Applied rewrites67.0%

    \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)}\right) \]
  6. Add Preprocessing

Alternative 7: 66.8% accurate, 1.9× speedup?

\[\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{-16}:\\ \;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(\left|angle\right| \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (copysign 1.0 angle)
  (if (<= (fabs angle) 5e-16)
    (* (+ a b) (* 0.011111111111111112 (* (fabs angle) (* PI (- b a)))))
    (*
     (* (- b a) (+ a b))
     (sin (* (* (fabs angle) PI) 0.011111111111111112))))))
double code(double a, double b, double angle) {
	double tmp;
	if (fabs(angle) <= 5e-16) {
		tmp = (a + b) * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (b - a))));
	} else {
		tmp = ((b - a) * (a + b)) * sin(((fabs(angle) * ((double) M_PI)) * 0.011111111111111112));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.abs(angle) <= 5e-16) {
		tmp = (a + b) * (0.011111111111111112 * (Math.abs(angle) * (Math.PI * (b - a))));
	} else {
		tmp = ((b - a) * (a + b)) * Math.sin(((Math.abs(angle) * Math.PI) * 0.011111111111111112));
	}
	return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle):
	tmp = 0
	if math.fabs(angle) <= 5e-16:
		tmp = (a + b) * (0.011111111111111112 * (math.fabs(angle) * (math.pi * (b - a))))
	else:
		tmp = ((b - a) * (a + b)) * math.sin(((math.fabs(angle) * math.pi) * 0.011111111111111112))
	return math.copysign(1.0, angle) * tmp
function code(a, b, angle)
	tmp = 0.0
	if (abs(angle) <= 5e-16)
		tmp = Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(b - a)))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(Float64(abs(angle) * pi) * 0.011111111111111112)));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (abs(angle) <= 5e-16)
		tmp = (a + b) * (0.011111111111111112 * (abs(angle) * (pi * (b - a))));
	else
		tmp = ((b - a) * (a + b)) * sin(((abs(angle) * pi) * 0.011111111111111112));
	end
	tmp_2 = (sign(angle) * abs(1.0)) * tmp;
end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5e-16], N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{-16}:\\
\;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(\left|angle\right| \cdot \pi\right) \cdot 0.011111111111111112\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 5.0000000000000004e-16

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b} - a\right)\right)\right)\right) \]
      5. lower--.f6462.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - \color{blue}{a}\right)\right)\right)\right) \]
    12. Applied rewrites62.3%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]

    if 5.0000000000000004e-16 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 66.8% accurate, 2.3× speedup?

\[\left(b - \left|a\right|\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + \left|a\right|\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (*
  (- b (fabs a))
  (* (sin (* 0.011111111111111112 (* PI angle))) (+ b (fabs a)))))
double code(double a, double b, double angle) {
	return (b - fabs(a)) * (sin((0.011111111111111112 * (((double) M_PI) * angle))) * (b + fabs(a)));
}
public static double code(double a, double b, double angle) {
	return (b - Math.abs(a)) * (Math.sin((0.011111111111111112 * (Math.PI * angle))) * (b + Math.abs(a)));
}
def code(a, b, angle):
	return (b - math.fabs(a)) * (math.sin((0.011111111111111112 * (math.pi * angle))) * (b + math.fabs(a)))
function code(a, b, angle)
	return Float64(Float64(b - abs(a)) * Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle))) * Float64(b + abs(a))))
end
function tmp = code(a, b, angle)
	tmp = (b - abs(a)) * (sin((0.011111111111111112 * (pi * angle))) * (b + abs(a)));
end
code[a_, b_, angle_] := N[(N[(b - N[Abs[a], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(b - \left|a\right|\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + \left|a\right|\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - a\right) \cdot \left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{90}\right) \cdot \left(a + b\right)\right)} \]
    6. lower-*.f6466.8%

      \[\leadsto \left(b - a\right) \cdot \color{blue}{\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(a + b\right)\right)} \]
    7. lift-*.f64N/A

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

      \[\leadsto \left(b - a\right) \cdot \left(\sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(a + b\right)\right) \]
    9. lower-*.f6466.8%

      \[\leadsto \left(b - a\right) \cdot \left(\sin \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(a + b\right)\right) \]
    10. lift-*.f64N/A

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

      \[\leadsto \left(b - a\right) \cdot \left(\sin \left(\frac{1}{90} \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot \left(a + b\right)\right) \]
    12. lower-*.f6466.8%

      \[\leadsto \left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot \left(a + b\right)\right) \]
    13. lift-+.f64N/A

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

      \[\leadsto \left(b - a\right) \cdot \left(\sin \left(\frac{1}{90} \cdot \left(\pi \cdot angle\right)\right) \cdot \color{blue}{\left(b + a\right)}\right) \]
    15. lower-+.f6466.8%

      \[\leadsto \left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \color{blue}{\left(b + a\right)}\right) \]
  5. Applied rewrites66.8%

    \[\leadsto \color{blue}{\left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + a\right)\right)} \]
  6. Add Preprocessing

Alternative 9: 63.6% accurate, 2.5× speedup?

\[\begin{array}{l} t_0 := \left|b\right| - \left|a\right|\\ \mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 4.3 \cdot 10^{+122}:\\ \;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot t\_0\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 \cdot \left(\left|b\right| + \left|a\right|\right)}{t\_0} \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (fabs b) (fabs a))))
   (*
    (copysign 1.0 angle)
    (if (<= (fabs angle) 4.3e+122)
      (*
       (+ (fabs a) (fabs b))
       (* 0.011111111111111112 (* (fabs angle) (* PI t_0))))
      (*
       (/ (* t_0 (+ (fabs b) (fabs a))) t_0)
       (* 0.011111111111111112 (* (fabs angle) (* (fabs b) PI))))))))
double code(double a, double b, double angle) {
	double t_0 = fabs(b) - fabs(a);
	double tmp;
	if (fabs(angle) <= 4.3e+122) {
		tmp = (fabs(a) + fabs(b)) * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * t_0)));
	} else {
		tmp = ((t_0 * (fabs(b) + fabs(a))) / t_0) * (0.011111111111111112 * (fabs(angle) * (fabs(b) * ((double) M_PI))));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.abs(b) - Math.abs(a);
	double tmp;
	if (Math.abs(angle) <= 4.3e+122) {
		tmp = (Math.abs(a) + Math.abs(b)) * (0.011111111111111112 * (Math.abs(angle) * (Math.PI * t_0)));
	} else {
		tmp = ((t_0 * (Math.abs(b) + Math.abs(a))) / t_0) * (0.011111111111111112 * (Math.abs(angle) * (Math.abs(b) * Math.PI)));
	}
	return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle):
	t_0 = math.fabs(b) - math.fabs(a)
	tmp = 0
	if math.fabs(angle) <= 4.3e+122:
		tmp = (math.fabs(a) + math.fabs(b)) * (0.011111111111111112 * (math.fabs(angle) * (math.pi * t_0)))
	else:
		tmp = ((t_0 * (math.fabs(b) + math.fabs(a))) / t_0) * (0.011111111111111112 * (math.fabs(angle) * (math.fabs(b) * math.pi)))
	return math.copysign(1.0, angle) * tmp
function code(a, b, angle)
	t_0 = Float64(abs(b) - abs(a))
	tmp = 0.0
	if (abs(angle) <= 4.3e+122)
		tmp = Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * t_0))));
	else
		tmp = Float64(Float64(Float64(t_0 * Float64(abs(b) + abs(a))) / t_0) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(abs(b) * pi))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
function tmp_2 = code(a, b, angle)
	t_0 = abs(b) - abs(a);
	tmp = 0.0;
	if (abs(angle) <= 4.3e+122)
		tmp = (abs(a) + abs(b)) * (0.011111111111111112 * (abs(angle) * (pi * t_0)));
	else
		tmp = ((t_0 * (abs(b) + abs(a))) / t_0) * (0.011111111111111112 * (abs(angle) * (abs(b) * pi)));
	end
	tmp_2 = (sign(angle) * abs(1.0)) * tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 4.3e+122], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$0 * N[(N[Abs[b], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left|b\right| - \left|a\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 4.3 \cdot 10^{+122}:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot t\_0\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \left(\left|b\right| + \left|a\right|\right)}{t\_0} \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.29999999999999971e122

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b} - a\right)\right)\right)\right) \]
      5. lower--.f6462.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - \color{blue}{a}\right)\right)\right)\right) \]
    12. Applied rewrites62.3%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]

    if 4.29999999999999971e122 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    10. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\left(b + a\right)} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      3. flip-+N/A

        \[\leadsto \color{blue}{\frac{b \cdot b - a \cdot a}{b - a}} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      4. lower-unsound--.f64N/A

        \[\leadsto \frac{b \cdot b - a \cdot a}{\color{blue}{b - a}} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      5. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{b \cdot b - a \cdot a}{b - a}} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      6. lower-unsound--.f32N/A

        \[\leadsto \frac{\color{blue}{b \cdot b - a \cdot a}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      7. lower--.f32N/A

        \[\leadsto \frac{\color{blue}{b \cdot b - a \cdot a}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      8. lower-unsound-*.f32N/A

        \[\leadsto \frac{\color{blue}{b \cdot b} - a \cdot a}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      9. lower-*.f32N/A

        \[\leadsto \frac{\color{blue}{b \cdot b} - a \cdot a}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      10. lower-unsound-*.f32N/A

        \[\leadsto \frac{b \cdot b - \color{blue}{a \cdot a}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      11. lower-*.f32N/A

        \[\leadsto \frac{b \cdot b - \color{blue}{a \cdot a}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      12. difference-of-squares-revN/A

        \[\leadsto \frac{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      13. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      14. lift--.f64N/A

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

        \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \left(b + a\right)}}{b - a} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      16. lift-*.f6440.5%

        \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \left(b + a\right)}}{b - a} \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    11. Applied rewrites40.5%

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

Alternative 10: 62.3% accurate, 3.1× speedup?

\[\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 4.5 \cdot 10^{+122}:\\ \;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(\left|b\right| - \left|a\right|\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(1 + \frac{\left|a\right|}{\left|b\right|}\right) \cdot \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (copysign 1.0 angle)
  (if (<= (fabs angle) 4.5e+122)
    (*
     (+ (fabs a) (fabs b))
     (* 0.011111111111111112 (* (fabs angle) (* PI (- (fabs b) (fabs a))))))
    (*
     (* (+ 1.0 (/ (fabs a) (fabs b))) (fabs b))
     (* 0.011111111111111112 (* (fabs angle) (* (fabs b) PI)))))))
double code(double a, double b, double angle) {
	double tmp;
	if (fabs(angle) <= 4.5e+122) {
		tmp = (fabs(a) + fabs(b)) * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (fabs(b) - fabs(a)))));
	} else {
		tmp = ((1.0 + (fabs(a) / fabs(b))) * fabs(b)) * (0.011111111111111112 * (fabs(angle) * (fabs(b) * ((double) M_PI))));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.abs(angle) <= 4.5e+122) {
		tmp = (Math.abs(a) + Math.abs(b)) * (0.011111111111111112 * (Math.abs(angle) * (Math.PI * (Math.abs(b) - Math.abs(a)))));
	} else {
		tmp = ((1.0 + (Math.abs(a) / Math.abs(b))) * Math.abs(b)) * (0.011111111111111112 * (Math.abs(angle) * (Math.abs(b) * Math.PI)));
	}
	return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle):
	tmp = 0
	if math.fabs(angle) <= 4.5e+122:
		tmp = (math.fabs(a) + math.fabs(b)) * (0.011111111111111112 * (math.fabs(angle) * (math.pi * (math.fabs(b) - math.fabs(a)))))
	else:
		tmp = ((1.0 + (math.fabs(a) / math.fabs(b))) * math.fabs(b)) * (0.011111111111111112 * (math.fabs(angle) * (math.fabs(b) * math.pi)))
	return math.copysign(1.0, angle) * tmp
function code(a, b, angle)
	tmp = 0.0
	if (abs(angle) <= 4.5e+122)
		tmp = Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(abs(b) - abs(a))))));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(abs(a) / abs(b))) * abs(b)) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(abs(b) * pi))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (abs(angle) <= 4.5e+122)
		tmp = (abs(a) + abs(b)) * (0.011111111111111112 * (abs(angle) * (pi * (abs(b) - abs(a)))));
	else
		tmp = ((1.0 + (abs(a) / abs(b))) * abs(b)) * (0.011111111111111112 * (abs(angle) * (abs(b) * pi)));
	end
	tmp_2 = (sign(angle) * abs(1.0)) * tmp;
end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 4.5e+122], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[Abs[a], $MachinePrecision] / N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 4.5 \cdot 10^{+122}:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(\left|b\right| - \left|a\right|\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \frac{\left|a\right|}{\left|b\right|}\right) \cdot \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.49999999999999997e122

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b} - a\right)\right)\right)\right) \]
      5. lower--.f6462.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - \color{blue}{a}\right)\right)\right)\right) \]
    12. Applied rewrites62.3%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]

    if 4.49999999999999997e122 < angle

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    10. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\left(b + a\right)} \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      3. sum-to-multN/A

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

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

        \[\leadsto \left(\color{blue}{\left(1 + \frac{a}{b}\right)} \cdot b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      6. lower-unsound-/.f6442.6%

        \[\leadsto \left(\left(1 + \color{blue}{\frac{a}{b}}\right) \cdot b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    11. Applied rewrites42.6%

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

Alternative 11: 62.3% accurate, 6.6× speedup?

\[\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* (+ a b) (* 0.011111111111111112 (* angle (* PI (- b a))))))
double code(double a, double b, double angle) {
	return (a + b) * (0.011111111111111112 * (angle * (((double) M_PI) * (b - a))));
}
public static double code(double a, double b, double angle) {
	return (a + b) * (0.011111111111111112 * (angle * (Math.PI * (b - a))));
}
def code(a, b, angle):
	return (a + b) * (0.011111111111111112 * (angle * (math.pi * (b - a))))
function code(a, b, angle)
	return Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b - a)))))
end
function tmp = code(a, b, angle)
	tmp = (a + b) * (0.011111111111111112 * (angle * (pi * (b - a))));
end
code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

    \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
  4. Taylor expanded in a around 0

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  5. Step-by-step derivation
    1. lower-*.f64N/A

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

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    5. lower-PI.f6441.8%

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
  6. Applied rewrites41.8%

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  7. Taylor expanded in angle around 0

    \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
  8. Step-by-step derivation
    1. lower-*.f64N/A

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-PI.f6440.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
  9. Applied rewrites40.3%

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

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
  11. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b} - a\right)\right)\right)\right) \]
    5. lower--.f6462.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - \color{blue}{a}\right)\right)\right)\right) \]
  12. Applied rewrites62.3%

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
  13. Add Preprocessing

Alternative 12: 62.3% accurate, 6.6× speedup?

\[\left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \pi \]
(FPCore (a b angle)
 :precision binary64
 (* (* (* 0.011111111111111112 (* angle (- b a))) (+ b a)) PI))
double code(double a, double b, double angle) {
	return ((0.011111111111111112 * (angle * (b - a))) * (b + a)) * ((double) M_PI);
}
public static double code(double a, double b, double angle) {
	return ((0.011111111111111112 * (angle * (b - a))) * (b + a)) * Math.PI;
}
def code(a, b, angle):
	return ((0.011111111111111112 * (angle * (b - a))) * (b + a)) * math.pi
function code(a, b, angle)
	return Float64(Float64(Float64(0.011111111111111112 * Float64(angle * Float64(b - a))) * Float64(b + a)) * pi)
end
function tmp = code(a, b, angle)
	tmp = ((0.011111111111111112 * (angle * (b - a))) * (b + a)) * pi;
end
code[a_, b_, angle_] := N[(N[(N[(0.011111111111111112 * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]
\left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \pi
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
    7. lower-pow.f6451.3%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
  4. Applied rewrites51.3%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    6. lower-*.f6451.4%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    7. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    9. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    11. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
    12. difference-of-squares-revN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    13. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    14. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    15. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    16. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    17. lower-*.f6454.7%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    18. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    19. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    20. lower-+.f6454.7%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
  6. Applied rewrites54.7%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right) \cdot \color{blue}{\pi} \]
    5. lift-*.f64N/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right) \cdot \pi \]
    6. lift-*.f64N/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right) \cdot \pi \]
    7. associate-*r*N/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\right) \cdot \pi \]
    8. lift-+.f64N/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\right) \cdot \pi \]
    9. +-commutativeN/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \pi \]
    10. lift-+.f64N/A

      \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \pi \]
    11. associate-*r*N/A

      \[\leadsto \left(\left(\frac{1}{90} \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \pi \]
    12. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{1}{90} \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \pi \]
    13. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{1}{90} \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \pi \]
    14. lower-*.f6462.3%

      \[\leadsto \left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \pi \]
    15. lift-+.f64N/A

      \[\leadsto \left(\left(\frac{1}{90} \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \pi \]
    16. +-commutativeN/A

      \[\leadsto \left(\left(\frac{1}{90} \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \pi \]
    17. lift-+.f6462.3%

      \[\leadsto \left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \pi \]
  8. Applied rewrites62.3%

    \[\leadsto \left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(b - a\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \color{blue}{\pi} \]
  9. Add Preprocessing

Alternative 13: 62.2% accurate, 6.6× speedup?

\[0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* (* angle (- b a)) (* (+ b a) PI))))
double code(double a, double b, double angle) {
	return 0.011111111111111112 * ((angle * (b - a)) * ((b + a) * ((double) M_PI)));
}
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * ((angle * (b - a)) * ((b + a) * Math.PI));
}
def code(a, b, angle):
	return 0.011111111111111112 * ((angle * (b - a)) * ((b + a) * math.pi))
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(Float64(b + a) * pi)))
end
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * ((angle * (b - a)) * ((b + a) * pi));
end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
    7. lower-pow.f6451.3%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
  4. Applied rewrites51.3%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    6. lower-*.f6451.4%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    7. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    9. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    11. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
    12. difference-of-squares-revN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    13. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    14. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    15. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    16. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    17. lower-*.f6454.7%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    18. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    19. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    20. lower-+.f6454.7%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
  6. Applied rewrites54.7%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    3. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    4. associate-*r*N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \pi\right) \]
    5. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \pi\right) \]
    6. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right) \cdot \pi\right) \]
    7. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right) \cdot \pi\right) \]
    8. associate-*l*N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\left(a + b\right) \cdot \pi\right)}\right) \]
    10. lower-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{\left(a + b\right)} \cdot \pi\right)\right) \]
    11. lower-*.f6462.2%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(a + b\right) \cdot \color{blue}{\pi}\right)\right) \]
    12. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right) \]
    14. lift-+.f6462.2%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right) \]
  8. Applied rewrites62.2%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\left(b + a\right) \cdot \pi\right)}\right) \]
  9. Add Preprocessing

Alternative 14: 58.3% accurate, 4.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left(angle \cdot \left|b\right|\right) \cdot \pi\right)\right)\\


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

    1. Initial program 54.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6451.3%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
    4. Applied rewrites51.3%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
      6. lower-*.f6451.4%

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      8. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      9. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      10. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      11. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      13. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      14. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      15. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      16. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lower-*.f6454.7%

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      19. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.7%

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.7%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]

    if 1.72000000000000003e111 < b

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
      12. difference-of-squaresN/A

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

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in a around 0

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      5. lower-PI.f6441.8%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
    6. Applied rewrites41.8%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. lower-PI.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    9. Applied rewrites40.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(\left(angle \cdot b\right) \cdot \pi\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(\left(angle \cdot b\right) \cdot \pi\right)\right) \]
      5. lower-*.f6440.3%

        \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \pi\right)\right) \]
    11. Applied rewrites40.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \pi\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 39.8% accurate, 6.3× speedup?

\[\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| \cdot \pi\right)\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* (+ (fabs a) (fabs b)) (* 0.011111111111111112 (* angle (* (fabs b) PI)))))
double code(double a, double b, double angle) {
	return (fabs(a) + fabs(b)) * (0.011111111111111112 * (angle * (fabs(b) * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
	return (Math.abs(a) + Math.abs(b)) * (0.011111111111111112 * (angle * (Math.abs(b) * Math.PI)));
}
def code(a, b, angle):
	return (math.fabs(a) + math.fabs(b)) * (0.011111111111111112 * (angle * (math.fabs(b) * math.pi)))
function code(a, b, angle)
	return Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(angle * Float64(abs(b) * pi))))
end
function tmp = code(a, b, angle)
	tmp = (abs(a) + abs(b)) * (0.011111111111111112 * (angle * (abs(b) * pi)));
end
code[a_, b_, angle_] := N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

    \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
  4. Taylor expanded in a around 0

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  5. Step-by-step derivation
    1. lower-*.f64N/A

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

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    5. lower-PI.f6441.8%

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
  6. Applied rewrites41.8%

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  7. Taylor expanded in angle around 0

    \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
  8. Step-by-step derivation
    1. lower-*.f64N/A

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-PI.f6440.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
  9. Applied rewrites40.3%

    \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
  10. Add Preprocessing

Alternative 16: 38.6% accurate, 9.4× speedup?

\[b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* b (* 0.011111111111111112 (* angle (* b PI)))))
double code(double a, double b, double angle) {
	return b * (0.011111111111111112 * (angle * (b * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
	return b * (0.011111111111111112 * (angle * (b * Math.PI)));
}
def code(a, b, angle):
	return b * (0.011111111111111112 * (angle * (b * math.pi)))
function code(a, b, angle)
	return Float64(b * Float64(0.011111111111111112 * Float64(angle * Float64(b * pi))))
end
function tmp = code(a, b, angle)
	tmp = b * (0.011111111111111112 * (angle * (b * pi)));
end
code[a_, b_, angle_] := N[(b * N[(0.011111111111111112 * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. difference-of-squaresN/A

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

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

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

    \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]
  4. Taylor expanded in a around 0

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  5. Step-by-step derivation
    1. lower-*.f64N/A

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

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    3. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    5. lower-PI.f6441.8%

      \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right) \]
  6. Applied rewrites41.8%

    \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  7. Taylor expanded in angle around 0

    \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi\right)\right)}\right) \]
  8. Step-by-step derivation
    1. lower-*.f64N/A

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. lower-PI.f6440.3%

      \[\leadsto \left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
  9. Applied rewrites40.3%

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

    \[\leadsto \color{blue}{b} \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
  11. Step-by-step derivation
    1. Applied rewrites38.6%

      \[\leadsto \color{blue}{b} \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
    2. Add Preprocessing

    Reproduce

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