ab-angle->ABCF B

Percentage Accurate: 54.1% → 67.3%
Time: 7.4s
Alternatives: 11
Speedup: 8.4×

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 11 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.1% 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, 1.1× speedup?

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

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


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

    1. Initial program 54.1%

      \[\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--.f6458.0%

        \[\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 rewrites58.0%

      \[\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-*.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 \cos \left(\pi \cdot \frac{angle}{180}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
      3. lift-*.f64N/A

        \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
      4. lift-*.f64N/A

        \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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) \]
      5. associate-*l*N/A

        \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
      6. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\cos \left(\frac{1}{\color{blue}{\frac{\mathsf{neg}\left(180\right)}{angle \cdot \pi}}}\right) \cdot \left(b + a\right)\right) \cdot \left(\sin \left(\frac{angle \cdot \pi}{180}\right) \cdot \left(2 \cdot \left(b - a\right)\right)\right) \]
      11. metadata-eval67.3%

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

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

    if 2.0000000000000001e222 < angle

    1. Initial program 54.1%

      \[\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.9%

      \[\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)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\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 angle\right) \cdot \frac{1}{90}\right) \]
      5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.3% accurate, 1.3× speedup?

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

    \[\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--.f6458.0%

      \[\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 rewrites58.0%

    \[\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-*.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 \cos \left(\pi \cdot \frac{angle}{180}\right)} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    4. lift-*.f64N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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) \]
    5. associate-*l*N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    6. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.2% accurate, 1.3× speedup?

\[\begin{array}{l} t_0 := \left|b\right| - a\\ t_1 := a + \left|b\right|\\ \mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{+183}:\\ \;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left|angle\right|\right)\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \left|angle\right|\right) \cdot \pi\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (fabs b) a)) (t_1 (+ a (fabs b))))
   (*
    (copysign 1.0 angle)
    (if (<= (fabs angle) 5e+183)
      (*
       t_1
       (*
        t_0
        (sin
         (*
          (* (pow PI 0.6666666666666666) (* (cbrt PI) (fabs angle)))
          0.011111111111111112))))
      (* (* t_0 t_1) (sin (* (* 0.011111111111111112 (fabs angle)) PI)))))))
double code(double a, double b, double angle) {
	double t_0 = fabs(b) - a;
	double t_1 = a + fabs(b);
	double tmp;
	if (fabs(angle) <= 5e+183) {
		tmp = t_1 * (t_0 * sin(((pow(((double) M_PI), 0.6666666666666666) * (cbrt(((double) M_PI)) * fabs(angle))) * 0.011111111111111112)));
	} else {
		tmp = (t_0 * t_1) * sin(((0.011111111111111112 * fabs(angle)) * ((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) - a;
	double t_1 = a + Math.abs(b);
	double tmp;
	if (Math.abs(angle) <= 5e+183) {
		tmp = t_1 * (t_0 * Math.sin(((Math.pow(Math.PI, 0.6666666666666666) * (Math.cbrt(Math.PI) * Math.abs(angle))) * 0.011111111111111112)));
	} else {
		tmp = (t_0 * t_1) * Math.sin(((0.011111111111111112 * Math.abs(angle)) * Math.PI));
	}
	return Math.copySign(1.0, angle) * tmp;
}
function code(a, b, angle)
	t_0 = Float64(abs(b) - a)
	t_1 = Float64(a + abs(b))
	tmp = 0.0
	if (abs(angle) <= 5e+183)
		tmp = Float64(t_1 * Float64(t_0 * sin(Float64(Float64((pi ^ 0.6666666666666666) * Float64(cbrt(pi) * abs(angle))) * 0.011111111111111112))));
	else
		tmp = Float64(Float64(t_0 * t_1) * sin(Float64(Float64(0.011111111111111112 * abs(angle)) * pi)));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $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], 5e+183], N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[(N[Power[Pi, 0.6666666666666666], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{+183}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left|angle\right|\right)\right) \cdot 0.011111111111111112\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \left|angle\right|\right) \cdot \pi\right)\\


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

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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. *-commutativeN/A

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\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 angle\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 \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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(\color{blue}{{\pi}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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({\pi}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\pi}}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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({\pi}^{\frac{1}{3}} \cdot \color{blue}{{\pi}^{\frac{1}{3}}}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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(\color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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(\color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\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({\pi}^{\color{blue}{\frac{2}{3}}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot angle\right)\right) \cdot \frac{1}{90}\right)\right) \]
      14. lower-*.f64N/A

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

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

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

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

    if 5.0000000000000001e183 < angle

    1. Initial program 54.1%

      \[\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.9%

      \[\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)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\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 angle\right) \cdot \frac{1}{90}\right) \]
      5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.2% accurate, 1.3× speedup?

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

    \[\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--.f6458.0%

      \[\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 rewrites58.0%

    \[\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-*.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 \cos \left(\pi \cdot \frac{angle}{180}\right)} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    4. lift-*.f64N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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) \]
    5. associate-*l*N/A

      \[\leadsto \cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \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)} \]
    6. associate-*r*N/A

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

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

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

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

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

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

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

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

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

Alternative 5: 67.2% accurate, 2.0× speedup?

\[\begin{array}{l} t_0 := \left|b\right| - a\\ t_1 := a + \left|b\right|\\ \mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l} \mathbf{if}\;\left|angle\right| \leq 2 \cdot 10^{-9}:\\ \;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 \cdot t\_0\right) \cdot \sin \left(0.03490658503988659 \cdot \left|angle\right|\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (fabs b) a)) (t_1 (+ a (fabs b))))
   (*
    (copysign 1.0 angle)
    (if (<= (fabs angle) 2e-9)
      (* t_1 (* 0.03490658503988659 (* (fabs angle) t_0)))
      (* (* t_1 t_0) (sin (* 0.03490658503988659 (fabs angle))))))))
double code(double a, double b, double angle) {
	double t_0 = fabs(b) - a;
	double t_1 = a + fabs(b);
	double tmp;
	if (fabs(angle) <= 2e-9) {
		tmp = t_1 * (0.03490658503988659 * (fabs(angle) * t_0));
	} else {
		tmp = (t_1 * t_0) * sin((0.03490658503988659 * fabs(angle)));
	}
	return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.abs(b) - a;
	double t_1 = a + Math.abs(b);
	double tmp;
	if (Math.abs(angle) <= 2e-9) {
		tmp = t_1 * (0.03490658503988659 * (Math.abs(angle) * t_0));
	} else {
		tmp = (t_1 * t_0) * Math.sin((0.03490658503988659 * Math.abs(angle)));
	}
	return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle):
	t_0 = math.fabs(b) - a
	t_1 = a + math.fabs(b)
	tmp = 0
	if math.fabs(angle) <= 2e-9:
		tmp = t_1 * (0.03490658503988659 * (math.fabs(angle) * t_0))
	else:
		tmp = (t_1 * t_0) * math.sin((0.03490658503988659 * math.fabs(angle)))
	return math.copysign(1.0, angle) * tmp
function code(a, b, angle)
	t_0 = Float64(abs(b) - a)
	t_1 = Float64(a + abs(b))
	tmp = 0.0
	if (abs(angle) <= 2e-9)
		tmp = Float64(t_1 * Float64(0.03490658503988659 * Float64(abs(angle) * t_0)));
	else
		tmp = Float64(Float64(t_1 * t_0) * sin(Float64(0.03490658503988659 * abs(angle))));
	end
	return Float64(copysign(1.0, angle) * tmp)
end
function tmp_2 = code(a, b, angle)
	t_0 = abs(b) - a;
	t_1 = a + abs(b);
	tmp = 0.0;
	if (abs(angle) <= 2e-9)
		tmp = t_1 * (0.03490658503988659 * (abs(angle) * t_0));
	else
		tmp = (t_1 * t_0) * sin((0.03490658503988659 * abs(angle)));
	end
	tmp_2 = (sign(angle) * abs(1.0)) * tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $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], 2e-9], N[(t$95$1 * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * t$95$0), $MachinePrecision] * N[Sin[N[(0.03490658503988659 * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot t\_0\right) \cdot \sin \left(0.03490658503988659 \cdot \left|angle\right|\right)\\


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

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{5030569068109113}{144115188075855872} \cdot \left(angle \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower--.f6462.4%

        \[\leadsto \left(a + b\right) \cdot \left(0.03490658503988659 \cdot \left(angle \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    9. Applied rewrites62.4%

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

    if 2.0000000000000001e-9 < angle

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a + b\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      6. lift-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(a + b\right)} \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      7. +-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      8. lift--.f64N/A

        \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      9. difference-of-squares-revN/A

        \[\leadsto \color{blue}{\left(b \cdot b - a \cdot a\right)} \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      10. unpow2N/A

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

        \[\leadsto \left({b}^{2} - \color{blue}{{a}^{2}}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      12. lower-*.f64N/A

        \[\leadsto \color{blue}{\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right)} \]
      13. unpow2N/A

        \[\leadsto \left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      14. unpow2N/A

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      15. difference-of-squares-revN/A

        \[\leadsto \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      16. +-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(a + b\right)} \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      17. lift-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(a + b\right)} \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      18. lift--.f64N/A

        \[\leadsto \left(\left(a + b\right) \cdot \color{blue}{\left(b - a\right)}\right) \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right) \]
      19. lower-*.f6457.8%

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

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

Alternative 6: 67.1% accurate, 2.5× speedup?

\[\left(a + \left|b\right|\right) \cdot \left(\left(\left|b\right| - a\right) \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* (+ a (fabs b)) (* (- (fabs b) a) (sin (* 0.03490658503988659 angle)))))
double code(double a, double b, double angle) {
	return (a + fabs(b)) * ((fabs(b) - a) * sin((0.03490658503988659 * angle)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, angle)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = (a + abs(b)) * ((abs(b) - a) * sin((0.03490658503988659d0 * angle)))
end function
public static double code(double a, double b, double angle) {
	return (a + Math.abs(b)) * ((Math.abs(b) - a) * Math.sin((0.03490658503988659 * angle)));
}
def code(a, b, angle):
	return (a + math.fabs(b)) * ((math.fabs(b) - a) * math.sin((0.03490658503988659 * angle)))
function code(a, b, angle)
	return Float64(Float64(a + abs(b)) * Float64(Float64(abs(b) - a) * sin(Float64(0.03490658503988659 * angle))))
end
function tmp = code(a, b, angle)
	tmp = (a + abs(b)) * ((abs(b) - a) * sin((0.03490658503988659 * angle)));
end
code[a_, b_, angle_] := N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision] * N[Sin[N[(0.03490658503988659 * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(a + \left|b\right|\right) \cdot \left(\left(\left|b\right| - a\right) \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)
Derivation
  1. Initial program 54.1%

    \[\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 rewrites67.4%

    \[\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.2%

      \[\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.2%

    \[\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. Evaluated real constant67.2%

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

Alternative 7: 64.7% accurate, 2.4× speedup?

\[\begin{array}{l} t_0 := \left|b\right| - \left|a\right|\\ t_1 := \left|a\right| + \left|b\right|\\ \mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{-173}:\\ \;\;\;\;t\_1 \cdot \left(\left|b\right| \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)\\ \mathbf{elif}\;\left|a\right| \leq 1.1 \cdot 10^{+227}:\\ \;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(angle \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(t\_0 \cdot \left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{2}\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (fabs b) (fabs a))) (t_1 (+ (fabs a) (fabs b))))
   (if (<= (fabs a) 5.5e-173)
     (* t_1 (* (fabs b) (sin (* 0.03490658503988659 angle))))
     (if (<= (fabs a) 1.1e+227)
       (* t_1 (* 0.03490658503988659 (* angle t_0)))
       (*
        t_1
        (*
         t_0
         (*
          angle
          (+
           0.03490658503988659
           (* -7.088769245610384e-6 (pow angle 2.0))))))))))
double code(double a, double b, double angle) {
	double t_0 = fabs(b) - fabs(a);
	double t_1 = fabs(a) + fabs(b);
	double tmp;
	if (fabs(a) <= 5.5e-173) {
		tmp = t_1 * (fabs(b) * sin((0.03490658503988659 * angle)));
	} else if (fabs(a) <= 1.1e+227) {
		tmp = t_1 * (0.03490658503988659 * (angle * t_0));
	} else {
		tmp = t_1 * (t_0 * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * pow(angle, 2.0)))));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, angle)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = abs(b) - abs(a)
    t_1 = abs(a) + abs(b)
    if (abs(a) <= 5.5d-173) then
        tmp = t_1 * (abs(b) * sin((0.03490658503988659d0 * angle)))
    else if (abs(a) <= 1.1d+227) then
        tmp = t_1 * (0.03490658503988659d0 * (angle * t_0))
    else
        tmp = t_1 * (t_0 * (angle * (0.03490658503988659d0 + ((-7.088769245610384d-6) * (angle ** 2.0d0)))))
    end if
    code = tmp
end function
public static double code(double a, double b, double angle) {
	double t_0 = Math.abs(b) - Math.abs(a);
	double t_1 = Math.abs(a) + Math.abs(b);
	double tmp;
	if (Math.abs(a) <= 5.5e-173) {
		tmp = t_1 * (Math.abs(b) * Math.sin((0.03490658503988659 * angle)));
	} else if (Math.abs(a) <= 1.1e+227) {
		tmp = t_1 * (0.03490658503988659 * (angle * t_0));
	} else {
		tmp = t_1 * (t_0 * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * Math.pow(angle, 2.0)))));
	}
	return tmp;
}
def code(a, b, angle):
	t_0 = math.fabs(b) - math.fabs(a)
	t_1 = math.fabs(a) + math.fabs(b)
	tmp = 0
	if math.fabs(a) <= 5.5e-173:
		tmp = t_1 * (math.fabs(b) * math.sin((0.03490658503988659 * angle)))
	elif math.fabs(a) <= 1.1e+227:
		tmp = t_1 * (0.03490658503988659 * (angle * t_0))
	else:
		tmp = t_1 * (t_0 * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * math.pow(angle, 2.0)))))
	return tmp
function code(a, b, angle)
	t_0 = Float64(abs(b) - abs(a))
	t_1 = Float64(abs(a) + abs(b))
	tmp = 0.0
	if (abs(a) <= 5.5e-173)
		tmp = Float64(t_1 * Float64(abs(b) * sin(Float64(0.03490658503988659 * angle))));
	elseif (abs(a) <= 1.1e+227)
		tmp = Float64(t_1 * Float64(0.03490658503988659 * Float64(angle * t_0)));
	else
		tmp = Float64(t_1 * Float64(t_0 * Float64(angle * Float64(0.03490658503988659 + Float64(-7.088769245610384e-6 * (angle ^ 2.0))))));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	t_0 = abs(b) - abs(a);
	t_1 = abs(a) + abs(b);
	tmp = 0.0;
	if (abs(a) <= 5.5e-173)
		tmp = t_1 * (abs(b) * sin((0.03490658503988659 * angle)));
	elseif (abs(a) <= 1.1e+227)
		tmp = t_1 * (0.03490658503988659 * (angle * t_0));
	else
		tmp = t_1 * (t_0 * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * (angle ^ 2.0)))));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 5.5e-173], N[(t$95$1 * N[(N[Abs[b], $MachinePrecision] * N[Sin[N[(0.03490658503988659 * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[a], $MachinePrecision], 1.1e+227], N[(t$95$1 * N[(0.03490658503988659 * N[(angle * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(angle * N[(0.03490658503988659 + N[(-7.088769245610384e-6 * N[Power[angle, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|b\right| - \left|a\right|\\
t_1 := \left|a\right| + \left|b\right|\\
\mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{-173}:\\
\;\;\;\;t\_1 \cdot \left(\left|b\right| \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)\\

\mathbf{elif}\;\left|a\right| \leq 1.1 \cdot 10^{+227}:\\
\;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(angle \cdot t\_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{2}\right)\right)\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 5.5000000000000002e-173

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(\frac{5030569068109113}{144115188075855872} \cdot angle\right)\right) \]
      3. lower-*.f6441.4%

        \[\leadsto \left(a + b\right) \cdot \left(b \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right) \]
    9. Applied rewrites41.4%

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

    if 5.5000000000000002e-173 < a < 1.1000000000000001e227

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

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

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

        \[\leadsto \left(a + b\right) \cdot \left(\frac{5030569068109113}{144115188075855872} \cdot \left(angle \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower--.f6462.4%

        \[\leadsto \left(a + b\right) \cdot \left(0.03490658503988659 \cdot \left(angle \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    9. Applied rewrites62.4%

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

    if 1.1000000000000001e227 < a

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \color{blue}{\left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}\right)}\right)\right) \]
      2. lower-+.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \color{blue}{\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}}\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      4. lower-pow.f6461.2%

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{\color{blue}{2}}\right)\right)\right) \]
    9. Applied rewrites61.2%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{2}\right)\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 64.6% accurate, 2.1× 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 7200000000000:\\ \;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(\left|angle\right| \cdot \mathsf{fma}\left(-7.088769245610384 \cdot 10^{-6}, {\left(\left|angle\right|\right)}^{2} \cdot t\_0, 0.03490658503988659 \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \log \left(e^{\left(\pi \cdot t\_0\right) \cdot \left(\left|b\right| + \left|a\right|\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) 7200000000000.0)
      (*
       (+ (fabs a) (fabs b))
       (*
        (fabs angle)
        (fma
         -7.088769245610384e-6
         (* (pow (fabs angle) 2.0) t_0)
         (* 0.03490658503988659 t_0))))
      (*
       0.011111111111111112
       (* (fabs angle) (log (exp (* (* PI t_0) (+ (fabs b) (fabs a)))))))))))
double code(double a, double b, double angle) {
	double t_0 = fabs(b) - fabs(a);
	double tmp;
	if (fabs(angle) <= 7200000000000.0) {
		tmp = (fabs(a) + fabs(b)) * (fabs(angle) * fma(-7.088769245610384e-6, (pow(fabs(angle), 2.0) * t_0), (0.03490658503988659 * t_0)));
	} else {
		tmp = 0.011111111111111112 * (fabs(angle) * log(exp(((((double) M_PI) * t_0) * (fabs(b) + fabs(a))))));
	}
	return copysign(1.0, angle) * tmp;
}
function code(a, b, angle)
	t_0 = Float64(abs(b) - abs(a))
	tmp = 0.0
	if (abs(angle) <= 7200000000000.0)
		tmp = Float64(Float64(abs(a) + abs(b)) * Float64(abs(angle) * fma(-7.088769245610384e-6, Float64((abs(angle) ^ 2.0) * t_0), Float64(0.03490658503988659 * t_0))));
	else
		tmp = Float64(0.011111111111111112 * Float64(abs(angle) * log(exp(Float64(Float64(pi * t_0) * Float64(abs(b) + abs(a)))))));
	end
	return Float64(copysign(1.0, angle) * 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], 7200000000000.0], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[angle], $MachinePrecision] * N[(-7.088769245610384e-6 * N[(N[Power[N[Abs[angle], $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision] + N[(0.03490658503988659 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[Log[N[Exp[N[(N[(Pi * t$95$0), $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] + N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 7200000000000:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(\left|angle\right| \cdot \mathsf{fma}\left(-7.088769245610384 \cdot 10^{-6}, {\left(\left|angle\right|\right)}^{2} \cdot t\_0, 0.03490658503988659 \cdot t\_0\right)\right)\\

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


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

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot \left({angle}^{2} \cdot \left(b - a\right)\right) + \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot \left({angle}^{2} \cdot \left(b - a\right)\right) + \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)}\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696}, \color{blue}{{angle}^{2} \cdot \left(b - a\right)}, \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696}, {angle}^{2} \cdot \color{blue}{\left(b - a\right)}, \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696}, {angle}^{2} \cdot \left(\color{blue}{b} - a\right), \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696}, {angle}^{2} \cdot \left(b - \color{blue}{a}\right), \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696}, {angle}^{2} \cdot \left(b - a\right), \frac{5030569068109113}{144115188075855872} \cdot \left(b - a\right)\right)\right) \]
      7. lower--.f6461.2%

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \mathsf{fma}\left(-7.088769245610384 \cdot 10^{-6}, {angle}^{2} \cdot \left(b - a\right), 0.03490658503988659 \cdot \left(b - a\right)\right)\right) \]
    9. Applied rewrites61.2%

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \mathsf{fma}\left(-7.088769245610384 \cdot 10^{-6}, {angle}^{2} \cdot \left(b - a\right), 0.03490658503988659 \cdot \left(b - a\right)\right)\right)} \]

    if 7.2e12 < angle

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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 angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. 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(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
      2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
      4. add-log-expN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      5. log-pow-revN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)\right) \]
      6. lower-log.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left({\left(e^{\pi}\right)}^{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      15. pow-expN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left(e^{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    8. Applied rewrites35.3%

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

Alternative 9: 64.6% accurate, 2.4× speedup?

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

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


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

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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.2%

        \[\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.2%

      \[\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. Evaluated real constant67.2%

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}\right)\right)}\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \color{blue}{\left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}\right)}\right)\right) \]
      2. lower-+.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \color{blue}{\frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot {angle}^{2}}\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(\frac{5030569068109113}{144115188075855872} + \frac{-42435575230957671923257205460301610561570635299}{5986310706507378352962293074805895248510699696029696} \cdot \color{blue}{{angle}^{2}}\right)\right)\right) \]
      4. lower-pow.f6461.2%

        \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{\color{blue}{2}}\right)\right)\right) \]
    9. Applied rewrites61.2%

      \[\leadsto \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{2}\right)\right)}\right) \]

    if 7.2e12 < angle

    1. Initial program 54.1%

      \[\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 rewrites67.4%

      \[\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 angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. 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(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
      2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
      4. add-log-expN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      5. log-pow-revN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)\right) \]
      6. lower-log.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left({\left(e^{\pi}\right)}^{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      15. pow-expN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \log \left(e^{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    8. Applied rewrites35.3%

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

Alternative 10: 62.4% accurate, 7.4× speedup?

\[\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(angle \cdot \left(\left|b\right| - a\right)\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* (+ a (fabs b)) (* 0.03490658503988659 (* angle (- (fabs b) a)))))
double code(double a, double b, double angle) {
	return (a + fabs(b)) * (0.03490658503988659 * (angle * (fabs(b) - a)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, angle)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = (a + abs(b)) * (0.03490658503988659d0 * (angle * (abs(b) - a)))
end function
public static double code(double a, double b, double angle) {
	return (a + Math.abs(b)) * (0.03490658503988659 * (angle * (Math.abs(b) - a)));
}
def code(a, b, angle):
	return (a + math.fabs(b)) * (0.03490658503988659 * (angle * (math.fabs(b) - a)))
function code(a, b, angle)
	return Float64(Float64(a + abs(b)) * Float64(0.03490658503988659 * Float64(angle * Float64(abs(b) - a))))
end
function tmp = code(a, b, angle)
	tmp = (a + abs(b)) * (0.03490658503988659 * (angle * (abs(b) - a)));
end
code[a_, b_, angle_] := N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.03490658503988659 * N[(angle * N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(angle \cdot \left(\left|b\right| - a\right)\right)\right)
Derivation
  1. Initial program 54.1%

    \[\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 rewrites67.4%

    \[\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.2%

      \[\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.2%

    \[\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. Evaluated real constant67.2%

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

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\frac{5030569068109113}{144115188075855872} \cdot \left(angle \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
    3. lower--.f6462.4%

      \[\leadsto \left(a + b\right) \cdot \left(0.03490658503988659 \cdot \left(angle \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
  9. Applied rewrites62.4%

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

Alternative 11: 54.5% accurate, 8.4× speedup?

\[0.03490658503988659 \cdot \left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \]
(FPCore (a b angle)
 :precision binary64
 (* 0.03490658503988659 (* angle (* (+ a b) (- b a)))))
double code(double a, double b, double angle) {
	return 0.03490658503988659 * (angle * ((a + b) * (b - a)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, angle)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = 0.03490658503988659d0 * (angle * ((a + b) * (b - a)))
end function
public static double code(double a, double b, double angle) {
	return 0.03490658503988659 * (angle * ((a + b) * (b - a)));
}
def code(a, b, angle):
	return 0.03490658503988659 * (angle * ((a + b) * (b - a)))
function code(a, b, angle)
	return Float64(0.03490658503988659 * Float64(angle * Float64(Float64(a + b) * Float64(b - a))))
end
function tmp = code(a, b, angle)
	tmp = 0.03490658503988659 * (angle * ((a + b) * (b - a)));
end
code[a_, b_, angle_] := N[(0.03490658503988659 * N[(angle * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
0.03490658503988659 \cdot \left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)
Derivation
  1. Initial program 54.1%

    \[\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 rewrites67.4%

    \[\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.2%

      \[\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.2%

    \[\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. Evaluated real constant67.2%

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

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

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

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

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

      \[\leadsto \frac{5030569068109113}{144115188075855872} \cdot \left(angle \cdot \left(\left(a + b\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
    5. lower--.f6454.5%

      \[\leadsto 0.03490658503988659 \cdot \left(angle \cdot \left(\left(a + b\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
  9. Applied rewrites54.5%

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

Reproduce

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