inverse-phi

Percentage Accurate: 96.7% → 99.8%
Time: 6.2s
Alternatives: 21
Speedup: 0.9×

Specification

?
\[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (atan
 (/ (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt))) (* one_es sa))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)));
}
real(8) function code(lamdp, lamt, ca, one_es, sa)
use fmin_fmax_functions
    real(8), intent (in) :: lamdp
    real(8), intent (in) :: lamt
    real(8), intent (in) :: ca
    real(8), intent (in) :: one_es
    real(8), intent (in) :: sa
    code = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)))
end function
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return Math.atan((((Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt))) / (one_es * sa)));
}
def code(lamdp, lamt, ca, one_es, sa):
	return math.atan((((math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))) / (one_es * sa)))
function code(lamdp, lamt, ca, one_es, sa)
	return atan(Float64(Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt))) / Float64(one_es * sa)))
end
function tmp = code(lamdp, lamt, ca, one_es, sa)
	tmp = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)));
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
f(lamdp, lamt, ca, one_es, sa):
	lamdp in [-inf, +inf],
	lamt in [-inf, +inf],
	ca in [-inf, +inf],
	one_es in [-inf, +inf],
	sa in [-inf, +inf]
code: THEORY
BEGIN
f(lamdp, lamt, ca, one_es, sa: real): real =
	atan(((((tan(lamdp)) * (cos(lamt))) - (ca * (sin(lamt)))) / (one_es * sa)))
END code
\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)

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 21 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: 96.7% accurate, 1.0× speedup?

\[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (atan
 (/ (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt))) (* one_es sa))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)));
}
real(8) function code(lamdp, lamt, ca, one_es, sa)
use fmin_fmax_functions
    real(8), intent (in) :: lamdp
    real(8), intent (in) :: lamt
    real(8), intent (in) :: ca
    real(8), intent (in) :: one_es
    real(8), intent (in) :: sa
    code = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)))
end function
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return Math.atan((((Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt))) / (one_es * sa)));
}
def code(lamdp, lamt, ca, one_es, sa):
	return math.atan((((math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))) / (one_es * sa)))
function code(lamdp, lamt, ca, one_es, sa)
	return atan(Float64(Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt))) / Float64(one_es * sa)))
end
function tmp = code(lamdp, lamt, ca, one_es, sa)
	tmp = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / (one_es * sa)));
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
f(lamdp, lamt, ca, one_es, sa):
	lamdp in [-inf, +inf],
	lamt in [-inf, +inf],
	ca in [-inf, +inf],
	one_es in [-inf, +inf],
	sa in [-inf, +inf]
code: THEORY
BEGIN
f(lamdp, lamt, ca, one_es, sa: real): real =
	atan(((((tan(lamdp)) * (cos(lamt))) - (ca * (sin(lamt)))) / (one_es * sa)))
END code
\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)

Alternative 1: 99.8% accurate, 0.8× speedup?

\[\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \tan^{-1} \left(\frac{\sin lamt \cdot ca - \cos lamt \cdot \tan lamdp}{\mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)} \cdot \frac{-1}{\mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)}\right)\right) \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (*
 (copysign 1.0 one_es)
 (*
  (copysign 1.0 sa)
  (atan
   (*
    (/
     (- (* (sin lamt) ca) (* (cos lamt) (tan lamdp)))
     (fmin (fabs one_es) (fabs sa)))
    (/ -1.0 (fmax (fabs one_es) (fabs sa))))))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return copysign(1.0, one_es) * (copysign(1.0, sa) * atan(((((sin(lamt) * ca) - (cos(lamt) * tan(lamdp))) / fmin(fabs(one_es), fabs(sa))) * (-1.0 / fmax(fabs(one_es), fabs(sa))))));
}
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * Math.atan(((((Math.sin(lamt) * ca) - (Math.cos(lamt) * Math.tan(lamdp))) / fmin(Math.abs(one_es), Math.abs(sa))) * (-1.0 / fmax(Math.abs(one_es), Math.abs(sa))))));
}
def code(lamdp, lamt, ca, one_es, sa):
	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * math.atan(((((math.sin(lamt) * ca) - (math.cos(lamt) * math.tan(lamdp))) / fmin(math.fabs(one_es), math.fabs(sa))) * (-1.0 / fmax(math.fabs(one_es), math.fabs(sa))))))
function code(lamdp, lamt, ca, one_es, sa)
	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * atan(Float64(Float64(Float64(Float64(sin(lamt) * ca) - Float64(cos(lamt) * tan(lamdp))) / fmin(abs(one_es), abs(sa))) * Float64(-1.0 / fmax(abs(one_es), abs(sa)))))))
end
function tmp = code(lamdp, lamt, ca, one_es, sa)
	tmp = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * atan(((((sin(lamt) * ca) - (cos(lamt) * tan(lamdp))) / min(abs(one_es), abs(sa))) * (-1.0 / max(abs(one_es), abs(sa))))));
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[ArcTan[N[(N[(N[(N[(N[Sin[lamt], $MachinePrecision] * ca), $MachinePrecision] - N[(N[Cos[lamt], $MachinePrecision] * N[Tan[lamdp], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \tan^{-1} \left(\frac{\sin lamt \cdot ca - \cos lamt \cdot \tan lamdp}{\mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)} \cdot \frac{-1}{\mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)}\right)\right)
Derivation
  1. Initial program 96.7%

    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
    3. associate-/r*N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}{sa}\right)} \]
    4. frac-2negN/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)}{\mathsf{neg}\left(sa\right)}\right)} \]
    5. mult-flipN/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
    6. lower-*.f64N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
    7. distribute-neg-fracN/A

      \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    8. lower-/.f64N/A

      \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    9. lift--.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(\color{blue}{\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)}\right)}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    10. sub-negate-revN/A

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    11. lower--.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    12. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    13. *-commutativeN/A

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    14. lower-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    15. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    16. *-commutativeN/A

      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
    17. lower-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
  3. Applied rewrites97.9%

    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\sin lamt \cdot ca - \cos lamt \cdot \tan lamdp}{one\_es} \cdot \frac{-1}{sa}\right)} \]
  4. Add Preprocessing

Alternative 2: 99.8% accurate, 0.9× speedup?

\[\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp - \sin lamt \cdot ca}{\mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)}}{\mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)}\right)\right) \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (*
 (copysign 1.0 one_es)
 (*
  (copysign 1.0 sa)
  (atan
   (/
    (/
     (- (* (cos lamt) (tan lamdp)) (* (sin lamt) ca))
     (fmin (fabs one_es) (fabs sa)))
    (fmax (fabs one_es) (fabs sa)))))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return copysign(1.0, one_es) * (copysign(1.0, sa) * atan(((((cos(lamt) * tan(lamdp)) - (sin(lamt) * ca)) / fmin(fabs(one_es), fabs(sa))) / fmax(fabs(one_es), fabs(sa)))));
}
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * Math.atan(((((Math.cos(lamt) * Math.tan(lamdp)) - (Math.sin(lamt) * ca)) / fmin(Math.abs(one_es), Math.abs(sa))) / fmax(Math.abs(one_es), Math.abs(sa)))));
}
def code(lamdp, lamt, ca, one_es, sa):
	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * math.atan(((((math.cos(lamt) * math.tan(lamdp)) - (math.sin(lamt) * ca)) / fmin(math.fabs(one_es), math.fabs(sa))) / fmax(math.fabs(one_es), math.fabs(sa)))))
function code(lamdp, lamt, ca, one_es, sa)
	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * atan(Float64(Float64(Float64(Float64(cos(lamt) * tan(lamdp)) - Float64(sin(lamt) * ca)) / fmin(abs(one_es), abs(sa))) / fmax(abs(one_es), abs(sa))))))
end
function tmp = code(lamdp, lamt, ca, one_es, sa)
	tmp = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * atan(((((cos(lamt) * tan(lamdp)) - (sin(lamt) * ca)) / min(abs(one_es), abs(sa))) / max(abs(one_es), abs(sa)))));
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[ArcTan[N[(N[(N[(N[(N[Cos[lamt], $MachinePrecision] * N[Tan[lamdp], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[lamt], $MachinePrecision] * ca), $MachinePrecision]), $MachinePrecision] / N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp - \sin lamt \cdot ca}{\mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)}}{\mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)}\right)\right)
Derivation
  1. Initial program 96.7%

    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
    3. associate-/r*N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}{sa}\right)} \]
    4. lower-/.f64N/A

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}{sa}\right)} \]
    5. lower-/.f6497.9%

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}}{sa}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{\tan lamdp \cdot \cos lamt} - ca \cdot \sin lamt}{one\_es}}{sa}\right) \]
    7. *-commutativeN/A

      \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{\cos lamt \cdot \tan lamdp} - ca \cdot \sin lamt}{one\_es}}{sa}\right) \]
    8. lower-*.f6497.9%

      \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{\cos lamt \cdot \tan lamdp} - ca \cdot \sin lamt}{one\_es}}{sa}\right) \]
    9. lift-*.f64N/A

      \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp - \color{blue}{ca \cdot \sin lamt}}{one\_es}}{sa}\right) \]
    10. *-commutativeN/A

      \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp - \color{blue}{\sin lamt \cdot ca}}{one\_es}}{sa}\right) \]
    11. lower-*.f6497.9%

      \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp - \color{blue}{\sin lamt \cdot ca}}{one\_es}}{sa}\right) \]
  3. Applied rewrites97.9%

    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\cos lamt \cdot \tan lamdp - \sin lamt \cdot ca}{one\_es}}{sa}\right)} \]
  4. Add Preprocessing

Alternative 3: 98.5% accurate, 0.8× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \left(-ca\right) \cdot \sin lamt\\ t_2 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_3 := t\_2 \cdot t\_0\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_3 \leq 2 \cdot 10^{+269}:\\ \;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, t\_1\right)}{t\_3}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_0}}{t\_2}\right)\\ \end{array}\right) \end{array} \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (fmax (fabs one_es) (fabs sa)))
       (t_1 (* (- ca) (sin lamt)))
       (t_2 (fmin (fabs one_es) (fabs sa)))
       (t_3 (* t_2 t_0)))
  (*
   (copysign 1.0 one_es)
   (*
    (copysign 1.0 sa)
    (if (<= t_3 2e+269)
      (atan (/ (fma (tan lamdp) (cos lamt) t_1) t_3))
      (atan (/ (/ t_1 t_0) t_2)))))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	double t_0 = fmax(fabs(one_es), fabs(sa));
	double t_1 = -ca * sin(lamt);
	double t_2 = fmin(fabs(one_es), fabs(sa));
	double t_3 = t_2 * t_0;
	double tmp;
	if (t_3 <= 2e+269) {
		tmp = atan((fma(tan(lamdp), cos(lamt), t_1) / t_3));
	} else {
		tmp = atan(((t_1 / t_0) / t_2));
	}
	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
}
function code(lamdp, lamt, ca, one_es, sa)
	t_0 = fmax(abs(one_es), abs(sa))
	t_1 = Float64(Float64(-ca) * sin(lamt))
	t_2 = fmin(abs(one_es), abs(sa))
	t_3 = Float64(t_2 * t_0)
	tmp = 0.0
	if (t_3 <= 2e+269)
		tmp = atan(Float64(fma(tan(lamdp), cos(lamt), t_1) / t_3));
	else
		tmp = atan(Float64(Float64(t_1 / t_0) / t_2));
	end
	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$0), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, 2e+269], N[ArcTan[N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[(t$95$1 / t$95$0), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_1 := \left(-ca\right) \cdot \sin lamt\\
t_2 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_3 := t\_2 \cdot t\_0\\
\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;\tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, t\_1\right)}{t\_3}\right)\\

\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_0}}{t\_2}\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 one_es sa) < 2.0000000000000001e269

    1. Initial program 96.7%

      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}}{one\_es \cdot sa}\right) \]
      2. sub-flipN/A

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\tan lamdp \cdot \cos lamt + \left(\mathsf{neg}\left(ca \cdot \sin lamt\right)\right)}}{one\_es \cdot sa}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\tan lamdp \cdot \cos lamt} + \left(\mathsf{neg}\left(ca \cdot \sin lamt\right)\right)}{one\_es \cdot sa}\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\mathsf{fma}\left(\tan lamdp, \cos lamt, \mathsf{neg}\left(ca \cdot \sin lamt\right)\right)}}{one\_es \cdot sa}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, \mathsf{neg}\left(\color{blue}{ca \cdot \sin lamt}\right)\right)}{one\_es \cdot sa}\right) \]
      6. distribute-lft-neg-outN/A

        \[\leadsto \tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, \color{blue}{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin lamt}\right)}{one\_es \cdot sa}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, \color{blue}{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin lamt}\right)}{one\_es \cdot sa}\right) \]
      8. lower-neg.f6496.7%

        \[\leadsto \tan^{-1} \left(\frac{\mathsf{fma}\left(\tan lamdp, \cos lamt, \color{blue}{\left(-ca\right)} \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
    3. Applied rewrites96.7%

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\mathsf{fma}\left(\tan lamdp, \cos lamt, \left(-ca\right) \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]

    if 2.0000000000000001e269 < (*.f64 one_es sa)

    1. Initial program 96.7%

      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    2. Taylor expanded in lamdp around 0

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
      3. lower-sin.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
    4. Applied rewrites61.9%

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
      2. mult-flipN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
      3. *-commutativeN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
      5. lower-/.f6461.9%

        \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      8. lower-*.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      9. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
      10. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
      14. lower-neg.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
    6. Applied rewrites61.9%

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
      3. lift-/.f64N/A

        \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
      4. mult-flip-revN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
      6. associate-/r*N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
      8. lower-/.f6464.2%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
    8. Applied rewrites64.2%

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 98.5% accurate, 0.8× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_2 := t\_1 \cdot t\_0\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 2 \cdot 10^{+269}:\\ \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_0}}{t\_1}\right)\\ \end{array}\right) \end{array} \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (fmax (fabs one_es) (fabs sa)))
       (t_1 (fmin (fabs one_es) (fabs sa)))
       (t_2 (* t_1 t_0)))
  (*
   (copysign 1.0 one_es)
   (*
    (copysign 1.0 sa)
    (if (<= t_2 2e+269)
      (atan (/ (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt))) t_2))
      (atan (/ (/ (* (- ca) (sin lamt)) t_0) t_1)))))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	double t_0 = fmax(fabs(one_es), fabs(sa));
	double t_1 = fmin(fabs(one_es), fabs(sa));
	double t_2 = t_1 * t_0;
	double tmp;
	if (t_2 <= 2e+269) {
		tmp = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / t_2));
	} else {
		tmp = atan((((-ca * sin(lamt)) / t_0) / t_1));
	}
	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
}
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	double t_0 = fmax(Math.abs(one_es), Math.abs(sa));
	double t_1 = fmin(Math.abs(one_es), Math.abs(sa));
	double t_2 = t_1 * t_0;
	double tmp;
	if (t_2 <= 2e+269) {
		tmp = Math.atan((((Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt))) / t_2));
	} else {
		tmp = Math.atan((((-ca * Math.sin(lamt)) / t_0) / t_1));
	}
	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
}
def code(lamdp, lamt, ca, one_es, sa):
	t_0 = fmax(math.fabs(one_es), math.fabs(sa))
	t_1 = fmin(math.fabs(one_es), math.fabs(sa))
	t_2 = t_1 * t_0
	tmp = 0
	if t_2 <= 2e+269:
		tmp = math.atan((((math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))) / t_2))
	else:
		tmp = math.atan((((-ca * math.sin(lamt)) / t_0) / t_1))
	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
function code(lamdp, lamt, ca, one_es, sa)
	t_0 = fmax(abs(one_es), abs(sa))
	t_1 = fmin(abs(one_es), abs(sa))
	t_2 = Float64(t_1 * t_0)
	tmp = 0.0
	if (t_2 <= 2e+269)
		tmp = atan(Float64(Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt))) / t_2));
	else
		tmp = atan(Float64(Float64(Float64(Float64(-ca) * sin(lamt)) / t_0) / t_1));
	end
	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
end
function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
	t_0 = max(abs(one_es), abs(sa));
	t_1 = min(abs(one_es), abs(sa));
	t_2 = t_1 * t_0;
	tmp = 0.0;
	if (t_2 <= 2e+269)
		tmp = atan((((tan(lamdp) * cos(lamt)) - (ca * sin(lamt))) / t_2));
	else
		tmp = atan((((-ca * sin(lamt)) / t_0) / t_1));
	end
	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$0), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, 2e+269], N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[(N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_1 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_2 := t\_1 \cdot t\_0\\
\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{t\_2}\right)\\

\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_0}}{t\_1}\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 one_es sa) < 2.0000000000000001e269

    1. Initial program 96.7%

      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]

    if 2.0000000000000001e269 < (*.f64 one_es sa)

    1. Initial program 96.7%

      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    2. Taylor expanded in lamdp around 0

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
      3. lower-sin.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
    4. Applied rewrites61.9%

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
      2. mult-flipN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
      3. *-commutativeN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
      5. lower-/.f6461.9%

        \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      8. lower-*.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
      9. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
      10. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
      14. lower-neg.f6461.9%

        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
    6. Applied rewrites61.9%

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
      3. lift-/.f64N/A

        \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
      4. mult-flip-revN/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
      6. associate-/r*N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
      8. lower-/.f6464.2%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
    8. Applied rewrites64.2%

      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 97.2% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := ca \cdot \sin lamt\\ t_2 := \tan lamdp \cdot \cos lamt - t\_1\\ t_3 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_4 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_3}\right)\\ t_5 := \tan^{-1} \left(\frac{\frac{1 \cdot \tan lamdp - \sin lamt \cdot ca}{t\_3}}{t\_0}\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -50000:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_2 \leq -0.09:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt - t\_1}{t\_0 \cdot t\_3}\right)\\ \mathbf{elif}\;t\_2 \leq 0.48:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \end{array}\right) \end{array} \]
(FPCore (lamdp lamt ca one_es sa)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
       (t_1 (* ca (sin lamt)))
       (t_2 (- (* (tan lamdp) (cos lamt)) t_1))
       (t_3 (fmax (fabs one_es) (fabs sa)))
       (t_4 (atan (/ (* (cos lamt) (/ (tan lamdp) t_0)) t_3)))
       (t_5
        (atan
         (/ (/ (- (* 1.0 (tan lamdp)) (* (sin lamt) ca)) t_3) t_0))))
  (*
   (copysign 1.0 one_es)
   (*
    (copysign 1.0 sa)
    (if (<= t_2 -50000.0)
      t_5
      (if (<= t_2 -0.09)
        t_4
        (if (<= t_2 5e-10)
          (atan (/ (- (* lamdp (cos lamt)) t_1) (* t_0 t_3)))
          (if (<= t_2 0.48) t_4 t_5))))))))
double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	double t_0 = fmin(fabs(one_es), fabs(sa));
	double t_1 = ca * sin(lamt);
	double t_2 = (tan(lamdp) * cos(lamt)) - t_1;
	double t_3 = fmax(fabs(one_es), fabs(sa));
	double t_4 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_3));
	double t_5 = atan(((((1.0 * tan(lamdp)) - (sin(lamt) * ca)) / t_3) / t_0));
	double tmp;
	if (t_2 <= -50000.0) {
		tmp = t_5;
	} else if (t_2 <= -0.09) {
		tmp = t_4;
	} else if (t_2 <= 5e-10) {
		tmp = atan((((lamdp * cos(lamt)) - t_1) / (t_0 * t_3)));
	} else if (t_2 <= 0.48) {
		tmp = t_4;
	} else {
		tmp = t_5;
	}
	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
}
public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
	double t_1 = ca * Math.sin(lamt);
	double t_2 = (Math.tan(lamdp) * Math.cos(lamt)) - t_1;
	double t_3 = fmax(Math.abs(one_es), Math.abs(sa));
	double t_4 = Math.atan(((Math.cos(lamt) * (Math.tan(lamdp) / t_0)) / t_3));
	double t_5 = Math.atan(((((1.0 * Math.tan(lamdp)) - (Math.sin(lamt) * ca)) / t_3) / t_0));
	double tmp;
	if (t_2 <= -50000.0) {
		tmp = t_5;
	} else if (t_2 <= -0.09) {
		tmp = t_4;
	} else if (t_2 <= 5e-10) {
		tmp = Math.atan((((lamdp * Math.cos(lamt)) - t_1) / (t_0 * t_3)));
	} else if (t_2 <= 0.48) {
		tmp = t_4;
	} else {
		tmp = t_5;
	}
	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
}
def code(lamdp, lamt, ca, one_es, sa):
	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
	t_1 = ca * math.sin(lamt)
	t_2 = (math.tan(lamdp) * math.cos(lamt)) - t_1
	t_3 = fmax(math.fabs(one_es), math.fabs(sa))
	t_4 = math.atan(((math.cos(lamt) * (math.tan(lamdp) / t_0)) / t_3))
	t_5 = math.atan(((((1.0 * math.tan(lamdp)) - (math.sin(lamt) * ca)) / t_3) / t_0))
	tmp = 0
	if t_2 <= -50000.0:
		tmp = t_5
	elif t_2 <= -0.09:
		tmp = t_4
	elif t_2 <= 5e-10:
		tmp = math.atan((((lamdp * math.cos(lamt)) - t_1) / (t_0 * t_3)))
	elif t_2 <= 0.48:
		tmp = t_4
	else:
		tmp = t_5
	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
function code(lamdp, lamt, ca, one_es, sa)
	t_0 = fmin(abs(one_es), abs(sa))
	t_1 = Float64(ca * sin(lamt))
	t_2 = Float64(Float64(tan(lamdp) * cos(lamt)) - t_1)
	t_3 = fmax(abs(one_es), abs(sa))
	t_4 = atan(Float64(Float64(cos(lamt) * Float64(tan(lamdp) / t_0)) / t_3))
	t_5 = atan(Float64(Float64(Float64(Float64(1.0 * tan(lamdp)) - Float64(sin(lamt) * ca)) / t_3) / t_0))
	tmp = 0.0
	if (t_2 <= -50000.0)
		tmp = t_5;
	elseif (t_2 <= -0.09)
		tmp = t_4;
	elseif (t_2 <= 5e-10)
		tmp = atan(Float64(Float64(Float64(lamdp * cos(lamt)) - t_1) / Float64(t_0 * t_3)));
	elseif (t_2 <= 0.48)
		tmp = t_4;
	else
		tmp = t_5;
	end
	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
end
function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
	t_0 = min(abs(one_es), abs(sa));
	t_1 = ca * sin(lamt);
	t_2 = (tan(lamdp) * cos(lamt)) - t_1;
	t_3 = max(abs(one_es), abs(sa));
	t_4 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_3));
	t_5 = atan(((((1.0 * tan(lamdp)) - (sin(lamt) * ca)) / t_3) / t_0));
	tmp = 0.0;
	if (t_2 <= -50000.0)
		tmp = t_5;
	elseif (t_2 <= -0.09)
		tmp = t_4;
	elseif (t_2 <= 5e-10)
		tmp = atan((((lamdp * cos(lamt)) - t_1) / (t_0 * t_3)));
	elseif (t_2 <= 0.48)
		tmp = t_4;
	else
		tmp = t_5;
	end
	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
end
code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[(N[Cos[lamt], $MachinePrecision] * N[(N[Tan[lamdp], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[ArcTan[N[(N[(N[(N[(1.0 * N[Tan[lamdp], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[lamt], $MachinePrecision] * ca), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, -50000.0], t$95$5, If[LessEqual[t$95$2, -0.09], t$95$4, If[LessEqual[t$95$2, 5e-10], N[ArcTan[N[(N[(N[(lamdp * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 0.48], t$95$4, t$95$5]]]]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_1 := ca \cdot \sin lamt\\
t_2 := \tan lamdp \cdot \cos lamt - t\_1\\
t_3 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
t_4 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_3}\right)\\
t_5 := \tan^{-1} \left(\frac{\frac{1 \cdot \tan lamdp - \sin lamt \cdot ca}{t\_3}}{t\_0}\right)\\
\mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -50000:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;t\_2 \leq -0.09:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt - t\_1}{t\_0 \cdot t\_3}\right)\\

\mathbf{elif}\;t\_2 \leq 0.48:\\
\;\;\;\;t\_4\\

\mathbf{else}:\\
\;\;\;\;t\_5\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4 or 0.47999999999999998 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

    1. Initial program 96.7%

      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    2. Taylor expanded in lamt around 0

      \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    3. Step-by-step derivation
      1. Applied rewrites86.0%

        \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{one\_es \cdot sa}\right)} \]
        2. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
        3. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
        4. associate-/r*N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        6. lower-/.f6487.6%

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\tan lamdp \cdot 1 - ca \cdot \sin lamt}{sa}}}{one\_es}\right) \]
        7. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{\tan lamdp \cdot 1} - ca \cdot \sin lamt}{sa}}{one\_es}\right) \]
        8. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{1 \cdot \tan lamdp} - ca \cdot \sin lamt}{sa}}{one\_es}\right) \]
        9. lower-*.f6487.6%

          \[\leadsto \tan^{-1} \left(\frac{\frac{\color{blue}{1 \cdot \tan lamdp} - ca \cdot \sin lamt}{sa}}{one\_es}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{1 \cdot \tan lamdp - \color{blue}{ca \cdot \sin lamt}}{sa}}{one\_es}\right) \]
        11. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{1 \cdot \tan lamdp - \color{blue}{\sin lamt \cdot ca}}{sa}}{one\_es}\right) \]
        12. lift-*.f6487.6%

          \[\leadsto \tan^{-1} \left(\frac{\frac{1 \cdot \tan lamdp - \color{blue}{\sin lamt \cdot ca}}{sa}}{one\_es}\right) \]
      3. Applied rewrites87.6%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{1 \cdot \tan lamdp - \sin lamt \cdot ca}{sa}}{one\_es}\right)} \]

      if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -0.089999999999999997 or 5.0000000000000003e-10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 0.47999999999999998

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in ca around 0

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lower-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        4. lower-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        5. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        6. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
        7. lower-cos.f6463.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
      4. Applied rewrites63.7%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        4. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
        6. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
        7. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
        8. lift-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        9. lift-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        10. tan-quotN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        11. lift-tan.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        12. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
        13. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es} \cdot sa}\right) \]
        14. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        15. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        16. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{sa}\right) \]
        17. associate-/l*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        18. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        19. lower-/.f6462.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
      6. Applied rewrites62.7%

        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]

      if -0.089999999999999997 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000003e-10

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamdp around 0

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{lamdp \cdot \cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \color{blue}{\cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. lower-cos.f6471.6%

          \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      4. Applied rewrites71.6%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{lamdp \cdot \cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 6: 96.5% accurate, 0.2× speedup?

    \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \left(-ca\right) \cdot \sin lamt\\ t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_3 := ca \cdot \sin lamt\\ t_4 := \tan lamdp \cdot \cos lamt - t\_3\\ t_5 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_2}\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -50000:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\ \mathbf{elif}\;t\_4 \leq -0.09:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt - t\_3}{t\_0 \cdot t\_2}\right)\\ \mathbf{elif}\;t\_4 \leq 10:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\ \end{array}\right) \end{array} \]
    (FPCore (lamdp lamt ca one_es sa)
      :precision binary64
      :pre TRUE
      (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
           (t_1 (* (- ca) (sin lamt)))
           (t_2 (fmax (fabs one_es) (fabs sa)))
           (t_3 (* ca (sin lamt)))
           (t_4 (- (* (tan lamdp) (cos lamt)) t_3))
           (t_5 (atan (/ (* (cos lamt) (/ (tan lamdp) t_0)) t_2))))
      (*
       (copysign 1.0 one_es)
       (*
        (copysign 1.0 sa)
        (if (<= t_4 -50000.0)
          (atan (/ (/ t_1 t_2) t_0))
          (if (<= t_4 -0.09)
            t_5
            (if (<= t_4 5e-10)
              (atan (/ (- (* lamdp (cos lamt)) t_3) (* t_0 t_2)))
              (if (<= t_4 10.0)
                t_5
                (atan (/ 1.0 (/ t_2 (/ t_1 t_0))))))))))))
    double code(double lamdp, double lamt, double ca, double one_es, double sa) {
    	double t_0 = fmin(fabs(one_es), fabs(sa));
    	double t_1 = -ca * sin(lamt);
    	double t_2 = fmax(fabs(one_es), fabs(sa));
    	double t_3 = ca * sin(lamt);
    	double t_4 = (tan(lamdp) * cos(lamt)) - t_3;
    	double t_5 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_2));
    	double tmp;
    	if (t_4 <= -50000.0) {
    		tmp = atan(((t_1 / t_2) / t_0));
    	} else if (t_4 <= -0.09) {
    		tmp = t_5;
    	} else if (t_4 <= 5e-10) {
    		tmp = atan((((lamdp * cos(lamt)) - t_3) / (t_0 * t_2)));
    	} else if (t_4 <= 10.0) {
    		tmp = t_5;
    	} else {
    		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
    	}
    	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
    }
    
    public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
    	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
    	double t_1 = -ca * Math.sin(lamt);
    	double t_2 = fmax(Math.abs(one_es), Math.abs(sa));
    	double t_3 = ca * Math.sin(lamt);
    	double t_4 = (Math.tan(lamdp) * Math.cos(lamt)) - t_3;
    	double t_5 = Math.atan(((Math.cos(lamt) * (Math.tan(lamdp) / t_0)) / t_2));
    	double tmp;
    	if (t_4 <= -50000.0) {
    		tmp = Math.atan(((t_1 / t_2) / t_0));
    	} else if (t_4 <= -0.09) {
    		tmp = t_5;
    	} else if (t_4 <= 5e-10) {
    		tmp = Math.atan((((lamdp * Math.cos(lamt)) - t_3) / (t_0 * t_2)));
    	} else if (t_4 <= 10.0) {
    		tmp = t_5;
    	} else {
    		tmp = Math.atan((1.0 / (t_2 / (t_1 / t_0))));
    	}
    	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
    }
    
    def code(lamdp, lamt, ca, one_es, sa):
    	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
    	t_1 = -ca * math.sin(lamt)
    	t_2 = fmax(math.fabs(one_es), math.fabs(sa))
    	t_3 = ca * math.sin(lamt)
    	t_4 = (math.tan(lamdp) * math.cos(lamt)) - t_3
    	t_5 = math.atan(((math.cos(lamt) * (math.tan(lamdp) / t_0)) / t_2))
    	tmp = 0
    	if t_4 <= -50000.0:
    		tmp = math.atan(((t_1 / t_2) / t_0))
    	elif t_4 <= -0.09:
    		tmp = t_5
    	elif t_4 <= 5e-10:
    		tmp = math.atan((((lamdp * math.cos(lamt)) - t_3) / (t_0 * t_2)))
    	elif t_4 <= 10.0:
    		tmp = t_5
    	else:
    		tmp = math.atan((1.0 / (t_2 / (t_1 / t_0))))
    	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
    
    function code(lamdp, lamt, ca, one_es, sa)
    	t_0 = fmin(abs(one_es), abs(sa))
    	t_1 = Float64(Float64(-ca) * sin(lamt))
    	t_2 = fmax(abs(one_es), abs(sa))
    	t_3 = Float64(ca * sin(lamt))
    	t_4 = Float64(Float64(tan(lamdp) * cos(lamt)) - t_3)
    	t_5 = atan(Float64(Float64(cos(lamt) * Float64(tan(lamdp) / t_0)) / t_2))
    	tmp = 0.0
    	if (t_4 <= -50000.0)
    		tmp = atan(Float64(Float64(t_1 / t_2) / t_0));
    	elseif (t_4 <= -0.09)
    		tmp = t_5;
    	elseif (t_4 <= 5e-10)
    		tmp = atan(Float64(Float64(Float64(lamdp * cos(lamt)) - t_3) / Float64(t_0 * t_2)));
    	elseif (t_4 <= 10.0)
    		tmp = t_5;
    	else
    		tmp = atan(Float64(1.0 / Float64(t_2 / Float64(t_1 / t_0))));
    	end
    	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
    end
    
    function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
    	t_0 = min(abs(one_es), abs(sa));
    	t_1 = -ca * sin(lamt);
    	t_2 = max(abs(one_es), abs(sa));
    	t_3 = ca * sin(lamt);
    	t_4 = (tan(lamdp) * cos(lamt)) - t_3;
    	t_5 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_2));
    	tmp = 0.0;
    	if (t_4 <= -50000.0)
    		tmp = atan(((t_1 / t_2) / t_0));
    	elseif (t_4 <= -0.09)
    		tmp = t_5;
    	elseif (t_4 <= 5e-10)
    		tmp = atan((((lamdp * cos(lamt)) - t_3) / (t_0 * t_2)));
    	elseif (t_4 <= 10.0)
    		tmp = t_5;
    	else
    		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
    	end
    	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
    end
    
    code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[ArcTan[N[(N[(N[Cos[lamt], $MachinePrecision] * N[(N[Tan[lamdp], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -50000.0], N[ArcTan[N[(N[(t$95$1 / t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, -0.09], t$95$5, If[LessEqual[t$95$4, 5e-10], N[ArcTan[N[(N[(N[(lamdp * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision] / N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 10.0], t$95$5, N[ArcTan[N[(1.0 / N[(t$95$2 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
    t_1 := \left(-ca\right) \cdot \sin lamt\\
    t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
    t_3 := ca \cdot \sin lamt\\
    t_4 := \tan lamdp \cdot \cos lamt - t\_3\\
    t_5 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_2}\right)\\
    \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
    \mathbf{if}\;t\_4 \leq -50000:\\
    \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\
    
    \mathbf{elif}\;t\_4 \leq -0.09:\\
    \;\;\;\;t\_5\\
    
    \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-10}:\\
    \;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt - t\_3}{t\_0 \cdot t\_2}\right)\\
    
    \mathbf{elif}\;t\_4 \leq 10:\\
    \;\;\;\;t\_5\\
    
    \mathbf{else}:\\
    \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\
    
    
    \end{array}\right)
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamdp around 0

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
        3. lower-sin.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
      4. Applied rewrites61.9%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
        2. mult-flipN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
        3. *-commutativeN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
        5. lower-/.f6461.9%

          \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        6. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        8. lower-*.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        9. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
        10. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
        11. associate-*r*N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
        13. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
        14. lower-neg.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
      6. Applied rewrites61.9%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
        2. *-commutativeN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
        3. lift-/.f64N/A

          \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
        4. mult-flip-revN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
        5. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
        6. associate-/r*N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        7. lower-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        8. lower-/.f6464.2%

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
      8. Applied rewrites64.2%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

      if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -0.089999999999999997 or 5.0000000000000003e-10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in ca around 0

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lower-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        4. lower-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        5. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        6. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
        7. lower-cos.f6463.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
      4. Applied rewrites63.7%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        4. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
        6. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
        7. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
        8. lift-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        9. lift-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        10. tan-quotN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        11. lift-tan.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        12. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
        13. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es} \cdot sa}\right) \]
        14. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        15. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        16. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{sa}\right) \]
        17. associate-/l*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        18. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        19. lower-/.f6462.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
      6. Applied rewrites62.7%

        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]

      if -0.089999999999999997 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000003e-10

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamdp around 0

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{lamdp \cdot \cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \color{blue}{\cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. lower-cos.f6471.6%

          \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      4. Applied rewrites71.6%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{lamdp \cdot \cos lamt} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]

      if 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamdp around 0

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
        3. lower-sin.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
      4. Applied rewrites61.9%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
        2. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
        3. associate-/r*N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
        4. div-flipN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
        5. remove-sound-/N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
        6. lower-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
        7. remove-sound-/N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
        8. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
        9. lower-/.f6463.9%

          \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
      6. Applied rewrites63.9%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
    3. Recombined 4 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 90.1% accurate, 0.2× speedup?

    \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \left(-ca\right) \cdot \sin lamt\\ t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_3 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_2}\right)\\ t_4 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -50000:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\ \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-156}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{t\_0 \cdot t\_2}\right)\\ \mathbf{elif}\;t\_4 \leq 10:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\ \end{array}\right) \end{array} \]
    (FPCore (lamdp lamt ca one_es sa)
      :precision binary64
      :pre TRUE
      (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
           (t_1 (* (- ca) (sin lamt)))
           (t_2 (fmax (fabs one_es) (fabs sa)))
           (t_3 (atan (/ (* (cos lamt) (/ (tan lamdp) t_0)) t_2)))
           (t_4 (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt)))))
      (*
       (copysign 1.0 one_es)
       (*
        (copysign 1.0 sa)
        (if (<= t_4 -50000.0)
          (atan (/ (/ t_1 t_2) t_0))
          (if (<= t_4 5e-156)
            t_3
            (if (<= t_4 5e-10)
              (atan (/ (- (* (tan lamdp) 1.0) (* ca lamt)) (* t_0 t_2)))
              (if (<= t_4 10.0)
                t_3
                (atan (/ 1.0 (/ t_2 (/ t_1 t_0))))))))))))
    double code(double lamdp, double lamt, double ca, double one_es, double sa) {
    	double t_0 = fmin(fabs(one_es), fabs(sa));
    	double t_1 = -ca * sin(lamt);
    	double t_2 = fmax(fabs(one_es), fabs(sa));
    	double t_3 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_2));
    	double t_4 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
    	double tmp;
    	if (t_4 <= -50000.0) {
    		tmp = atan(((t_1 / t_2) / t_0));
    	} else if (t_4 <= 5e-156) {
    		tmp = t_3;
    	} else if (t_4 <= 5e-10) {
    		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (t_0 * t_2)));
    	} else if (t_4 <= 10.0) {
    		tmp = t_3;
    	} else {
    		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
    	}
    	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
    }
    
    public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
    	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
    	double t_1 = -ca * Math.sin(lamt);
    	double t_2 = fmax(Math.abs(one_es), Math.abs(sa));
    	double t_3 = Math.atan(((Math.cos(lamt) * (Math.tan(lamdp) / t_0)) / t_2));
    	double t_4 = (Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt));
    	double tmp;
    	if (t_4 <= -50000.0) {
    		tmp = Math.atan(((t_1 / t_2) / t_0));
    	} else if (t_4 <= 5e-156) {
    		tmp = t_3;
    	} else if (t_4 <= 5e-10) {
    		tmp = Math.atan((((Math.tan(lamdp) * 1.0) - (ca * lamt)) / (t_0 * t_2)));
    	} else if (t_4 <= 10.0) {
    		tmp = t_3;
    	} else {
    		tmp = Math.atan((1.0 / (t_2 / (t_1 / t_0))));
    	}
    	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
    }
    
    def code(lamdp, lamt, ca, one_es, sa):
    	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
    	t_1 = -ca * math.sin(lamt)
    	t_2 = fmax(math.fabs(one_es), math.fabs(sa))
    	t_3 = math.atan(((math.cos(lamt) * (math.tan(lamdp) / t_0)) / t_2))
    	t_4 = (math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))
    	tmp = 0
    	if t_4 <= -50000.0:
    		tmp = math.atan(((t_1 / t_2) / t_0))
    	elif t_4 <= 5e-156:
    		tmp = t_3
    	elif t_4 <= 5e-10:
    		tmp = math.atan((((math.tan(lamdp) * 1.0) - (ca * lamt)) / (t_0 * t_2)))
    	elif t_4 <= 10.0:
    		tmp = t_3
    	else:
    		tmp = math.atan((1.0 / (t_2 / (t_1 / t_0))))
    	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
    
    function code(lamdp, lamt, ca, one_es, sa)
    	t_0 = fmin(abs(one_es), abs(sa))
    	t_1 = Float64(Float64(-ca) * sin(lamt))
    	t_2 = fmax(abs(one_es), abs(sa))
    	t_3 = atan(Float64(Float64(cos(lamt) * Float64(tan(lamdp) / t_0)) / t_2))
    	t_4 = Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt)))
    	tmp = 0.0
    	if (t_4 <= -50000.0)
    		tmp = atan(Float64(Float64(t_1 / t_2) / t_0));
    	elseif (t_4 <= 5e-156)
    		tmp = t_3;
    	elseif (t_4 <= 5e-10)
    		tmp = atan(Float64(Float64(Float64(tan(lamdp) * 1.0) - Float64(ca * lamt)) / Float64(t_0 * t_2)));
    	elseif (t_4 <= 10.0)
    		tmp = t_3;
    	else
    		tmp = atan(Float64(1.0 / Float64(t_2 / Float64(t_1 / t_0))));
    	end
    	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
    end
    
    function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
    	t_0 = min(abs(one_es), abs(sa));
    	t_1 = -ca * sin(lamt);
    	t_2 = max(abs(one_es), abs(sa));
    	t_3 = atan(((cos(lamt) * (tan(lamdp) / t_0)) / t_2));
    	t_4 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
    	tmp = 0.0;
    	if (t_4 <= -50000.0)
    		tmp = atan(((t_1 / t_2) / t_0));
    	elseif (t_4 <= 5e-156)
    		tmp = t_3;
    	elseif (t_4 <= 5e-10)
    		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (t_0 * t_2)));
    	elseif (t_4 <= 10.0)
    		tmp = t_3;
    	else
    		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
    	end
    	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
    end
    
    code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(N[Cos[lamt], $MachinePrecision] * N[(N[Tan[lamdp], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -50000.0], N[ArcTan[N[(N[(t$95$1 / t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 5e-156], t$95$3, If[LessEqual[t$95$4, 5e-10], N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * 1.0), $MachinePrecision] - N[(ca * lamt), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 10.0], t$95$3, N[ArcTan[N[(1.0 / N[(t$95$2 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
    t_1 := \left(-ca\right) \cdot \sin lamt\\
    t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
    t_3 := \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{t\_0}}{t\_2}\right)\\
    t_4 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\
    \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
    \mathbf{if}\;t\_4 \leq -50000:\\
    \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\
    
    \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-156}:\\
    \;\;\;\;t\_3\\
    
    \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-10}:\\
    \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{t\_0 \cdot t\_2}\right)\\
    
    \mathbf{elif}\;t\_4 \leq 10:\\
    \;\;\;\;t\_3\\
    
    \mathbf{else}:\\
    \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\
    
    
    \end{array}\right)
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamdp around 0

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
        3. lower-sin.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
      4. Applied rewrites61.9%

        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
        2. mult-flipN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
        3. *-commutativeN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
        5. lower-/.f6461.9%

          \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        6. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        8. lower-*.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
        9. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
        10. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
        11. associate-*r*N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
        13. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
        14. lower-neg.f6461.9%

          \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
      6. Applied rewrites61.9%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
        2. *-commutativeN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
        3. lift-/.f64N/A

          \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
        4. mult-flip-revN/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
        5. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
        6. associate-/r*N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        7. lower-/.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
        8. lower-/.f6464.2%

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
      8. Applied rewrites64.2%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

      if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000001e-156 or 5.0000000000000003e-10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in ca around 0

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lower-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        4. lower-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        5. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        6. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
        7. lower-cos.f6463.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
      4. Applied rewrites63.7%

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        3. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
        4. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
        6. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
        7. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
        8. lift-sin.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        9. lift-cos.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
        10. tan-quotN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        11. lift-tan.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
        12. times-fracN/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
        13. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es} \cdot sa}\right) \]
        14. associate-/r*N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        15. lower-/.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]
        16. lift-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\frac{\cos lamt \cdot \tan lamdp}{one\_es}}{sa}\right) \]
        17. associate-/l*N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        18. lower-*.f64N/A

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
        19. lower-/.f6462.7%

          \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{sa}\right) \]
      6. Applied rewrites62.7%

        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \frac{\tan lamdp}{one\_es}}{\color{blue}{sa}}\right) \]

      if 5.0000000000000001e-156 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000003e-10

      1. Initial program 96.7%

        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      2. Taylor expanded in lamt around 0

        \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
      3. Step-by-step derivation
        1. Applied rewrites86.0%

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. Taylor expanded in lamt around 0

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]
        3. Step-by-step derivation
          1. lower-*.f6467.2%

            \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \color{blue}{lamt}}{one\_es \cdot sa}\right) \]
        4. Applied rewrites67.2%

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]

        if 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

        1. Initial program 96.7%

          \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. Taylor expanded in lamdp around 0

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
          3. lower-sin.f6461.9%

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
        4. Applied rewrites61.9%

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
          2. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
          3. associate-/r*N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
          4. div-flipN/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
          5. remove-sound-/N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
          6. lower-/.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
          7. remove-sound-/N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
          8. lower-/.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
          9. lower-/.f6463.9%

            \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
        6. Applied rewrites63.9%

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
      4. Recombined 4 regimes into one program.
      5. Add Preprocessing

      Alternative 8: 89.9% accurate, 0.2× speedup?

      \[\begin{array}{l} t_0 := \left(-ca\right) \cdot \sin lamt\\ t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\ \mathbf{if}\;t\_1 \leq -50000:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-156}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot one\_es}\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{sa \cdot one\_es}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\ \end{array} \]
      (FPCore (lamdp lamt ca one_es sa)
        :precision binary64
        :pre TRUE
        (let* ((t_0 (* (- ca) (sin lamt)))
             (t_1 (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt)))))
        (if (<= t_1 -50000.0)
          (atan (/ (/ t_0 sa) one_es))
          (if (<= t_1 5e-156)
            (atan (* (cos lamt) (/ (tan lamdp) (* sa one_es))))
            (if (<= t_1 5e-10)
              (atan (/ (- (* (tan lamdp) 1.0) (* ca lamt)) (* one_es sa)))
              (if (<= t_1 10.0)
                (atan (/ (* (cos lamt) (tan lamdp)) (* sa one_es)))
                (atan (/ 1.0 (/ sa (/ t_0 one_es))))))))))
      double code(double lamdp, double lamt, double ca, double one_es, double sa) {
      	double t_0 = -ca * sin(lamt);
      	double t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
      	double tmp;
      	if (t_1 <= -50000.0) {
      		tmp = atan(((t_0 / sa) / one_es));
      	} else if (t_1 <= 5e-156) {
      		tmp = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))));
      	} else if (t_1 <= 5e-10) {
      		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
      	} else if (t_1 <= 10.0) {
      		tmp = atan(((cos(lamt) * tan(lamdp)) / (sa * one_es)));
      	} else {
      		tmp = atan((1.0 / (sa / (t_0 / one_es))));
      	}
      	return tmp;
      }
      
      real(8) function code(lamdp, lamt, ca, one_es, sa)
      use fmin_fmax_functions
          real(8), intent (in) :: lamdp
          real(8), intent (in) :: lamt
          real(8), intent (in) :: ca
          real(8), intent (in) :: one_es
          real(8), intent (in) :: sa
          real(8) :: t_0
          real(8) :: t_1
          real(8) :: tmp
          t_0 = -ca * sin(lamt)
          t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt))
          if (t_1 <= (-50000.0d0)) then
              tmp = atan(((t_0 / sa) / one_es))
          else if (t_1 <= 5d-156) then
              tmp = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))))
          else if (t_1 <= 5d-10) then
              tmp = atan((((tan(lamdp) * 1.0d0) - (ca * lamt)) / (one_es * sa)))
          else if (t_1 <= 10.0d0) then
              tmp = atan(((cos(lamt) * tan(lamdp)) / (sa * one_es)))
          else
              tmp = atan((1.0d0 / (sa / (t_0 / one_es))))
          end if
          code = tmp
      end function
      
      public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
      	double t_0 = -ca * Math.sin(lamt);
      	double t_1 = (Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt));
      	double tmp;
      	if (t_1 <= -50000.0) {
      		tmp = Math.atan(((t_0 / sa) / one_es));
      	} else if (t_1 <= 5e-156) {
      		tmp = Math.atan((Math.cos(lamt) * (Math.tan(lamdp) / (sa * one_es))));
      	} else if (t_1 <= 5e-10) {
      		tmp = Math.atan((((Math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
      	} else if (t_1 <= 10.0) {
      		tmp = Math.atan(((Math.cos(lamt) * Math.tan(lamdp)) / (sa * one_es)));
      	} else {
      		tmp = Math.atan((1.0 / (sa / (t_0 / one_es))));
      	}
      	return tmp;
      }
      
      def code(lamdp, lamt, ca, one_es, sa):
      	t_0 = -ca * math.sin(lamt)
      	t_1 = (math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))
      	tmp = 0
      	if t_1 <= -50000.0:
      		tmp = math.atan(((t_0 / sa) / one_es))
      	elif t_1 <= 5e-156:
      		tmp = math.atan((math.cos(lamt) * (math.tan(lamdp) / (sa * one_es))))
      	elif t_1 <= 5e-10:
      		tmp = math.atan((((math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)))
      	elif t_1 <= 10.0:
      		tmp = math.atan(((math.cos(lamt) * math.tan(lamdp)) / (sa * one_es)))
      	else:
      		tmp = math.atan((1.0 / (sa / (t_0 / one_es))))
      	return tmp
      
      function code(lamdp, lamt, ca, one_es, sa)
      	t_0 = Float64(Float64(-ca) * sin(lamt))
      	t_1 = Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt)))
      	tmp = 0.0
      	if (t_1 <= -50000.0)
      		tmp = atan(Float64(Float64(t_0 / sa) / one_es));
      	elseif (t_1 <= 5e-156)
      		tmp = atan(Float64(cos(lamt) * Float64(tan(lamdp) / Float64(sa * one_es))));
      	elseif (t_1 <= 5e-10)
      		tmp = atan(Float64(Float64(Float64(tan(lamdp) * 1.0) - Float64(ca * lamt)) / Float64(one_es * sa)));
      	elseif (t_1 <= 10.0)
      		tmp = atan(Float64(Float64(cos(lamt) * tan(lamdp)) / Float64(sa * one_es)));
      	else
      		tmp = atan(Float64(1.0 / Float64(sa / Float64(t_0 / one_es))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
      	t_0 = -ca * sin(lamt);
      	t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
      	tmp = 0.0;
      	if (t_1 <= -50000.0)
      		tmp = atan(((t_0 / sa) / one_es));
      	elseif (t_1 <= 5e-156)
      		tmp = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))));
      	elseif (t_1 <= 5e-10)
      		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
      	elseif (t_1 <= 10.0)
      		tmp = atan(((cos(lamt) * tan(lamdp)) / (sa * one_es)));
      	else
      		tmp = atan((1.0 / (sa / (t_0 / one_es))));
      	end
      	tmp_2 = tmp;
      end
      
      code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -50000.0], N[ArcTan[N[(N[(t$95$0 / sa), $MachinePrecision] / one$95$es), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e-156], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(N[Tan[lamdp], $MachinePrecision] / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e-10], N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * 1.0), $MachinePrecision] - N[(ca * lamt), $MachinePrecision]), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10.0], N[ArcTan[N[(N[(N[Cos[lamt], $MachinePrecision] * N[Tan[lamdp], $MachinePrecision]), $MachinePrecision] / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(1.0 / N[(sa / N[(t$95$0 / one$95$es), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
      
      f(lamdp, lamt, ca, one_es, sa):
      	lamdp in [-inf, +inf],
      	lamt in [-inf, +inf],
      	ca in [-inf, +inf],
      	one_es in [-inf, +inf],
      	sa in [-inf, +inf]
      code: THEORY
      BEGIN
      f(lamdp, lamt, ca, one_es, sa: real): real =
      	LET t_0 = ((- ca) * (sin(lamt))) IN
      		LET t_1 = (((tan(lamdp)) * (cos(lamt))) - (ca * (sin(lamt)))) IN
      			LET tmp_3 = IF (t_1 <= (10)) THEN (atan((((cos(lamt)) * (tan(lamdp))) / (sa * one_es)))) ELSE (atan(((1) / (sa / (t_0 / one_es))))) ENDIF IN
      			LET tmp_2 = IF (t_1 <= (50000000000000003114079572888992820944853434639298939146101474761962890625e-83)) THEN (atan(((((tan(lamdp)) * (1)) - (ca * lamt)) / (one_es * sa)))) ELSE tmp_3 ENDIF IN
      			LET tmp_1 = IF (t_1 <= (50000000000000000715540317304108006029470210492243123761983918126875935262850296510107706907452510377550525720562888354785121499372493310097280340714982147141129125603356728531036914851254511846031568594152234841426192195868945903408443151863112545281109972151090996482250140895178763654401487741162529419075433079988589340884859636228166246584438021605672655567875796727046744383216037022066302597522735595703125e-568)) THEN (atan(((cos(lamt)) * ((tan(lamdp)) / (sa * one_es))))) ELSE tmp_2 ENDIF IN
      			LET tmp = IF (t_1 <= (-5e4)) THEN (atan(((t_0 / sa) / one_es))) ELSE tmp_1 ENDIF IN
      	tmp
      END code
      \begin{array}{l}
      t_0 := \left(-ca\right) \cdot \sin lamt\\
      t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\
      \mathbf{if}\;t\_1 \leq -50000:\\
      \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-156}:\\
      \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot one\_es}\right)\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-10}:\\
      \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\
      
      \mathbf{elif}\;t\_1 \leq 10:\\
      \;\;\;\;\tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{sa \cdot one\_es}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 5 regimes
      2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4

        1. Initial program 96.7%

          \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. Taylor expanded in lamdp around 0

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
          3. lower-sin.f6461.9%

            \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
        4. Applied rewrites61.9%

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
          2. mult-flipN/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
          3. *-commutativeN/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
          5. lower-/.f6461.9%

            \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
          6. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
          8. lower-*.f6461.9%

            \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
          9. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
          10. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
          11. associate-*r*N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
          12. mul-1-negN/A

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
          13. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
          14. lower-neg.f6461.9%

            \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
        6. Applied rewrites61.9%

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
          2. *-commutativeN/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
          3. lift-/.f64N/A

            \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
          4. mult-flip-revN/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
          5. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
          6. associate-/r*N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
          7. lower-/.f64N/A

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
          8. lower-/.f6464.2%

            \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
        8. Applied rewrites64.2%

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

        if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000001e-156

        1. Initial program 96.7%

          \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. Taylor expanded in ca around 0

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          3. lower-cos.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          4. lower-sin.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          5. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
          6. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
          7. lower-cos.f6463.7%

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
        4. Applied rewrites63.7%

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
          2. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          3. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
          4. times-fracN/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
          5. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
          6. *-commutativeN/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
          7. associate-/r*N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
          8. lift-sin.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
          9. lift-cos.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
          10. tan-quotN/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
          11. lift-tan.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
          12. times-fracN/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
          13. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
          14. associate-/l*N/A

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
          15. lower-*.f64N/A

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
          16. lower-/.f6463.7%

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
          17. lift-*.f64N/A

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
          18. *-commutativeN/A

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
          19. lower-*.f6463.7%

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
        6. Applied rewrites63.7%

          \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]

        if 5.0000000000000001e-156 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000003e-10

        1. Initial program 96.7%

          \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        2. Taylor expanded in lamt around 0

          \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
        3. Step-by-step derivation
          1. Applied rewrites86.0%

            \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in lamt around 0

            \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]
          3. Step-by-step derivation
            1. lower-*.f6467.2%

              \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \color{blue}{lamt}}{one\_es \cdot sa}\right) \]
          4. Applied rewrites67.2%

            \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]

          if 5.0000000000000003e-10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

          1. Initial program 96.7%

            \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in ca around 0

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            3. lower-cos.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            4. lower-sin.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            5. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
            6. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
            7. lower-cos.f6463.7%

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          4. Applied rewrites63.7%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
            2. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            3. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
            4. times-fracN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
            5. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
            6. *-commutativeN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
            7. associate-/r*N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
            8. lift-sin.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
            9. lift-cos.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
            10. tan-quotN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
            11. lift-tan.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
            12. times-fracN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
            13. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
            14. associate-/l*N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
            16. lower-/.f6463.7%

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
            17. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
            18. *-commutativeN/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
            19. lower-*.f6463.7%

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
          6. Applied rewrites63.7%

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
          7. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{sa \cdot one\_es}}\right) \]
            3. associate-*r/N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{sa \cdot one\_es}}\right) \]
            4. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{sa} \cdot one\_es}\right) \]
            5. lower-/.f6463.7%

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{sa \cdot one\_es}}\right) \]
          8. Applied rewrites63.7%

            \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{sa \cdot one\_es}}\right) \]

          if 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

          1. Initial program 96.7%

            \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in lamdp around 0

            \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
            3. lower-sin.f6461.9%

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
          4. Applied rewrites61.9%

            \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
            2. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
            3. associate-/r*N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
            4. div-flipN/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
            5. remove-sound-/N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
            6. lower-/.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
            7. remove-sound-/N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
            8. lower-/.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
            9. lower-/.f6463.9%

              \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
          6. Applied rewrites63.9%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
        4. Recombined 5 regimes into one program.
        5. Add Preprocessing

        Alternative 9: 89.9% accurate, 0.2× speedup?

        \[\begin{array}{l} t_0 := \left(-ca\right) \cdot \sin lamt\\ t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\ t_2 := \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot one\_es}\right)\\ \mathbf{if}\;t\_1 \leq -50000:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-156}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\ \end{array} \]
        (FPCore (lamdp lamt ca one_es sa)
          :precision binary64
          :pre TRUE
          (let* ((t_0 (* (- ca) (sin lamt)))
               (t_1 (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt))))
               (t_2 (atan (* (cos lamt) (/ (tan lamdp) (* sa one_es))))))
          (if (<= t_1 -50000.0)
            (atan (/ (/ t_0 sa) one_es))
            (if (<= t_1 5e-156)
              t_2
              (if (<= t_1 5e-10)
                (atan (/ (- (* (tan lamdp) 1.0) (* ca lamt)) (* one_es sa)))
                (if (<= t_1 10.0)
                  t_2
                  (atan (/ 1.0 (/ sa (/ t_0 one_es))))))))))
        double code(double lamdp, double lamt, double ca, double one_es, double sa) {
        	double t_0 = -ca * sin(lamt);
        	double t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
        	double t_2 = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))));
        	double tmp;
        	if (t_1 <= -50000.0) {
        		tmp = atan(((t_0 / sa) / one_es));
        	} else if (t_1 <= 5e-156) {
        		tmp = t_2;
        	} else if (t_1 <= 5e-10) {
        		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
        	} else if (t_1 <= 10.0) {
        		tmp = t_2;
        	} else {
        		tmp = atan((1.0 / (sa / (t_0 / one_es))));
        	}
        	return tmp;
        }
        
        real(8) function code(lamdp, lamt, ca, one_es, sa)
        use fmin_fmax_functions
            real(8), intent (in) :: lamdp
            real(8), intent (in) :: lamt
            real(8), intent (in) :: ca
            real(8), intent (in) :: one_es
            real(8), intent (in) :: sa
            real(8) :: t_0
            real(8) :: t_1
            real(8) :: t_2
            real(8) :: tmp
            t_0 = -ca * sin(lamt)
            t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt))
            t_2 = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))))
            if (t_1 <= (-50000.0d0)) then
                tmp = atan(((t_0 / sa) / one_es))
            else if (t_1 <= 5d-156) then
                tmp = t_2
            else if (t_1 <= 5d-10) then
                tmp = atan((((tan(lamdp) * 1.0d0) - (ca * lamt)) / (one_es * sa)))
            else if (t_1 <= 10.0d0) then
                tmp = t_2
            else
                tmp = atan((1.0d0 / (sa / (t_0 / one_es))))
            end if
            code = tmp
        end function
        
        public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
        	double t_0 = -ca * Math.sin(lamt);
        	double t_1 = (Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt));
        	double t_2 = Math.atan((Math.cos(lamt) * (Math.tan(lamdp) / (sa * one_es))));
        	double tmp;
        	if (t_1 <= -50000.0) {
        		tmp = Math.atan(((t_0 / sa) / one_es));
        	} else if (t_1 <= 5e-156) {
        		tmp = t_2;
        	} else if (t_1 <= 5e-10) {
        		tmp = Math.atan((((Math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
        	} else if (t_1 <= 10.0) {
        		tmp = t_2;
        	} else {
        		tmp = Math.atan((1.0 / (sa / (t_0 / one_es))));
        	}
        	return tmp;
        }
        
        def code(lamdp, lamt, ca, one_es, sa):
        	t_0 = -ca * math.sin(lamt)
        	t_1 = (math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))
        	t_2 = math.atan((math.cos(lamt) * (math.tan(lamdp) / (sa * one_es))))
        	tmp = 0
        	if t_1 <= -50000.0:
        		tmp = math.atan(((t_0 / sa) / one_es))
        	elif t_1 <= 5e-156:
        		tmp = t_2
        	elif t_1 <= 5e-10:
        		tmp = math.atan((((math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)))
        	elif t_1 <= 10.0:
        		tmp = t_2
        	else:
        		tmp = math.atan((1.0 / (sa / (t_0 / one_es))))
        	return tmp
        
        function code(lamdp, lamt, ca, one_es, sa)
        	t_0 = Float64(Float64(-ca) * sin(lamt))
        	t_1 = Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt)))
        	t_2 = atan(Float64(cos(lamt) * Float64(tan(lamdp) / Float64(sa * one_es))))
        	tmp = 0.0
        	if (t_1 <= -50000.0)
        		tmp = atan(Float64(Float64(t_0 / sa) / one_es));
        	elseif (t_1 <= 5e-156)
        		tmp = t_2;
        	elseif (t_1 <= 5e-10)
        		tmp = atan(Float64(Float64(Float64(tan(lamdp) * 1.0) - Float64(ca * lamt)) / Float64(one_es * sa)));
        	elseif (t_1 <= 10.0)
        		tmp = t_2;
        	else
        		tmp = atan(Float64(1.0 / Float64(sa / Float64(t_0 / one_es))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
        	t_0 = -ca * sin(lamt);
        	t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
        	t_2 = atan((cos(lamt) * (tan(lamdp) / (sa * one_es))));
        	tmp = 0.0;
        	if (t_1 <= -50000.0)
        		tmp = atan(((t_0 / sa) / one_es));
        	elseif (t_1 <= 5e-156)
        		tmp = t_2;
        	elseif (t_1 <= 5e-10)
        		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
        	elseif (t_1 <= 10.0)
        		tmp = t_2;
        	else
        		tmp = atan((1.0 / (sa / (t_0 / one_es))));
        	end
        	tmp_2 = tmp;
        end
        
        code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(N[Tan[lamdp], $MachinePrecision] / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -50000.0], N[ArcTan[N[(N[(t$95$0 / sa), $MachinePrecision] / one$95$es), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e-156], t$95$2, If[LessEqual[t$95$1, 5e-10], N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * 1.0), $MachinePrecision] - N[(ca * lamt), $MachinePrecision]), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10.0], t$95$2, N[ArcTan[N[(1.0 / N[(sa / N[(t$95$0 / one$95$es), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
        
        f(lamdp, lamt, ca, one_es, sa):
        	lamdp in [-inf, +inf],
        	lamt in [-inf, +inf],
        	ca in [-inf, +inf],
        	one_es in [-inf, +inf],
        	sa in [-inf, +inf]
        code: THEORY
        BEGIN
        f(lamdp, lamt, ca, one_es, sa: real): real =
        	LET t_0 = ((- ca) * (sin(lamt))) IN
        		LET t_1 = (((tan(lamdp)) * (cos(lamt))) - (ca * (sin(lamt)))) IN
        			LET t_2 = (atan(((cos(lamt)) * ((tan(lamdp)) / (sa * one_es))))) IN
        				LET tmp_3 = IF (t_1 <= (10)) THEN t_2 ELSE (atan(((1) / (sa / (t_0 / one_es))))) ENDIF IN
        				LET tmp_2 = IF (t_1 <= (50000000000000003114079572888992820944853434639298939146101474761962890625e-83)) THEN (atan(((((tan(lamdp)) * (1)) - (ca * lamt)) / (one_es * sa)))) ELSE tmp_3 ENDIF IN
        				LET tmp_1 = IF (t_1 <= (50000000000000000715540317304108006029470210492243123761983918126875935262850296510107706907452510377550525720562888354785121499372493310097280340714982147141129125603356728531036914851254511846031568594152234841426192195868945903408443151863112545281109972151090996482250140895178763654401487741162529419075433079988589340884859636228166246584438021605672655567875796727046744383216037022066302597522735595703125e-568)) THEN t_2 ELSE tmp_2 ENDIF IN
        				LET tmp = IF (t_1 <= (-5e4)) THEN (atan(((t_0 / sa) / one_es))) ELSE tmp_1 ENDIF IN
        	tmp
        END code
        \begin{array}{l}
        t_0 := \left(-ca\right) \cdot \sin lamt\\
        t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\
        t_2 := \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot one\_es}\right)\\
        \mathbf{if}\;t\_1 \leq -50000:\\
        \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\
        
        \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-156}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-10}:\\
        \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\
        
        \mathbf{elif}\;t\_1 \leq 10:\\
        \;\;\;\;t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4

          1. Initial program 96.7%

            \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in lamdp around 0

            \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
            3. lower-sin.f6461.9%

              \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
          4. Applied rewrites61.9%

            \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
            2. mult-flipN/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
            3. *-commutativeN/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
            5. lower-/.f6461.9%

              \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
            6. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
            8. lower-*.f6461.9%

              \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
            9. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
            10. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
            11. associate-*r*N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
            12. mul-1-negN/A

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
            13. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
            14. lower-neg.f6461.9%

              \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
          6. Applied rewrites61.9%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
          7. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
            2. *-commutativeN/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
            3. lift-/.f64N/A

              \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
            4. mult-flip-revN/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
            5. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
            6. associate-/r*N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
            7. lower-/.f64N/A

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
            8. lower-/.f6464.2%

              \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
          8. Applied rewrites64.2%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

          if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000001e-156 or 5.0000000000000003e-10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

          1. Initial program 96.7%

            \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in ca around 0

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            3. lower-cos.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            4. lower-sin.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            5. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
            6. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
            7. lower-cos.f6463.7%

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
          4. Applied rewrites63.7%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
            2. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
            3. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
            4. times-fracN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
            5. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
            6. *-commutativeN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
            7. associate-/r*N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
            8. lift-sin.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
            9. lift-cos.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
            10. tan-quotN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
            11. lift-tan.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
            12. times-fracN/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
            13. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
            14. associate-/l*N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
            16. lower-/.f6463.7%

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
            17. lift-*.f64N/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
            18. *-commutativeN/A

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
            19. lower-*.f6463.7%

              \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
          6. Applied rewrites63.7%

            \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]

          if 5.0000000000000001e-156 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 5.0000000000000003e-10

          1. Initial program 96.7%

            \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          2. Taylor expanded in lamt around 0

            \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
          3. Step-by-step derivation
            1. Applied rewrites86.0%

              \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
            2. Taylor expanded in lamt around 0

              \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]
            3. Step-by-step derivation
              1. lower-*.f6467.2%

                \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \color{blue}{lamt}}{one\_es \cdot sa}\right) \]
            4. Applied rewrites67.2%

              \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]

            if 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

            1. Initial program 96.7%

              \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
            2. Taylor expanded in lamdp around 0

              \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
              3. lower-sin.f6461.9%

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
            4. Applied rewrites61.9%

              \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
              2. lift-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
              3. associate-/r*N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
              4. div-flipN/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
              5. remove-sound-/N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
              6. lower-/.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
              7. remove-sound-/N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
              8. lower-/.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
              9. lower-/.f6463.9%

                \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
            6. Applied rewrites63.9%

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
          4. Recombined 4 regimes into one program.
          5. Add Preprocessing

          Alternative 10: 83.1% accurate, 0.4× speedup?

          \[\begin{array}{l} t_0 := \left(-ca\right) \cdot \sin lamt\\ t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\ \mathbf{if}\;t\_1 \leq -2.22 \cdot 10^{+21}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\ \mathbf{elif}\;t\_1 \leq 200:\\ \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\ \end{array} \]
          (FPCore (lamdp lamt ca one_es sa)
            :precision binary64
            :pre TRUE
            (let* ((t_0 (* (- ca) (sin lamt)))
                 (t_1 (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt)))))
            (if (<= t_1 -2.22e+21)
              (atan (/ (/ t_0 sa) one_es))
              (if (<= t_1 200.0)
                (atan (/ (- (* (tan lamdp) 1.0) (* ca lamt)) (* one_es sa)))
                (atan (/ 1.0 (/ sa (/ t_0 one_es))))))))
          double code(double lamdp, double lamt, double ca, double one_es, double sa) {
          	double t_0 = -ca * sin(lamt);
          	double t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
          	double tmp;
          	if (t_1 <= -2.22e+21) {
          		tmp = atan(((t_0 / sa) / one_es));
          	} else if (t_1 <= 200.0) {
          		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
          	} else {
          		tmp = atan((1.0 / (sa / (t_0 / one_es))));
          	}
          	return tmp;
          }
          
          real(8) function code(lamdp, lamt, ca, one_es, sa)
          use fmin_fmax_functions
              real(8), intent (in) :: lamdp
              real(8), intent (in) :: lamt
              real(8), intent (in) :: ca
              real(8), intent (in) :: one_es
              real(8), intent (in) :: sa
              real(8) :: t_0
              real(8) :: t_1
              real(8) :: tmp
              t_0 = -ca * sin(lamt)
              t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt))
              if (t_1 <= (-2.22d+21)) then
                  tmp = atan(((t_0 / sa) / one_es))
              else if (t_1 <= 200.0d0) then
                  tmp = atan((((tan(lamdp) * 1.0d0) - (ca * lamt)) / (one_es * sa)))
              else
                  tmp = atan((1.0d0 / (sa / (t_0 / one_es))))
              end if
              code = tmp
          end function
          
          public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
          	double t_0 = -ca * Math.sin(lamt);
          	double t_1 = (Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt));
          	double tmp;
          	if (t_1 <= -2.22e+21) {
          		tmp = Math.atan(((t_0 / sa) / one_es));
          	} else if (t_1 <= 200.0) {
          		tmp = Math.atan((((Math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
          	} else {
          		tmp = Math.atan((1.0 / (sa / (t_0 / one_es))));
          	}
          	return tmp;
          }
          
          def code(lamdp, lamt, ca, one_es, sa):
          	t_0 = -ca * math.sin(lamt)
          	t_1 = (math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))
          	tmp = 0
          	if t_1 <= -2.22e+21:
          		tmp = math.atan(((t_0 / sa) / one_es))
          	elif t_1 <= 200.0:
          		tmp = math.atan((((math.tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)))
          	else:
          		tmp = math.atan((1.0 / (sa / (t_0 / one_es))))
          	return tmp
          
          function code(lamdp, lamt, ca, one_es, sa)
          	t_0 = Float64(Float64(-ca) * sin(lamt))
          	t_1 = Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt)))
          	tmp = 0.0
          	if (t_1 <= -2.22e+21)
          		tmp = atan(Float64(Float64(t_0 / sa) / one_es));
          	elseif (t_1 <= 200.0)
          		tmp = atan(Float64(Float64(Float64(tan(lamdp) * 1.0) - Float64(ca * lamt)) / Float64(one_es * sa)));
          	else
          		tmp = atan(Float64(1.0 / Float64(sa / Float64(t_0 / one_es))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
          	t_0 = -ca * sin(lamt);
          	t_1 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
          	tmp = 0.0;
          	if (t_1 <= -2.22e+21)
          		tmp = atan(((t_0 / sa) / one_es));
          	elseif (t_1 <= 200.0)
          		tmp = atan((((tan(lamdp) * 1.0) - (ca * lamt)) / (one_es * sa)));
          	else
          		tmp = atan((1.0 / (sa / (t_0 / one_es))));
          	end
          	tmp_2 = tmp;
          end
          
          code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2.22e+21], N[ArcTan[N[(N[(t$95$0 / sa), $MachinePrecision] / one$95$es), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[ArcTan[N[(N[(N[(N[Tan[lamdp], $MachinePrecision] * 1.0), $MachinePrecision] - N[(ca * lamt), $MachinePrecision]), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(1.0 / N[(sa / N[(t$95$0 / one$95$es), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
          
          f(lamdp, lamt, ca, one_es, sa):
          	lamdp in [-inf, +inf],
          	lamt in [-inf, +inf],
          	ca in [-inf, +inf],
          	one_es in [-inf, +inf],
          	sa in [-inf, +inf]
          code: THEORY
          BEGIN
          f(lamdp, lamt, ca, one_es, sa: real): real =
          	LET t_0 = ((- ca) * (sin(lamt))) IN
          		LET t_1 = (((tan(lamdp)) * (cos(lamt))) - (ca * (sin(lamt)))) IN
          			LET tmp_1 = IF (t_1 <= (200)) THEN (atan(((((tan(lamdp)) * (1)) - (ca * lamt)) / (one_es * sa)))) ELSE (atan(((1) / (sa / (t_0 / one_es))))) ENDIF IN
          			LET tmp = IF (t_1 <= (-222e19)) THEN (atan(((t_0 / sa) / one_es))) ELSE tmp_1 ENDIF IN
          	tmp
          END code
          \begin{array}{l}
          t_0 := \left(-ca\right) \cdot \sin lamt\\
          t_1 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\
          \mathbf{if}\;t\_1 \leq -2.22 \cdot 10^{+21}:\\
          \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{sa}}{one\_es}\right)\\
          
          \mathbf{elif}\;t\_1 \leq 200:\\
          \;\;\;\;\tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot lamt}{one\_es \cdot sa}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{sa}{\frac{t\_0}{one\_es}}}\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -2.22e21

            1. Initial program 96.7%

              \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
            2. Taylor expanded in lamdp around 0

              \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
              3. lower-sin.f6461.9%

                \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
            4. Applied rewrites61.9%

              \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
              2. mult-flipN/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
              3. *-commutativeN/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
              4. lower-*.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
              5. lower-/.f6461.9%

                \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
              6. lift-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
              8. lower-*.f6461.9%

                \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
              9. lift-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
              10. lift-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
              11. associate-*r*N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
              12. mul-1-negN/A

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
              13. lower-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
              14. lower-neg.f6461.9%

                \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
            6. Applied rewrites61.9%

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
              2. *-commutativeN/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
              3. lift-/.f64N/A

                \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
              4. mult-flip-revN/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
              5. lift-*.f64N/A

                \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
              6. associate-/r*N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
              7. lower-/.f64N/A

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
              8. lower-/.f6464.2%

                \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
            8. Applied rewrites64.2%

              \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

            if -2.22e21 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 200

            1. Initial program 96.7%

              \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
            2. Taylor expanded in lamt around 0

              \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
            3. Step-by-step derivation
              1. Applied rewrites86.0%

                \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \color{blue}{1} - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
              2. Taylor expanded in lamt around 0

                \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]
              3. Step-by-step derivation
                1. lower-*.f6467.2%

                  \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - ca \cdot \color{blue}{lamt}}{one\_es \cdot sa}\right) \]
              4. Applied rewrites67.2%

                \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot 1 - \color{blue}{ca \cdot lamt}}{one\_es \cdot sa}\right) \]

              if 200 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

              1. Initial program 96.7%

                \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
              2. Taylor expanded in lamdp around 0

                \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                3. lower-sin.f6461.9%

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
              4. Applied rewrites61.9%

                \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                3. associate-/r*N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                4. div-flipN/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                5. remove-sound-/N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                6. lower-/.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                7. remove-sound-/N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
                8. lower-/.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
                9. lower-/.f6463.9%

                  \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
              6. Applied rewrites63.9%

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
            4. Recombined 3 regimes into one program.
            5. Add Preprocessing

            Alternative 11: 81.6% accurate, 0.2× speedup?

            \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \left(-ca\right) \cdot \sin lamt\\ t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_3 := ca \cdot \sin lamt\\ t_4 := \tan lamdp \cdot \cos lamt - t\_3\\ t_5 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_2 \cdot t\_0}\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -50000:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\ \mathbf{elif}\;t\_4 \leq -0.09:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_4 \leq 10^{-172}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_2}\right)\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-42}:\\ \;\;\;\;\tan^{-1} \left(\frac{t\_3}{t\_0} \cdot \frac{-1}{t\_2}\right)\\ \mathbf{elif}\;t\_4 \leq 10:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\ \end{array}\right) \end{array} \]
            (FPCore (lamdp lamt ca one_es sa)
              :precision binary64
              :pre TRUE
              (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
                   (t_1 (* (- ca) (sin lamt)))
                   (t_2 (fmax (fabs one_es) (fabs sa)))
                   (t_3 (* ca (sin lamt)))
                   (t_4 (- (* (tan lamdp) (cos lamt)) t_3))
                   (t_5 (atan (* 1.0 (/ (tan lamdp) (* t_2 t_0))))))
              (*
               (copysign 1.0 one_es)
               (*
                (copysign 1.0 sa)
                (if (<= t_4 -50000.0)
                  (atan (/ (/ t_1 t_2) t_0))
                  (if (<= t_4 -0.09)
                    t_5
                    (if (<= t_4 1e-172)
                      (atan (* (cos lamt) (/ lamdp (* t_0 t_2))))
                      (if (<= t_4 2e-42)
                        (atan (* (/ t_3 t_0) (/ -1.0 t_2)))
                        (if (<= t_4 10.0)
                          t_5
                          (atan (/ 1.0 (/ t_2 (/ t_1 t_0)))))))))))))
            double code(double lamdp, double lamt, double ca, double one_es, double sa) {
            	double t_0 = fmin(fabs(one_es), fabs(sa));
            	double t_1 = -ca * sin(lamt);
            	double t_2 = fmax(fabs(one_es), fabs(sa));
            	double t_3 = ca * sin(lamt);
            	double t_4 = (tan(lamdp) * cos(lamt)) - t_3;
            	double t_5 = atan((1.0 * (tan(lamdp) / (t_2 * t_0))));
            	double tmp;
            	if (t_4 <= -50000.0) {
            		tmp = atan(((t_1 / t_2) / t_0));
            	} else if (t_4 <= -0.09) {
            		tmp = t_5;
            	} else if (t_4 <= 1e-172) {
            		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_2))));
            	} else if (t_4 <= 2e-42) {
            		tmp = atan(((t_3 / t_0) * (-1.0 / t_2)));
            	} else if (t_4 <= 10.0) {
            		tmp = t_5;
            	} else {
            		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
            	}
            	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
            }
            
            public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
            	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
            	double t_1 = -ca * Math.sin(lamt);
            	double t_2 = fmax(Math.abs(one_es), Math.abs(sa));
            	double t_3 = ca * Math.sin(lamt);
            	double t_4 = (Math.tan(lamdp) * Math.cos(lamt)) - t_3;
            	double t_5 = Math.atan((1.0 * (Math.tan(lamdp) / (t_2 * t_0))));
            	double tmp;
            	if (t_4 <= -50000.0) {
            		tmp = Math.atan(((t_1 / t_2) / t_0));
            	} else if (t_4 <= -0.09) {
            		tmp = t_5;
            	} else if (t_4 <= 1e-172) {
            		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_0 * t_2))));
            	} else if (t_4 <= 2e-42) {
            		tmp = Math.atan(((t_3 / t_0) * (-1.0 / t_2)));
            	} else if (t_4 <= 10.0) {
            		tmp = t_5;
            	} else {
            		tmp = Math.atan((1.0 / (t_2 / (t_1 / t_0))));
            	}
            	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
            }
            
            def code(lamdp, lamt, ca, one_es, sa):
            	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
            	t_1 = -ca * math.sin(lamt)
            	t_2 = fmax(math.fabs(one_es), math.fabs(sa))
            	t_3 = ca * math.sin(lamt)
            	t_4 = (math.tan(lamdp) * math.cos(lamt)) - t_3
            	t_5 = math.atan((1.0 * (math.tan(lamdp) / (t_2 * t_0))))
            	tmp = 0
            	if t_4 <= -50000.0:
            		tmp = math.atan(((t_1 / t_2) / t_0))
            	elif t_4 <= -0.09:
            		tmp = t_5
            	elif t_4 <= 1e-172:
            		tmp = math.atan((math.cos(lamt) * (lamdp / (t_0 * t_2))))
            	elif t_4 <= 2e-42:
            		tmp = math.atan(((t_3 / t_0) * (-1.0 / t_2)))
            	elif t_4 <= 10.0:
            		tmp = t_5
            	else:
            		tmp = math.atan((1.0 / (t_2 / (t_1 / t_0))))
            	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
            
            function code(lamdp, lamt, ca, one_es, sa)
            	t_0 = fmin(abs(one_es), abs(sa))
            	t_1 = Float64(Float64(-ca) * sin(lamt))
            	t_2 = fmax(abs(one_es), abs(sa))
            	t_3 = Float64(ca * sin(lamt))
            	t_4 = Float64(Float64(tan(lamdp) * cos(lamt)) - t_3)
            	t_5 = atan(Float64(1.0 * Float64(tan(lamdp) / Float64(t_2 * t_0))))
            	tmp = 0.0
            	if (t_4 <= -50000.0)
            		tmp = atan(Float64(Float64(t_1 / t_2) / t_0));
            	elseif (t_4 <= -0.09)
            		tmp = t_5;
            	elseif (t_4 <= 1e-172)
            		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_0 * t_2))));
            	elseif (t_4 <= 2e-42)
            		tmp = atan(Float64(Float64(t_3 / t_0) * Float64(-1.0 / t_2)));
            	elseif (t_4 <= 10.0)
            		tmp = t_5;
            	else
            		tmp = atan(Float64(1.0 / Float64(t_2 / Float64(t_1 / t_0))));
            	end
            	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
            end
            
            function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
            	t_0 = min(abs(one_es), abs(sa));
            	t_1 = -ca * sin(lamt);
            	t_2 = max(abs(one_es), abs(sa));
            	t_3 = ca * sin(lamt);
            	t_4 = (tan(lamdp) * cos(lamt)) - t_3;
            	t_5 = atan((1.0 * (tan(lamdp) / (t_2 * t_0))));
            	tmp = 0.0;
            	if (t_4 <= -50000.0)
            		tmp = atan(((t_1 / t_2) / t_0));
            	elseif (t_4 <= -0.09)
            		tmp = t_5;
            	elseif (t_4 <= 1e-172)
            		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_2))));
            	elseif (t_4 <= 2e-42)
            		tmp = atan(((t_3 / t_0) * (-1.0 / t_2)));
            	elseif (t_4 <= 10.0)
            		tmp = t_5;
            	else
            		tmp = atan((1.0 / (t_2 / (t_1 / t_0))));
            	end
            	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
            end
            
            code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[ArcTan[N[(1.0 * N[(N[Tan[lamdp], $MachinePrecision] / N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -50000.0], N[ArcTan[N[(N[(t$95$1 / t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, -0.09], t$95$5, If[LessEqual[t$95$4, 1e-172], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 2e-42], N[ArcTan[N[(N[(t$95$3 / t$95$0), $MachinePrecision] * N[(-1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 10.0], t$95$5, N[ArcTan[N[(1.0 / N[(t$95$2 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]), $MachinePrecision]), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
            t_1 := \left(-ca\right) \cdot \sin lamt\\
            t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
            t_3 := ca \cdot \sin lamt\\
            t_4 := \tan lamdp \cdot \cos lamt - t\_3\\
            t_5 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_2 \cdot t\_0}\right)\\
            \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
            \mathbf{if}\;t\_4 \leq -50000:\\
            \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\
            
            \mathbf{elif}\;t\_4 \leq -0.09:\\
            \;\;\;\;t\_5\\
            
            \mathbf{elif}\;t\_4 \leq 10^{-172}:\\
            \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_2}\right)\\
            
            \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-42}:\\
            \;\;\;\;\tan^{-1} \left(\frac{t\_3}{t\_0} \cdot \frac{-1}{t\_2}\right)\\
            
            \mathbf{elif}\;t\_4 \leq 10:\\
            \;\;\;\;t\_5\\
            
            \mathbf{else}:\\
            \;\;\;\;\tan^{-1} \left(\frac{1}{\frac{t\_2}{\frac{t\_1}{t\_0}}}\right)\\
            
            
            \end{array}\right)
            \end{array}
            
            Derivation
            1. Split input into 5 regimes
            2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4

              1. Initial program 96.7%

                \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
              2. Taylor expanded in lamdp around 0

                \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                3. lower-sin.f6461.9%

                  \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
              4. Applied rewrites61.9%

                \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                2. mult-flipN/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
                3. *-commutativeN/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                4. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                5. lower-/.f6461.9%

                  \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                8. lower-*.f6461.9%

                  \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                9. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
                10. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
                11. associate-*r*N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                12. mul-1-negN/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                13. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                14. lower-neg.f6461.9%

                  \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
              6. Applied rewrites61.9%

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                2. *-commutativeN/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
                3. lift-/.f64N/A

                  \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
                4. mult-flip-revN/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
                5. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
                6. associate-/r*N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                7. lower-/.f64N/A

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                8. lower-/.f6464.2%

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
              8. Applied rewrites64.2%

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

              if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -0.089999999999999997 or 2.0000000000000001e-42 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

              1. Initial program 96.7%

                \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
              2. Taylor expanded in ca around 0

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                3. lower-cos.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                4. lower-sin.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                5. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                7. lower-cos.f6463.7%

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
              4. Applied rewrites63.7%

                \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                2. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                4. times-fracN/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                6. *-commutativeN/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                7. associate-/r*N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                8. lift-sin.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                9. lift-cos.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                10. tan-quotN/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                11. lift-tan.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                12. times-fracN/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                13. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                14. associate-/l*N/A

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                16. lower-/.f6463.7%

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                17. lift-*.f64N/A

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                18. *-commutativeN/A

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                19. lower-*.f6463.7%

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
              6. Applied rewrites63.7%

                \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
              7. Taylor expanded in lamt around 0

                \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]
              8. Step-by-step derivation
                1. Applied rewrites53.3%

                  \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]

                if -0.089999999999999997 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 1e-172

                1. Initial program 96.7%

                  \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                2. Taylor expanded in ca around 0

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  3. lower-cos.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  4. lower-sin.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  5. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                  7. lower-cos.f6463.7%

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                4. Applied rewrites63.7%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                  2. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                  4. times-fracN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                  7. associate-/r*N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                  8. lift-sin.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                  9. lift-cos.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                  10. tan-quotN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                  11. lift-tan.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                  12. times-fracN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  13. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                  14. associate-/l*N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                  15. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                  16. lower-/.f6463.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  17. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                  18. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                  19. lower-*.f6463.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                6. Applied rewrites63.7%

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                7. Taylor expanded in lamdp around 0

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                8. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                  2. lower-*.f6445.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                9. Applied rewrites45.7%

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]

                if 1e-172 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 2.0000000000000001e-42

                1. Initial program 96.7%

                  \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                2. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)} \]
                  2. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
                  3. associate-/r*N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}{sa}\right)} \]
                  4. frac-2negN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)}{\mathsf{neg}\left(sa\right)}\right)} \]
                  5. mult-flipN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
                  7. distribute-neg-fracN/A

                    \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  8. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  9. lift--.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(\color{blue}{\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)}\right)}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  10. sub-negate-revN/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  11. lower--.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  12. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  14. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  15. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  16. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  17. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                3. Applied rewrites97.9%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\sin lamt \cdot ca - \cos lamt \cdot \tan lamdp}{one\_es} \cdot \frac{-1}{sa}\right)} \]
                4. Taylor expanded in lamdp around 0

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{ca \cdot \color{blue}{\sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]
                  2. lower-sin.f6464.1%

                    \[\leadsto \tan^{-1} \left(\frac{ca \cdot \sin lamt}{one\_es} \cdot \frac{-1}{sa}\right) \]
                6. Applied rewrites64.1%

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]

                if 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

                1. Initial program 96.7%

                  \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                2. Taylor expanded in lamdp around 0

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                  3. lower-sin.f6461.9%

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                4. Applied rewrites61.9%

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                  2. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                  3. associate-/r*N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                  4. div-flipN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                  5. remove-sound-/N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                  6. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}\right)} \]
                  7. remove-sound-/N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
                  8. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{\frac{sa}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
                  9. lower-/.f6463.9%

                    \[\leadsto \tan^{-1} \left(\frac{1}{\frac{sa}{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}}\right) \]
                6. Applied rewrites63.9%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{\frac{sa}{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}}\right)} \]
              9. Recombined 5 regimes into one program.
              10. Add Preprocessing

              Alternative 12: 81.6% accurate, 0.2× speedup?

              \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_2 := \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_1}}{t\_0}\right)\\ t_3 := ca \cdot \sin lamt\\ t_4 := \tan lamdp \cdot \cos lamt - t\_3\\ t_5 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_1 \cdot t\_0}\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -50000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_4 \leq -0.09:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_4 \leq 10^{-172}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_1}\right)\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-42}:\\ \;\;\;\;\tan^{-1} \left(\frac{t\_3}{t\_0} \cdot \frac{-1}{t\_1}\right)\\ \mathbf{elif}\;t\_4 \leq 10:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \]
              (FPCore (lamdp lamt ca one_es sa)
                :precision binary64
                :pre TRUE
                (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
                     (t_1 (fmax (fabs one_es) (fabs sa)))
                     (t_2 (atan (/ (/ (* (- ca) (sin lamt)) t_1) t_0)))
                     (t_3 (* ca (sin lamt)))
                     (t_4 (- (* (tan lamdp) (cos lamt)) t_3))
                     (t_5 (atan (* 1.0 (/ (tan lamdp) (* t_1 t_0))))))
                (*
                 (copysign 1.0 one_es)
                 (*
                  (copysign 1.0 sa)
                  (if (<= t_4 -50000.0)
                    t_2
                    (if (<= t_4 -0.09)
                      t_5
                      (if (<= t_4 1e-172)
                        (atan (* (cos lamt) (/ lamdp (* t_0 t_1))))
                        (if (<= t_4 2e-42)
                          (atan (* (/ t_3 t_0) (/ -1.0 t_1)))
                          (if (<= t_4 10.0) t_5 t_2)))))))))
              double code(double lamdp, double lamt, double ca, double one_es, double sa) {
              	double t_0 = fmin(fabs(one_es), fabs(sa));
              	double t_1 = fmax(fabs(one_es), fabs(sa));
              	double t_2 = atan((((-ca * sin(lamt)) / t_1) / t_0));
              	double t_3 = ca * sin(lamt);
              	double t_4 = (tan(lamdp) * cos(lamt)) - t_3;
              	double t_5 = atan((1.0 * (tan(lamdp) / (t_1 * t_0))));
              	double tmp;
              	if (t_4 <= -50000.0) {
              		tmp = t_2;
              	} else if (t_4 <= -0.09) {
              		tmp = t_5;
              	} else if (t_4 <= 1e-172) {
              		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_1))));
              	} else if (t_4 <= 2e-42) {
              		tmp = atan(((t_3 / t_0) * (-1.0 / t_1)));
              	} else if (t_4 <= 10.0) {
              		tmp = t_5;
              	} else {
              		tmp = t_2;
              	}
              	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
              }
              
              public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
              	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
              	double t_1 = fmax(Math.abs(one_es), Math.abs(sa));
              	double t_2 = Math.atan((((-ca * Math.sin(lamt)) / t_1) / t_0));
              	double t_3 = ca * Math.sin(lamt);
              	double t_4 = (Math.tan(lamdp) * Math.cos(lamt)) - t_3;
              	double t_5 = Math.atan((1.0 * (Math.tan(lamdp) / (t_1 * t_0))));
              	double tmp;
              	if (t_4 <= -50000.0) {
              		tmp = t_2;
              	} else if (t_4 <= -0.09) {
              		tmp = t_5;
              	} else if (t_4 <= 1e-172) {
              		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_0 * t_1))));
              	} else if (t_4 <= 2e-42) {
              		tmp = Math.atan(((t_3 / t_0) * (-1.0 / t_1)));
              	} else if (t_4 <= 10.0) {
              		tmp = t_5;
              	} else {
              		tmp = t_2;
              	}
              	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
              }
              
              def code(lamdp, lamt, ca, one_es, sa):
              	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
              	t_1 = fmax(math.fabs(one_es), math.fabs(sa))
              	t_2 = math.atan((((-ca * math.sin(lamt)) / t_1) / t_0))
              	t_3 = ca * math.sin(lamt)
              	t_4 = (math.tan(lamdp) * math.cos(lamt)) - t_3
              	t_5 = math.atan((1.0 * (math.tan(lamdp) / (t_1 * t_0))))
              	tmp = 0
              	if t_4 <= -50000.0:
              		tmp = t_2
              	elif t_4 <= -0.09:
              		tmp = t_5
              	elif t_4 <= 1e-172:
              		tmp = math.atan((math.cos(lamt) * (lamdp / (t_0 * t_1))))
              	elif t_4 <= 2e-42:
              		tmp = math.atan(((t_3 / t_0) * (-1.0 / t_1)))
              	elif t_4 <= 10.0:
              		tmp = t_5
              	else:
              		tmp = t_2
              	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
              
              function code(lamdp, lamt, ca, one_es, sa)
              	t_0 = fmin(abs(one_es), abs(sa))
              	t_1 = fmax(abs(one_es), abs(sa))
              	t_2 = atan(Float64(Float64(Float64(Float64(-ca) * sin(lamt)) / t_1) / t_0))
              	t_3 = Float64(ca * sin(lamt))
              	t_4 = Float64(Float64(tan(lamdp) * cos(lamt)) - t_3)
              	t_5 = atan(Float64(1.0 * Float64(tan(lamdp) / Float64(t_1 * t_0))))
              	tmp = 0.0
              	if (t_4 <= -50000.0)
              		tmp = t_2;
              	elseif (t_4 <= -0.09)
              		tmp = t_5;
              	elseif (t_4 <= 1e-172)
              		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_0 * t_1))));
              	elseif (t_4 <= 2e-42)
              		tmp = atan(Float64(Float64(t_3 / t_0) * Float64(-1.0 / t_1)));
              	elseif (t_4 <= 10.0)
              		tmp = t_5;
              	else
              		tmp = t_2;
              	end
              	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
              end
              
              function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
              	t_0 = min(abs(one_es), abs(sa));
              	t_1 = max(abs(one_es), abs(sa));
              	t_2 = atan((((-ca * sin(lamt)) / t_1) / t_0));
              	t_3 = ca * sin(lamt);
              	t_4 = (tan(lamdp) * cos(lamt)) - t_3;
              	t_5 = atan((1.0 * (tan(lamdp) / (t_1 * t_0))));
              	tmp = 0.0;
              	if (t_4 <= -50000.0)
              		tmp = t_2;
              	elseif (t_4 <= -0.09)
              		tmp = t_5;
              	elseif (t_4 <= 1e-172)
              		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_1))));
              	elseif (t_4 <= 2e-42)
              		tmp = atan(((t_3 / t_0) * (-1.0 / t_1)));
              	elseif (t_4 <= 10.0)
              		tmp = t_5;
              	else
              		tmp = t_2;
              	end
              	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
              end
              
              code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[ArcTan[N[(1.0 * N[(N[Tan[lamdp], $MachinePrecision] / N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -50000.0], t$95$2, If[LessEqual[t$95$4, -0.09], t$95$5, If[LessEqual[t$95$4, 1e-172], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 2e-42], N[ArcTan[N[(N[(t$95$3 / t$95$0), $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 10.0], t$95$5, t$95$2]]]]]), $MachinePrecision]), $MachinePrecision]]]]]]]
              
              \begin{array}{l}
              t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
              t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
              t_2 := \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_1}}{t\_0}\right)\\
              t_3 := ca \cdot \sin lamt\\
              t_4 := \tan lamdp \cdot \cos lamt - t\_3\\
              t_5 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_1 \cdot t\_0}\right)\\
              \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
              \mathbf{if}\;t\_4 \leq -50000:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_4 \leq -0.09:\\
              \;\;\;\;t\_5\\
              
              \mathbf{elif}\;t\_4 \leq 10^{-172}:\\
              \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_1}\right)\\
              
              \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-42}:\\
              \;\;\;\;\tan^{-1} \left(\frac{t\_3}{t\_0} \cdot \frac{-1}{t\_1}\right)\\
              
              \mathbf{elif}\;t\_4 \leq 10:\\
              \;\;\;\;t\_5\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_2\\
              
              
              \end{array}\right)
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4 or 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

                1. Initial program 96.7%

                  \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                2. Taylor expanded in lamdp around 0

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                  3. lower-sin.f6461.9%

                    \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                4. Applied rewrites61.9%

                  \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                  2. mult-flipN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                  5. lower-/.f6461.9%

                    \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                  6. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                  8. lower-*.f6461.9%

                    \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                  9. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
                  10. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
                  11. associate-*r*N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                  12. mul-1-negN/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                  13. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                  14. lower-neg.f6461.9%

                    \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                6. Applied rewrites61.9%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                7. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                  2. *-commutativeN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
                  3. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
                  4. mult-flip-revN/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
                  5. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
                  6. associate-/r*N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                  7. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                  8. lower-/.f6464.2%

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
                8. Applied rewrites64.2%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

                if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -0.089999999999999997 or 2.0000000000000001e-42 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

                1. Initial program 96.7%

                  \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                2. Taylor expanded in ca around 0

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                  2. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  3. lower-cos.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  4. lower-sin.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  5. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                  7. lower-cos.f6463.7%

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                4. Applied rewrites63.7%

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                  2. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                  4. times-fracN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                  7. associate-/r*N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                  8. lift-sin.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                  9. lift-cos.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                  10. tan-quotN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                  11. lift-tan.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                  12. times-fracN/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  13. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                  14. associate-/l*N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                  15. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                  16. lower-/.f6463.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  17. lift-*.f64N/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                  18. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                  19. lower-*.f6463.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                6. Applied rewrites63.7%

                  \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                7. Taylor expanded in lamt around 0

                  \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]
                8. Step-by-step derivation
                  1. Applied rewrites53.3%

                    \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]

                  if -0.089999999999999997 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 1e-172

                  1. Initial program 96.7%

                    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                  2. Taylor expanded in ca around 0

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    3. lower-cos.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. lower-sin.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    5. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                    6. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                    7. lower-cos.f6463.7%

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  4. Applied rewrites63.7%

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                  5. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                    2. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    3. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                    4. times-fracN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                    7. associate-/r*N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                    8. lift-sin.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                    9. lift-cos.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                    10. tan-quotN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                    11. lift-tan.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                    12. times-fracN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    13. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                    14. associate-/l*N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                    15. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                    16. lower-/.f6463.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    17. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                    18. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    19. lower-*.f6463.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                  6. Applied rewrites63.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                  7. Taylor expanded in lamdp around 0

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                    2. lower-*.f6445.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                  9. Applied rewrites45.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]

                  if 1e-172 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 2.0000000000000001e-42

                  1. Initial program 96.7%

                    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                  2. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right)} \]
                    2. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
                    3. associate-/r*N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}}{sa}\right)} \]
                    4. frac-2negN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)}{\mathsf{neg}\left(sa\right)}\right)} \]
                    5. mult-flipN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
                    6. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right)} \]
                    7. distribute-neg-fracN/A

                      \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    8. lower-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\color{blue}{\frac{\mathsf{neg}\left(\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)\right)}{one\_es}} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    9. lift--.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(\color{blue}{\left(\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\right)}\right)}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    10. sub-negate-revN/A

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    11. lower--.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt - \tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    12. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    13. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    14. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\sin lamt \cdot ca} - \tan lamdp \cdot \cos lamt}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    15. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\tan lamdp \cdot \cos lamt}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    16. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                    17. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot ca - \color{blue}{\cos lamt \cdot \tan lamdp}}{one\_es} \cdot \frac{1}{\mathsf{neg}\left(sa\right)}\right) \]
                  3. Applied rewrites97.9%

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\sin lamt \cdot ca - \cos lamt \cdot \tan lamdp}{one\_es} \cdot \frac{-1}{sa}\right)} \]
                  4. Taylor expanded in lamdp around 0

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{ca \cdot \color{blue}{\sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]
                    2. lower-sin.f6464.1%

                      \[\leadsto \tan^{-1} \left(\frac{ca \cdot \sin lamt}{one\_es} \cdot \frac{-1}{sa}\right) \]
                  6. Applied rewrites64.1%

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{ca \cdot \sin lamt}}{one\_es} \cdot \frac{-1}{sa}\right) \]
                9. Recombined 4 regimes into one program.
                10. Add Preprocessing

                Alternative 13: 81.6% accurate, 0.2× speedup?

                \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \left(-ca\right) \cdot \sin lamt\\ t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_3 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_2 \cdot t\_0}\right)\\ t_4 := \tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\ t_5 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;t\_5 \leq -50000:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_5 \leq -0.09:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_5 \leq 10^{-172}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_2}\right)\\ \mathbf{elif}\;t\_5 \leq 2 \cdot 10^{-42}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_0}}{t\_2}\right)\\ \mathbf{elif}\;t\_5 \leq 10:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array}\right) \end{array} \]
                (FPCore (lamdp lamt ca one_es sa)
                  :precision binary64
                  :pre TRUE
                  (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
                       (t_1 (* (- ca) (sin lamt)))
                       (t_2 (fmax (fabs one_es) (fabs sa)))
                       (t_3 (atan (* 1.0 (/ (tan lamdp) (* t_2 t_0)))))
                       (t_4 (atan (/ (/ t_1 t_2) t_0)))
                       (t_5 (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt)))))
                  (*
                   (copysign 1.0 one_es)
                   (*
                    (copysign 1.0 sa)
                    (if (<= t_5 -50000.0)
                      t_4
                      (if (<= t_5 -0.09)
                        t_3
                        (if (<= t_5 1e-172)
                          (atan (* (cos lamt) (/ lamdp (* t_0 t_2))))
                          (if (<= t_5 2e-42)
                            (atan (/ (/ t_1 t_0) t_2))
                            (if (<= t_5 10.0) t_3 t_4)))))))))
                double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                	double t_0 = fmin(fabs(one_es), fabs(sa));
                	double t_1 = -ca * sin(lamt);
                	double t_2 = fmax(fabs(one_es), fabs(sa));
                	double t_3 = atan((1.0 * (tan(lamdp) / (t_2 * t_0))));
                	double t_4 = atan(((t_1 / t_2) / t_0));
                	double t_5 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
                	double tmp;
                	if (t_5 <= -50000.0) {
                		tmp = t_4;
                	} else if (t_5 <= -0.09) {
                		tmp = t_3;
                	} else if (t_5 <= 1e-172) {
                		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_2))));
                	} else if (t_5 <= 2e-42) {
                		tmp = atan(((t_1 / t_0) / t_2));
                	} else if (t_5 <= 10.0) {
                		tmp = t_3;
                	} else {
                		tmp = t_4;
                	}
                	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
                }
                
                public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
                	double t_1 = -ca * Math.sin(lamt);
                	double t_2 = fmax(Math.abs(one_es), Math.abs(sa));
                	double t_3 = Math.atan((1.0 * (Math.tan(lamdp) / (t_2 * t_0))));
                	double t_4 = Math.atan(((t_1 / t_2) / t_0));
                	double t_5 = (Math.tan(lamdp) * Math.cos(lamt)) - (ca * Math.sin(lamt));
                	double tmp;
                	if (t_5 <= -50000.0) {
                		tmp = t_4;
                	} else if (t_5 <= -0.09) {
                		tmp = t_3;
                	} else if (t_5 <= 1e-172) {
                		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_0 * t_2))));
                	} else if (t_5 <= 2e-42) {
                		tmp = Math.atan(((t_1 / t_0) / t_2));
                	} else if (t_5 <= 10.0) {
                		tmp = t_3;
                	} else {
                		tmp = t_4;
                	}
                	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
                }
                
                def code(lamdp, lamt, ca, one_es, sa):
                	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
                	t_1 = -ca * math.sin(lamt)
                	t_2 = fmax(math.fabs(one_es), math.fabs(sa))
                	t_3 = math.atan((1.0 * (math.tan(lamdp) / (t_2 * t_0))))
                	t_4 = math.atan(((t_1 / t_2) / t_0))
                	t_5 = (math.tan(lamdp) * math.cos(lamt)) - (ca * math.sin(lamt))
                	tmp = 0
                	if t_5 <= -50000.0:
                		tmp = t_4
                	elif t_5 <= -0.09:
                		tmp = t_3
                	elif t_5 <= 1e-172:
                		tmp = math.atan((math.cos(lamt) * (lamdp / (t_0 * t_2))))
                	elif t_5 <= 2e-42:
                		tmp = math.atan(((t_1 / t_0) / t_2))
                	elif t_5 <= 10.0:
                		tmp = t_3
                	else:
                		tmp = t_4
                	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
                
                function code(lamdp, lamt, ca, one_es, sa)
                	t_0 = fmin(abs(one_es), abs(sa))
                	t_1 = Float64(Float64(-ca) * sin(lamt))
                	t_2 = fmax(abs(one_es), abs(sa))
                	t_3 = atan(Float64(1.0 * Float64(tan(lamdp) / Float64(t_2 * t_0))))
                	t_4 = atan(Float64(Float64(t_1 / t_2) / t_0))
                	t_5 = Float64(Float64(tan(lamdp) * cos(lamt)) - Float64(ca * sin(lamt)))
                	tmp = 0.0
                	if (t_5 <= -50000.0)
                		tmp = t_4;
                	elseif (t_5 <= -0.09)
                		tmp = t_3;
                	elseif (t_5 <= 1e-172)
                		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_0 * t_2))));
                	elseif (t_5 <= 2e-42)
                		tmp = atan(Float64(Float64(t_1 / t_0) / t_2));
                	elseif (t_5 <= 10.0)
                		tmp = t_3;
                	else
                		tmp = t_4;
                	end
                	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
                end
                
                function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                	t_0 = min(abs(one_es), abs(sa));
                	t_1 = -ca * sin(lamt);
                	t_2 = max(abs(one_es), abs(sa));
                	t_3 = atan((1.0 * (tan(lamdp) / (t_2 * t_0))));
                	t_4 = atan(((t_1 / t_2) / t_0));
                	t_5 = (tan(lamdp) * cos(lamt)) - (ca * sin(lamt));
                	tmp = 0.0;
                	if (t_5 <= -50000.0)
                		tmp = t_4;
                	elseif (t_5 <= -0.09)
                		tmp = t_3;
                	elseif (t_5 <= 1e-172)
                		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_2))));
                	elseif (t_5 <= 2e-42)
                		tmp = atan(((t_1 / t_0) / t_2));
                	elseif (t_5 <= 10.0)
                		tmp = t_3;
                	else
                		tmp = t_4;
                	end
                	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
                end
                
                code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(1.0 * N[(N[Tan[lamdp], $MachinePrecision] / N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[(t$95$1 / t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[Tan[lamdp], $MachinePrecision] * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] - N[(ca * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$5, -50000.0], t$95$4, If[LessEqual[t$95$5, -0.09], t$95$3, If[LessEqual[t$95$5, 1e-172], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, 2e-42], N[ArcTan[N[(N[(t$95$1 / t$95$0), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, 10.0], t$95$3, t$95$4]]]]]), $MachinePrecision]), $MachinePrecision]]]]]]]
                
                \begin{array}{l}
                t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                t_1 := \left(-ca\right) \cdot \sin lamt\\
                t_2 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                t_3 := \tan^{-1} \left(1 \cdot \frac{\tan lamdp}{t\_2 \cdot t\_0}\right)\\
                t_4 := \tan^{-1} \left(\frac{\frac{t\_1}{t\_2}}{t\_0}\right)\\
                t_5 := \tan lamdp \cdot \cos lamt - ca \cdot \sin lamt\\
                \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
                \mathbf{if}\;t\_5 \leq -50000:\\
                \;\;\;\;t\_4\\
                
                \mathbf{elif}\;t\_5 \leq -0.09:\\
                \;\;\;\;t\_3\\
                
                \mathbf{elif}\;t\_5 \leq 10^{-172}:\\
                \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_2}\right)\\
                
                \mathbf{elif}\;t\_5 \leq 2 \cdot 10^{-42}:\\
                \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_1}{t\_0}}{t\_2}\right)\\
                
                \mathbf{elif}\;t\_5 \leq 10:\\
                \;\;\;\;t\_3\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_4\\
                
                
                \end{array}\right)
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -5e4 or 10 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt)))

                  1. Initial program 96.7%

                    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                  2. Taylor expanded in lamdp around 0

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                    3. lower-sin.f6461.9%

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                  4. Applied rewrites61.9%

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                  5. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                    2. mult-flipN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
                    3. *-commutativeN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                    4. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                    5. lower-/.f6461.9%

                      \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                    6. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                    8. lower-*.f6461.9%

                      \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                    9. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
                    10. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
                    11. associate-*r*N/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                    12. mul-1-negN/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                    13. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                    14. lower-neg.f6461.9%

                      \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                  6. Applied rewrites61.9%

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                  7. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                    2. *-commutativeN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
                    3. lift-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
                    4. mult-flip-revN/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
                    5. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
                    6. associate-/r*N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                    7. lower-/.f64N/A

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                    8. lower-/.f6464.2%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
                  8. Applied rewrites64.2%

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

                  if -5e4 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < -0.089999999999999997 or 2.0000000000000001e-42 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 10

                  1. Initial program 96.7%

                    \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                  2. Taylor expanded in ca around 0

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    3. lower-cos.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. lower-sin.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    5. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                    6. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                    7. lower-cos.f6463.7%

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                  4. Applied rewrites63.7%

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                  5. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                    2. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    3. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                    4. times-fracN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                    7. associate-/r*N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                    8. lift-sin.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                    9. lift-cos.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                    10. tan-quotN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                    11. lift-tan.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                    12. times-fracN/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    13. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                    14. associate-/l*N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                    15. lower-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                    16. lower-/.f6463.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    17. lift-*.f64N/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                    18. *-commutativeN/A

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    19. lower-*.f6463.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                  6. Applied rewrites63.7%

                    \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                  7. Taylor expanded in lamt around 0

                    \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]
                  8. Step-by-step derivation
                    1. Applied rewrites53.3%

                      \[\leadsto \tan^{-1} \left(1 \cdot \frac{\color{blue}{\tan lamdp}}{sa \cdot one\_es}\right) \]

                    if -0.089999999999999997 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 1e-172

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      4. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                      7. associate-/r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      9. lift-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      10. tan-quotN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      12. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      14. associate-/l*N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      16. lower-/.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      18. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                      19. lower-*.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    6. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                    7. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                    9. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]

                    if 1e-172 < (-.f64 (*.f64 (tan.f64 lamdp) (cos.f64 lamt)) (*.f64 ca (sin.f64 lamt))) < 2.0000000000000001e-42

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      4. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      5. lower-/.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}{sa}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es}}{sa}\right) \]
                      7. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es}}{sa}\right) \]
                      8. associate-*r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      11. lower-neg.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                    6. Applied rewrites64.1%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}{sa}\right)} \]
                  9. Recombined 4 regimes into one program.
                  10. Add Preprocessing

                  Alternative 14: 74.0% accurate, 1.5× speedup?

                  \[\begin{array}{l} t_0 := \left(-ca\right) \cdot \sin lamt\\ t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_2 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;ca \leq -3.9 \cdot 10^{-53}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\ \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_2 \cdot t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_2}}{t\_1}\right)\\ \end{array}\right) \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0 (* (- ca) (sin lamt)))
                         (t_1 (fmax (fabs one_es) (fabs sa)))
                         (t_2 (fmin (fabs one_es) (fabs sa))))
                    (*
                     (copysign 1.0 one_es)
                     (*
                      (copysign 1.0 sa)
                      (if (<= ca -3.9e-53)
                        (atan (/ (/ t_0 t_1) t_2))
                        (if (<= ca 5.2e-71)
                          (atan (* (cos lamt) (/ lamdp (* t_2 t_1))))
                          (atan (/ (/ t_0 t_2) t_1))))))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = -ca * sin(lamt);
                  	double t_1 = fmax(fabs(one_es), fabs(sa));
                  	double t_2 = fmin(fabs(one_es), fabs(sa));
                  	double tmp;
                  	if (ca <= -3.9e-53) {
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = atan((cos(lamt) * (lamdp / (t_2 * t_1))));
                  	} else {
                  		tmp = atan(((t_0 / t_2) / t_1));
                  	}
                  	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
                  }
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = -ca * Math.sin(lamt);
                  	double t_1 = fmax(Math.abs(one_es), Math.abs(sa));
                  	double t_2 = fmin(Math.abs(one_es), Math.abs(sa));
                  	double tmp;
                  	if (ca <= -3.9e-53) {
                  		tmp = Math.atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_2 * t_1))));
                  	} else {
                  		tmp = Math.atan(((t_0 / t_2) / t_1));
                  	}
                  	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	t_0 = -ca * math.sin(lamt)
                  	t_1 = fmax(math.fabs(one_es), math.fabs(sa))
                  	t_2 = fmin(math.fabs(one_es), math.fabs(sa))
                  	tmp = 0
                  	if ca <= -3.9e-53:
                  		tmp = math.atan(((t_0 / t_1) / t_2))
                  	elif ca <= 5.2e-71:
                  		tmp = math.atan((math.cos(lamt) * (lamdp / (t_2 * t_1))))
                  	else:
                  		tmp = math.atan(((t_0 / t_2) / t_1))
                  	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = Float64(Float64(-ca) * sin(lamt))
                  	t_1 = fmax(abs(one_es), abs(sa))
                  	t_2 = fmin(abs(one_es), abs(sa))
                  	tmp = 0.0
                  	if (ca <= -3.9e-53)
                  		tmp = atan(Float64(Float64(t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_2 * t_1))));
                  	else
                  		tmp = atan(Float64(Float64(t_0 / t_2) / t_1));
                  	end
                  	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = -ca * sin(lamt);
                  	t_1 = max(abs(one_es), abs(sa));
                  	t_2 = min(abs(one_es), abs(sa));
                  	tmp = 0.0;
                  	if (ca <= -3.9e-53)
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan((cos(lamt) * (lamdp / (t_2 * t_1))));
                  	else
                  		tmp = atan(((t_0 / t_2) / t_1));
                  	end
                  	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[ca, -3.9e-53], N[ArcTan[N[(N[(t$95$0 / t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[ca, 5.2e-71], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[(t$95$0 / t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  t_0 := \left(-ca\right) \cdot \sin lamt\\
                  t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                  t_2 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                  \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
                  \mathbf{if}\;ca \leq -3.9 \cdot 10^{-53}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\
                  
                  \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\
                  \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_2 \cdot t\_1}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_2}}{t\_1}\right)\\
                  
                  
                  \end{array}\right)
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if ca < -3.9000000000000002e-53

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                      2. mult-flipN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\left(-1 \cdot \left(ca \cdot \sin lamt\right)\right) \cdot \frac{1}{one\_es \cdot sa}\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{one\_es \cdot sa} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right)} \]
                      5. lower-/.f6461.9%

                        \[\leadsto \tan^{-1} \left(\color{blue}{\frac{1}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{one\_es \cdot sa}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                      8. lower-*.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{1}{\color{blue}{sa \cdot one\_es}} \cdot \left(-1 \cdot \left(ca \cdot \sin lamt\right)\right)\right) \]
                      9. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}\right)\right) \]
                      10. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)\right)\right) \]
                      11. associate-*r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                      12. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}\right)\right) \]
                      14. lower-neg.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin \color{blue}{lamt}\right)\right) \]
                    6. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                    7. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{sa \cdot one\_es} \cdot \left(\left(-ca\right) \cdot \sin lamt\right)\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \frac{1}{sa \cdot one\_es}\right)} \]
                      3. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\left(\left(-ca\right) \cdot \sin lamt\right) \cdot \color{blue}{\frac{1}{sa \cdot one\_es}}\right) \]
                      4. mult-flip-revN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(-ca\right) \cdot \sin lamt}{sa \cdot one\_es}\right)} \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\left(-ca\right) \cdot \sin lamt}{\color{blue}{sa \cdot one\_es}}\right) \]
                      6. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                      7. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]
                      8. lower-/.f6464.2%

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}}{one\_es}\right) \]
                    8. Applied rewrites64.2%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{sa}}{one\_es}\right)} \]

                    if -3.9000000000000002e-53 < ca < 5.1999999999999997e-71

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      4. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                      7. associate-/r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      9. lift-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      10. tan-quotN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      12. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      14. associate-/l*N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      16. lower-/.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      18. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                      19. lower-*.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    6. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                    7. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                    9. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]

                    if 5.1999999999999997e-71 < ca

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      4. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      5. lower-/.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}{sa}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es}}{sa}\right) \]
                      7. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es}}{sa}\right) \]
                      8. associate-*r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      11. lower-neg.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                    6. Applied rewrites64.1%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}{sa}\right)} \]
                  3. Recombined 3 regimes into one program.
                  4. Add Preprocessing

                  Alternative 15: 73.7% accurate, 1.5× speedup?

                  \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\ t_2 := \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_0}}{t\_1}\right)\\ \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;ca \leq -2.3 \cdot 10^{-53}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0 (fmin (fabs one_es) (fabs sa)))
                         (t_1 (fmax (fabs one_es) (fabs sa)))
                         (t_2 (atan (/ (/ (* (- ca) (sin lamt)) t_0) t_1))))
                    (*
                     (copysign 1.0 one_es)
                     (*
                      (copysign 1.0 sa)
                      (if (<= ca -2.3e-53)
                        t_2
                        (if (<= ca 5.2e-71)
                          (atan (* (cos lamt) (/ lamdp (* t_0 t_1))))
                          t_2))))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = fmin(fabs(one_es), fabs(sa));
                  	double t_1 = fmax(fabs(one_es), fabs(sa));
                  	double t_2 = atan((((-ca * sin(lamt)) / t_0) / t_1));
                  	double tmp;
                  	if (ca <= -2.3e-53) {
                  		tmp = t_2;
                  	} else if (ca <= 5.2e-71) {
                  		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_1))));
                  	} else {
                  		tmp = t_2;
                  	}
                  	return copysign(1.0, one_es) * (copysign(1.0, sa) * tmp);
                  }
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = fmin(Math.abs(one_es), Math.abs(sa));
                  	double t_1 = fmax(Math.abs(one_es), Math.abs(sa));
                  	double t_2 = Math.atan((((-ca * Math.sin(lamt)) / t_0) / t_1));
                  	double tmp;
                  	if (ca <= -2.3e-53) {
                  		tmp = t_2;
                  	} else if (ca <= 5.2e-71) {
                  		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_0 * t_1))));
                  	} else {
                  		tmp = t_2;
                  	}
                  	return Math.copySign(1.0, one_es) * (Math.copySign(1.0, sa) * tmp);
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	t_0 = fmin(math.fabs(one_es), math.fabs(sa))
                  	t_1 = fmax(math.fabs(one_es), math.fabs(sa))
                  	t_2 = math.atan((((-ca * math.sin(lamt)) / t_0) / t_1))
                  	tmp = 0
                  	if ca <= -2.3e-53:
                  		tmp = t_2
                  	elif ca <= 5.2e-71:
                  		tmp = math.atan((math.cos(lamt) * (lamdp / (t_0 * t_1))))
                  	else:
                  		tmp = t_2
                  	return math.copysign(1.0, one_es) * (math.copysign(1.0, sa) * tmp)
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = fmin(abs(one_es), abs(sa))
                  	t_1 = fmax(abs(one_es), abs(sa))
                  	t_2 = atan(Float64(Float64(Float64(Float64(-ca) * sin(lamt)) / t_0) / t_1))
                  	tmp = 0.0
                  	if (ca <= -2.3e-53)
                  		tmp = t_2;
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_0 * t_1))));
                  	else
                  		tmp = t_2;
                  	end
                  	return Float64(copysign(1.0, one_es) * Float64(copysign(1.0, sa) * tmp))
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = min(abs(one_es), abs(sa));
                  	t_1 = max(abs(one_es), abs(sa));
                  	t_2 = atan((((-ca * sin(lamt)) / t_0) / t_1));
                  	tmp = 0.0;
                  	if (ca <= -2.3e-53)
                  		tmp = t_2;
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan((cos(lamt) * (lamdp / (t_0 * t_1))));
                  	else
                  		tmp = t_2;
                  	end
                  	tmp_2 = (sign(one_es) * abs(1.0)) * ((sign(sa) * abs(1.0)) * tmp);
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[Min[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[one$95$es], $MachinePrecision], N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(N[((-ca) * N[Sin[lamt], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[one$95$es]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[ca, -2.3e-53], t$95$2, If[LessEqual[ca, 5.2e-71], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]), $MachinePrecision]), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  t_0 := \mathsf{min}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                  t_1 := \mathsf{max}\left(\left|one\_es\right|, \left|sa\right|\right)\\
                  t_2 := \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{t\_0}}{t\_1}\right)\\
                  \mathsf{copysign}\left(1, one\_es\right) \cdot \left(\mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
                  \mathbf{if}\;ca \leq -2.3 \cdot 10^{-53}:\\
                  \;\;\;\;t\_2\\
                  
                  \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\
                  \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_0 \cdot t\_1}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_2\\
                  
                  
                  \end{array}\right)
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if ca < -2.3000000000000001e-53 or 5.1999999999999997e-71 < ca

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      4. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}{sa}\right)} \]
                      5. lower-/.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es}}}{sa}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es}}{sa}\right) \]
                      7. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es}}{sa}\right) \]
                      8. associate-*r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \color{blue}{\sin lamt}}{one\_es}}{sa}\right) \]
                      11. lower-neg.f6464.1%

                        \[\leadsto \tan^{-1} \left(\frac{\frac{\left(-ca\right) \cdot \sin \color{blue}{lamt}}{one\_es}}{sa}\right) \]
                    6. Applied rewrites64.1%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(-ca\right) \cdot \sin lamt}{one\_es}}{sa}\right)} \]

                    if -2.3000000000000001e-53 < ca < 5.1999999999999997e-71

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      4. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                      7. associate-/r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      9. lift-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      10. tan-quotN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      12. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      14. associate-/l*N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      16. lower-/.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      18. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                      19. lower-*.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    6. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                    7. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                    9. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 16: 71.1% accurate, 2.1× speedup?

                  \[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{\sin lamt \cdot \left(-ca\right)}{one\_es \cdot sa}\right)\\ \mathbf{if}\;ca \leq -2.3 \cdot 10^{-53}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0 (atan (/ (* (sin lamt) (- ca)) (* one_es sa)))))
                    (if (<= ca -2.3e-53)
                      t_0
                      (if (<= ca 5.2e-71)
                        (atan (* (cos lamt) (/ lamdp (* one_es sa))))
                        t_0))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = atan(((sin(lamt) * -ca) / (one_es * sa)));
                  	double tmp;
                  	if (ca <= -2.3e-53) {
                  		tmp = t_0;
                  	} else if (ca <= 5.2e-71) {
                  		tmp = atan((cos(lamt) * (lamdp / (one_es * sa))));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(lamdp, lamt, ca, one_es, sa)
                  use fmin_fmax_functions
                      real(8), intent (in) :: lamdp
                      real(8), intent (in) :: lamt
                      real(8), intent (in) :: ca
                      real(8), intent (in) :: one_es
                      real(8), intent (in) :: sa
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = atan(((sin(lamt) * -ca) / (one_es * sa)))
                      if (ca <= (-2.3d-53)) then
                          tmp = t_0
                      else if (ca <= 5.2d-71) then
                          tmp = atan((cos(lamt) * (lamdp / (one_es * sa))))
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = Math.atan(((Math.sin(lamt) * -ca) / (one_es * sa)));
                  	double tmp;
                  	if (ca <= -2.3e-53) {
                  		tmp = t_0;
                  	} else if (ca <= 5.2e-71) {
                  		tmp = Math.atan((Math.cos(lamt) * (lamdp / (one_es * sa))));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	t_0 = math.atan(((math.sin(lamt) * -ca) / (one_es * sa)))
                  	tmp = 0
                  	if ca <= -2.3e-53:
                  		tmp = t_0
                  	elif ca <= 5.2e-71:
                  		tmp = math.atan((math.cos(lamt) * (lamdp / (one_es * sa))))
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = atan(Float64(Float64(sin(lamt) * Float64(-ca)) / Float64(one_es * sa)))
                  	tmp = 0.0
                  	if (ca <= -2.3e-53)
                  		tmp = t_0;
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(one_es * sa))));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = atan(((sin(lamt) * -ca) / (one_es * sa)));
                  	tmp = 0.0;
                  	if (ca <= -2.3e-53)
                  		tmp = t_0;
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan((cos(lamt) * (lamdp / (one_es * sa))));
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[ArcTan[N[(N[(N[Sin[lamt], $MachinePrecision] * (-ca)), $MachinePrecision] / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ca, -2.3e-53], t$95$0, If[LessEqual[ca, 5.2e-71], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(one$95$es * sa), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]
                  
                  f(lamdp, lamt, ca, one_es, sa):
                  	lamdp in [-inf, +inf],
                  	lamt in [-inf, +inf],
                  	ca in [-inf, +inf],
                  	one_es in [-inf, +inf],
                  	sa in [-inf, +inf]
                  code: THEORY
                  BEGIN
                  f(lamdp, lamt, ca, one_es, sa: real): real =
                  	LET t_0 = (atan((((sin(lamt)) * (- ca)) / (one_es * sa)))) IN
                  		LET tmp_1 = IF (ca <= (51999999999999997200854947069912431079022772637829376591480882318659722597362398162754541116632406650803952489103832099832937233245082513237751020631650455937387550546559798238244187729151235544122755527496337890625e-285)) THEN (atan(((cos(lamt)) * (lamdp / (one_es * sa))))) ELSE t_0 ENDIF IN
                  		LET tmp = IF (ca <= (-230000000000000012879349904392203014443046892407242736861512823798692403166447348251053572979275094381800949352384342051152362479816797236065184506514924578368663787841796875e-226)) THEN t_0 ELSE tmp_1 ENDIF IN
                  	tmp
                  END code
                  \begin{array}{l}
                  t_0 := \tan^{-1} \left(\frac{\sin lamt \cdot \left(-ca\right)}{one\_es \cdot sa}\right)\\
                  \mathbf{if}\;ca \leq -2.3 \cdot 10^{-53}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\
                  \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if ca < -2.3000000000000001e-53 or 5.1999999999999997e-71 < ca

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\left(-1 \cdot ca\right) \cdot \color{blue}{\sin lamt}}{one\_es \cdot sa}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\left(\mathsf{neg}\left(ca\right)\right) \cdot \sin \color{blue}{lamt}}{one\_es \cdot sa}\right) \]
                      5. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot \color{blue}{\left(\mathsf{neg}\left(ca\right)\right)}}{one\_es \cdot sa}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot \color{blue}{\left(\mathsf{neg}\left(ca\right)\right)}}{one\_es \cdot sa}\right) \]
                      7. lower-neg.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot \left(-ca\right)}{one\_es \cdot sa}\right) \]
                    6. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\sin lamt \cdot \color{blue}{\left(-ca\right)}}{one\_es \cdot sa}\right) \]

                    if -2.3000000000000001e-53 < ca < 5.1999999999999997e-71

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      4. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                      7. associate-/r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      9. lift-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      10. tan-quotN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      12. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      14. associate-/l*N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      16. lower-/.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      18. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                      19. lower-*.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    6. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                    7. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                    9. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 17: 56.1% accurate, 1.7× speedup?

                  \[\begin{array}{l} t_0 := \left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt\\ t_1 := \mathsf{max}\left(one\_es, \left|sa\right|\right)\\ t_2 := \mathsf{min}\left(one\_es, \left|sa\right|\right)\\ \mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;ca \leq -4.8 \cdot 10^{+63}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\ \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_2 \cdot t\_1}\right)\\ \mathbf{elif}\;ca \leq 1.2 \cdot 10^{+39}:\\ \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{t\_1 \cdot t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{t\_0}{t\_2} \cdot \frac{1}{t\_1}\right)\\ \end{array} \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0
                          (* (- (* (* (* ca lamt) lamt) 0.16666666666666666) ca) lamt))
                         (t_1 (fmax one_es (fabs sa)))
                         (t_2 (fmin one_es (fabs sa))))
                    (*
                     (copysign 1.0 sa)
                     (if (<= ca -4.8e+63)
                       (atan (/ (/ t_0 t_1) t_2))
                       (if (<= ca 5.2e-71)
                         (atan (* (cos lamt) (/ lamdp (* t_2 t_1))))
                         (if (<= ca 1.2e+39)
                           (atan (/ (- (* ca lamt)) (* t_1 t_2)))
                           (atan (* (/ t_0 t_2) (/ 1.0 t_1)))))))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	double t_1 = fmax(one_es, fabs(sa));
                  	double t_2 = fmin(one_es, fabs(sa));
                  	double tmp;
                  	if (ca <= -4.8e+63) {
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = atan((cos(lamt) * (lamdp / (t_2 * t_1))));
                  	} else if (ca <= 1.2e+39) {
                  		tmp = atan((-(ca * lamt) / (t_1 * t_2)));
                  	} else {
                  		tmp = atan(((t_0 / t_2) * (1.0 / t_1)));
                  	}
                  	return copysign(1.0, sa) * tmp;
                  }
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	double t_1 = fmax(one_es, Math.abs(sa));
                  	double t_2 = fmin(one_es, Math.abs(sa));
                  	double tmp;
                  	if (ca <= -4.8e+63) {
                  		tmp = Math.atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = Math.atan((Math.cos(lamt) * (lamdp / (t_2 * t_1))));
                  	} else if (ca <= 1.2e+39) {
                  		tmp = Math.atan((-(ca * lamt) / (t_1 * t_2)));
                  	} else {
                  		tmp = Math.atan(((t_0 / t_2) * (1.0 / t_1)));
                  	}
                  	return Math.copySign(1.0, sa) * tmp;
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt
                  	t_1 = fmax(one_es, math.fabs(sa))
                  	t_2 = fmin(one_es, math.fabs(sa))
                  	tmp = 0
                  	if ca <= -4.8e+63:
                  		tmp = math.atan(((t_0 / t_1) / t_2))
                  	elif ca <= 5.2e-71:
                  		tmp = math.atan((math.cos(lamt) * (lamdp / (t_2 * t_1))))
                  	elif ca <= 1.2e+39:
                  		tmp = math.atan((-(ca * lamt) / (t_1 * t_2)))
                  	else:
                  		tmp = math.atan(((t_0 / t_2) * (1.0 / t_1)))
                  	return math.copysign(1.0, sa) * tmp
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = Float64(Float64(Float64(Float64(Float64(ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt)
                  	t_1 = fmax(one_es, abs(sa))
                  	t_2 = fmin(one_es, abs(sa))
                  	tmp = 0.0
                  	if (ca <= -4.8e+63)
                  		tmp = atan(Float64(Float64(t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(Float64(cos(lamt) * Float64(lamdp / Float64(t_2 * t_1))));
                  	elseif (ca <= 1.2e+39)
                  		tmp = atan(Float64(Float64(-Float64(ca * lamt)) / Float64(t_1 * t_2)));
                  	else
                  		tmp = atan(Float64(Float64(t_0 / t_2) * Float64(1.0 / t_1)));
                  	end
                  	return Float64(copysign(1.0, sa) * tmp)
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	t_1 = max(one_es, abs(sa));
                  	t_2 = min(one_es, abs(sa));
                  	tmp = 0.0;
                  	if (ca <= -4.8e+63)
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan((cos(lamt) * (lamdp / (t_2 * t_1))));
                  	elseif (ca <= 1.2e+39)
                  		tmp = atan((-(ca * lamt) / (t_1 * t_2)));
                  	else
                  		tmp = atan(((t_0 / t_2) * (1.0 / t_1)));
                  	end
                  	tmp_2 = (sign(sa) * abs(1.0)) * tmp;
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[(N[(N[(N[(N[(ca * lamt), $MachinePrecision] * lamt), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - ca), $MachinePrecision] * lamt), $MachinePrecision]}, Block[{t$95$1 = N[Max[one$95$es, N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Min[one$95$es, N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[ca, -4.8e+63], N[ArcTan[N[(N[(t$95$0 / t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[ca, 5.2e-71], N[ArcTan[N[(N[Cos[lamt], $MachinePrecision] * N[(lamdp / N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ca, 1.2e+39], N[ArcTan[N[((-N[(ca * lamt), $MachinePrecision]) / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[(t$95$0 / t$95$2), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  t_0 := \left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt\\
                  t_1 := \mathsf{max}\left(one\_es, \left|sa\right|\right)\\
                  t_2 := \mathsf{min}\left(one\_es, \left|sa\right|\right)\\
                  \mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
                  \mathbf{if}\;ca \leq -4.8 \cdot 10^{+63}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\
                  
                  \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\
                  \;\;\;\;\tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{t\_2 \cdot t\_1}\right)\\
                  
                  \mathbf{elif}\;ca \leq 1.2 \cdot 10^{+39}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{t\_1 \cdot t\_2}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{t\_0}{t\_2} \cdot \frac{1}{t\_1}\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if ca < -4.8e63

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{sa \cdot one\_es}}\right) \]
                      4. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                      5. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                    9. Applied rewrites43.0%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa}}{one\_es}\right)} \]

                    if -4.8e63 < ca < 5.1999999999999997e-71

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      4. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \color{blue}{\frac{\sin lamdp}{sa \cdot \cos lamdp}}\right) \]
                      5. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{sa \cdot \color{blue}{\cos lamdp}}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\sin lamdp}{\cos lamdp \cdot \color{blue}{sa}}\right) \]
                      7. associate-/r*N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{\color{blue}{sa}}\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      9. lift-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\frac{\sin lamdp}{\cos lamdp}}{sa}\right) \]
                      10. tan-quotN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt}{one\_es} \cdot \frac{\tan lamdp}{sa}\right) \]
                      12. times-fracN/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      13. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      14. associate-/l*N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{one\_es \cdot sa}}\right) \]
                      16. lower-/.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                      17. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      18. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                      19. lower-*.f6463.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{\tan lamdp}{sa \cdot \color{blue}{one\_es}}\right) \]
                    6. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \color{blue}{\frac{\tan lamdp}{sa \cdot one\_es}}\right) \]
                    7. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{one\_es \cdot sa}\right) \]
                    9. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\cos lamt \cdot \frac{lamdp}{\color{blue}{one\_es \cdot sa}}\right) \]

                    if 5.1999999999999997e-71 < ca < 1.2e39

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                      3. lower-neg.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{one\_es \cdot sa}\right) \]
                      4. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(one\_es \cdot sa\right)\right)}\right) \]
                      5. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(*-commutative, \left(sa \cdot one\_es\right)\right)}\right) \]
                      6. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(lift-*.f64, \left(sa \cdot one\_es\right)\right)}\right) \]
                    9. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)} \]

                    if 1.2e39 < ca

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es}}{sa}\right)} \]
                      4. mult-flipN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es} \cdot \frac{1}{sa}\right)} \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es} \cdot \frac{1}{sa}\right)} \]
                    9. Applied rewrites43.0%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{one\_es} \cdot \frac{1}{sa}\right)} \]
                  3. Recombined 4 regimes into one program.
                  4. Add Preprocessing

                  Alternative 18: 56.1% accurate, 1.7× speedup?

                  \[\begin{array}{l} t_0 := \left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt\\ t_1 := \mathsf{max}\left(one\_es, \left|sa\right|\right)\\ t_2 := \mathsf{min}\left(one\_es, \left|sa\right|\right)\\ \mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l} \mathbf{if}\;ca \leq -4.8 \cdot 10^{+63}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\ \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{t\_2 \cdot t\_1}\right)\\ \mathbf{elif}\;ca \leq 1.2 \cdot 10^{+39}:\\ \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{t\_1 \cdot t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{t\_0}{t\_2} \cdot \frac{1}{t\_1}\right)\\ \end{array} \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0
                          (* (- (* (* (* ca lamt) lamt) 0.16666666666666666) ca) lamt))
                         (t_1 (fmax one_es (fabs sa)))
                         (t_2 (fmin one_es (fabs sa))))
                    (*
                     (copysign 1.0 sa)
                     (if (<= ca -4.8e+63)
                       (atan (/ (/ t_0 t_1) t_2))
                       (if (<= ca 5.2e-71)
                         (atan (/ (* lamdp (cos lamt)) (* t_2 t_1)))
                         (if (<= ca 1.2e+39)
                           (atan (/ (- (* ca lamt)) (* t_1 t_2)))
                           (atan (* (/ t_0 t_2) (/ 1.0 t_1)))))))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	double t_1 = fmax(one_es, fabs(sa));
                  	double t_2 = fmin(one_es, fabs(sa));
                  	double tmp;
                  	if (ca <= -4.8e+63) {
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = atan(((lamdp * cos(lamt)) / (t_2 * t_1)));
                  	} else if (ca <= 1.2e+39) {
                  		tmp = atan((-(ca * lamt) / (t_1 * t_2)));
                  	} else {
                  		tmp = atan(((t_0 / t_2) * (1.0 / t_1)));
                  	}
                  	return copysign(1.0, sa) * tmp;
                  }
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	double t_1 = fmax(one_es, Math.abs(sa));
                  	double t_2 = fmin(one_es, Math.abs(sa));
                  	double tmp;
                  	if (ca <= -4.8e+63) {
                  		tmp = Math.atan(((t_0 / t_1) / t_2));
                  	} else if (ca <= 5.2e-71) {
                  		tmp = Math.atan(((lamdp * Math.cos(lamt)) / (t_2 * t_1)));
                  	} else if (ca <= 1.2e+39) {
                  		tmp = Math.atan((-(ca * lamt) / (t_1 * t_2)));
                  	} else {
                  		tmp = Math.atan(((t_0 / t_2) * (1.0 / t_1)));
                  	}
                  	return Math.copySign(1.0, sa) * tmp;
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt
                  	t_1 = fmax(one_es, math.fabs(sa))
                  	t_2 = fmin(one_es, math.fabs(sa))
                  	tmp = 0
                  	if ca <= -4.8e+63:
                  		tmp = math.atan(((t_0 / t_1) / t_2))
                  	elif ca <= 5.2e-71:
                  		tmp = math.atan(((lamdp * math.cos(lamt)) / (t_2 * t_1)))
                  	elif ca <= 1.2e+39:
                  		tmp = math.atan((-(ca * lamt) / (t_1 * t_2)))
                  	else:
                  		tmp = math.atan(((t_0 / t_2) * (1.0 / t_1)))
                  	return math.copysign(1.0, sa) * tmp
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = Float64(Float64(Float64(Float64(Float64(ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt)
                  	t_1 = fmax(one_es, abs(sa))
                  	t_2 = fmin(one_es, abs(sa))
                  	tmp = 0.0
                  	if (ca <= -4.8e+63)
                  		tmp = atan(Float64(Float64(t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(Float64(Float64(lamdp * cos(lamt)) / Float64(t_2 * t_1)));
                  	elseif (ca <= 1.2e+39)
                  		tmp = atan(Float64(Float64(-Float64(ca * lamt)) / Float64(t_1 * t_2)));
                  	else
                  		tmp = atan(Float64(Float64(t_0 / t_2) * Float64(1.0 / t_1)));
                  	end
                  	return Float64(copysign(1.0, sa) * tmp)
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	t_0 = ((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt;
                  	t_1 = max(one_es, abs(sa));
                  	t_2 = min(one_es, abs(sa));
                  	tmp = 0.0;
                  	if (ca <= -4.8e+63)
                  		tmp = atan(((t_0 / t_1) / t_2));
                  	elseif (ca <= 5.2e-71)
                  		tmp = atan(((lamdp * cos(lamt)) / (t_2 * t_1)));
                  	elseif (ca <= 1.2e+39)
                  		tmp = atan((-(ca * lamt) / (t_1 * t_2)));
                  	else
                  		tmp = atan(((t_0 / t_2) * (1.0 / t_1)));
                  	end
                  	tmp_2 = (sign(sa) * abs(1.0)) * tmp;
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := Block[{t$95$0 = N[(N[(N[(N[(N[(ca * lamt), $MachinePrecision] * lamt), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - ca), $MachinePrecision] * lamt), $MachinePrecision]}, Block[{t$95$1 = N[Max[one$95$es, N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Min[one$95$es, N[Abs[sa], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[sa]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[ca, -4.8e+63], N[ArcTan[N[(N[(t$95$0 / t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[ca, 5.2e-71], N[ArcTan[N[(N[(lamdp * N[Cos[lamt], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ca, 1.2e+39], N[ArcTan[N[((-N[(ca * lamt), $MachinePrecision]) / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[(t$95$0 / t$95$2), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  t_0 := \left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt\\
                  t_1 := \mathsf{max}\left(one\_es, \left|sa\right|\right)\\
                  t_2 := \mathsf{min}\left(one\_es, \left|sa\right|\right)\\
                  \mathsf{copysign}\left(1, sa\right) \cdot \begin{array}{l}
                  \mathbf{if}\;ca \leq -4.8 \cdot 10^{+63}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\frac{t\_0}{t\_1}}{t\_2}\right)\\
                  
                  \mathbf{elif}\;ca \leq 5.2 \cdot 10^{-71}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{t\_2 \cdot t\_1}\right)\\
                  
                  \mathbf{elif}\;ca \leq 1.2 \cdot 10^{+39}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{t\_1 \cdot t\_2}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{t\_0}{t\_2} \cdot \frac{1}{t\_1}\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if ca < -4.8e63

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{sa \cdot one\_es}}\right) \]
                      4. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                      5. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                    9. Applied rewrites43.0%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa}}{one\_es}\right)} \]

                    if -4.8e63 < ca < 5.1999999999999997e-71

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in ca around 0

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{\color{blue}{one\_es} \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      4. lower-sin.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \color{blue}{\left(sa \cdot \cos lamdp\right)}}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \color{blue}{\cos lamdp}\right)}\right) \]
                      7. lower-cos.f6463.7%

                        \[\leadsto \tan^{-1} \left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right) \]
                    4. Applied rewrites63.7%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\cos lamt \cdot \sin lamdp}{one\_es \cdot \left(sa \cdot \cos lamdp\right)}\right)} \]
                    5. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{\color{blue}{one\_es \cdot sa}}\right) \]
                    6. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{one\_es \cdot \color{blue}{sa}}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{one\_es \cdot sa}\right) \]
                      3. lower-cos.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{one\_es \cdot sa}\right) \]
                      4. lower-*.f6445.7%

                        \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites45.7%

                      \[\leadsto \tan^{-1} \left(\frac{lamdp \cdot \cos lamt}{\color{blue}{one\_es \cdot sa}}\right) \]

                    if 5.1999999999999997e-71 < ca < 1.2e39

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                      3. lower-neg.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{one\_es \cdot sa}\right) \]
                      4. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(one\_es \cdot sa\right)\right)}\right) \]
                      5. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(*-commutative, \left(sa \cdot one\_es\right)\right)}\right) \]
                      6. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(lift-*.f64, \left(sa \cdot one\_es\right)\right)}\right) \]
                    9. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)} \]

                    if 1.2e39 < ca

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es}}{sa}\right)} \]
                      4. mult-flipN/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es} \cdot \frac{1}{sa}\right)} \]
                      5. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es} \cdot \frac{1}{sa}\right)} \]
                    9. Applied rewrites43.0%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{one\_es} \cdot \frac{1}{sa}\right)} \]
                  3. Recombined 4 regimes into one program.
                  4. Add Preprocessing

                  Alternative 19: 44.6% accurate, 3.6× speedup?

                  \[\begin{array}{l} \mathbf{if}\;lamt \leq -4.2 \cdot 10^{+59}:\\ \;\;\;\;\tan^{-1} \left(\frac{\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa}}{one\_es}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)\\ \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (if (<= lamt -4.2e+59)
                    (atan
                     (/
                      (/
                       (* (- (* (* (* ca lamt) lamt) 0.16666666666666666) ca) lamt)
                       sa)
                      one_es))
                    (atan (/ (- (* ca lamt)) (* sa one_es)))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double tmp;
                  	if (lamt <= -4.2e+59) {
                  		tmp = atan((((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / sa) / one_es));
                  	} else {
                  		tmp = atan((-(ca * lamt) / (sa * one_es)));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(lamdp, lamt, ca, one_es, sa)
                  use fmin_fmax_functions
                      real(8), intent (in) :: lamdp
                      real(8), intent (in) :: lamt
                      real(8), intent (in) :: ca
                      real(8), intent (in) :: one_es
                      real(8), intent (in) :: sa
                      real(8) :: tmp
                      if (lamt <= (-4.2d+59)) then
                          tmp = atan((((((((ca * lamt) * lamt) * 0.16666666666666666d0) - ca) * lamt) / sa) / one_es))
                      else
                          tmp = atan((-(ca * lamt) / (sa * one_es)))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double tmp;
                  	if (lamt <= -4.2e+59) {
                  		tmp = Math.atan((((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / sa) / one_es));
                  	} else {
                  		tmp = Math.atan((-(ca * lamt) / (sa * one_es)));
                  	}
                  	return tmp;
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	tmp = 0
                  	if lamt <= -4.2e+59:
                  		tmp = math.atan((((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / sa) / one_es))
                  	else:
                  		tmp = math.atan((-(ca * lamt) / (sa * one_es)))
                  	return tmp
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	tmp = 0.0
                  	if (lamt <= -4.2e+59)
                  		tmp = atan(Float64(Float64(Float64(Float64(Float64(Float64(Float64(ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / sa) / one_es));
                  	else
                  		tmp = atan(Float64(Float64(-Float64(ca * lamt)) / Float64(sa * one_es)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	tmp = 0.0;
                  	if (lamt <= -4.2e+59)
                  		tmp = atan((((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / sa) / one_es));
                  	else
                  		tmp = atan((-(ca * lamt) / (sa * one_es)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := If[LessEqual[lamt, -4.2e+59], N[ArcTan[N[(N[(N[(N[(N[(N[(N[(ca * lamt), $MachinePrecision] * lamt), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - ca), $MachinePrecision] * lamt), $MachinePrecision] / sa), $MachinePrecision] / one$95$es), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[((-N[(ca * lamt), $MachinePrecision]) / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                  
                  f(lamdp, lamt, ca, one_es, sa):
                  	lamdp in [-inf, +inf],
                  	lamt in [-inf, +inf],
                  	ca in [-inf, +inf],
                  	one_es in [-inf, +inf],
                  	sa in [-inf, +inf]
                  code: THEORY
                  BEGIN
                  f(lamdp, lamt, ca, one_es, sa: real): real =
                  	LET tmp = IF (lamt <= (-419999999999999968038239129476388816187586133754418707824640)) THEN (atan((((((((ca * lamt) * lamt) * (1666666666666666574148081281236954964697360992431640625e-55)) - ca) * lamt) / sa) / one_es))) ELSE (atan(((- (ca * lamt)) / (sa * one_es)))) ENDIF IN
                  	tmp
                  END code
                  \begin{array}{l}
                  \mathbf{if}\;lamt \leq -4.2 \cdot 10^{+59}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa}}{one\_es}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if lamt < -4.1999999999999997e59

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right)} \]
                      2. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{one\_es \cdot sa}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{\color{blue}{sa \cdot one\_es}}\right) \]
                      4. associate-/r*N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                      5. lower-/.f64N/A

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{sa}}{one\_es}\right)} \]
                    9. Applied rewrites43.0%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa}}{one\_es}\right)} \]

                    if -4.1999999999999997e59 < lamt

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                      3. lower-neg.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{one\_es \cdot sa}\right) \]
                      4. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(one\_es \cdot sa\right)\right)}\right) \]
                      5. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(*-commutative, \left(sa \cdot one\_es\right)\right)}\right) \]
                      6. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(lift-*.f64, \left(sa \cdot one\_es\right)\right)}\right) \]
                    9. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)} \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 20: 44.1% accurate, 3.7× speedup?

                  \[\begin{array}{l} \mathbf{if}\;lamt \leq -4.2 \cdot 10^{+59}:\\ \;\;\;\;\tan^{-1} \left(\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa \cdot one\_es}\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)\\ \end{array} \]
                  (FPCore (lamdp lamt ca one_es sa)
                    :precision binary64
                    :pre TRUE
                    (if (<= lamt -4.2e+59)
                    (atan
                     (/
                      (* (- (* (* (* ca lamt) lamt) 0.16666666666666666) ca) lamt)
                      (* sa one_es)))
                    (atan (/ (- (* ca lamt)) (* sa one_es)))))
                  double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double tmp;
                  	if (lamt <= -4.2e+59) {
                  		tmp = atan(((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / (sa * one_es)));
                  	} else {
                  		tmp = atan((-(ca * lamt) / (sa * one_es)));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(lamdp, lamt, ca, one_es, sa)
                  use fmin_fmax_functions
                      real(8), intent (in) :: lamdp
                      real(8), intent (in) :: lamt
                      real(8), intent (in) :: ca
                      real(8), intent (in) :: one_es
                      real(8), intent (in) :: sa
                      real(8) :: tmp
                      if (lamt <= (-4.2d+59)) then
                          tmp = atan(((((((ca * lamt) * lamt) * 0.16666666666666666d0) - ca) * lamt) / (sa * one_es)))
                      else
                          tmp = atan((-(ca * lamt) / (sa * one_es)))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                  	double tmp;
                  	if (lamt <= -4.2e+59) {
                  		tmp = Math.atan(((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / (sa * one_es)));
                  	} else {
                  		tmp = Math.atan((-(ca * lamt) / (sa * one_es)));
                  	}
                  	return tmp;
                  }
                  
                  def code(lamdp, lamt, ca, one_es, sa):
                  	tmp = 0
                  	if lamt <= -4.2e+59:
                  		tmp = math.atan(((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / (sa * one_es)))
                  	else:
                  		tmp = math.atan((-(ca * lamt) / (sa * one_es)))
                  	return tmp
                  
                  function code(lamdp, lamt, ca, one_es, sa)
                  	tmp = 0.0
                  	if (lamt <= -4.2e+59)
                  		tmp = atan(Float64(Float64(Float64(Float64(Float64(Float64(ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / Float64(sa * one_es)));
                  	else
                  		tmp = atan(Float64(Float64(-Float64(ca * lamt)) / Float64(sa * one_es)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(lamdp, lamt, ca, one_es, sa)
                  	tmp = 0.0;
                  	if (lamt <= -4.2e+59)
                  		tmp = atan(((((((ca * lamt) * lamt) * 0.16666666666666666) - ca) * lamt) / (sa * one_es)));
                  	else
                  		tmp = atan((-(ca * lamt) / (sa * one_es)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[lamdp_, lamt_, ca_, one$95$es_, sa_] := If[LessEqual[lamt, -4.2e+59], N[ArcTan[N[(N[(N[(N[(N[(N[(ca * lamt), $MachinePrecision] * lamt), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - ca), $MachinePrecision] * lamt), $MachinePrecision] / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[((-N[(ca * lamt), $MachinePrecision]) / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                  
                  f(lamdp, lamt, ca, one_es, sa):
                  	lamdp in [-inf, +inf],
                  	lamt in [-inf, +inf],
                  	ca in [-inf, +inf],
                  	one_es in [-inf, +inf],
                  	sa in [-inf, +inf]
                  code: THEORY
                  BEGIN
                  f(lamdp, lamt, ca, one_es, sa: real): real =
                  	LET tmp = IF (lamt <= (-419999999999999968038239129476388816187586133754418707824640)) THEN (atan(((((((ca * lamt) * lamt) * (1666666666666666574148081281236954964697360992431640625e-55)) - ca) * lamt) / (sa * one_es)))) ELSE (atan(((- (ca * lamt)) / (sa * one_es)))) ENDIF IN
                  	tmp
                  END code
                  \begin{array}{l}
                  \mathbf{if}\;lamt \leq -4.2 \cdot 10^{+59}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa \cdot one\_es}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if lamt < -4.1999999999999997e59

                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\left(-1 \cdot ca + \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \left(-1 \cdot ca + \color{blue}{\frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)}\right)}{one\_es \cdot sa}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, \frac{1}{6} \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                      5. lower-pow.f6443.1%

                        \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites43.1%

                      \[\leadsto \tan^{-1} \left(\frac{lamt \cdot \color{blue}{\mathsf{fma}\left(-1, ca, 0.16666666666666666 \cdot \left(ca \cdot {lamt}^{2}\right)\right)}}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. Applied rewrites43.1%

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(\left(\left(ca \cdot lamt\right) \cdot lamt\right) \cdot 0.16666666666666666 - ca\right) \cdot lamt}{sa \cdot one\_es}\right)} \]

                      if -4.1999999999999997e59 < lamt

                      1. Initial program 96.7%

                        \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                      2. Taylor expanded in lamdp around 0

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      3. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                        3. lower-sin.f6461.9%

                          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                      4. Applied rewrites61.9%

                        \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      5. Taylor expanded in lamt around 0

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                      6. Step-by-step derivation
                        1. lower-*.f6444.6%

                          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                      7. Applied rewrites44.6%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                      8. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot lamt\right)}}{one\_es \cdot sa}\right) \]
                        2. mul-1-negN/A

                          \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                        3. lower-neg.f6444.6%

                          \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{one\_es \cdot sa}\right) \]
                        4. lower-neg.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(one\_es \cdot sa\right)\right)}\right) \]
                        5. lower-neg.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(*-commutative, \left(sa \cdot one\_es\right)\right)}\right) \]
                        6. lower-neg.f64N/A

                          \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(lift-*.f64, \left(sa \cdot one\_es\right)\right)}\right) \]
                      9. Applied rewrites44.6%

                        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)} \]
                    9. Recombined 2 regimes into one program.
                    10. Add Preprocessing

                    Alternative 21: 43.9% accurate, 6.3× speedup?

                    \[\tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right) \]
                    (FPCore (lamdp lamt ca one_es sa)
                      :precision binary64
                      :pre TRUE
                      (atan (/ (- (* ca lamt)) (* sa one_es))))
                    double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                    	return atan((-(ca * lamt) / (sa * one_es)));
                    }
                    
                    real(8) function code(lamdp, lamt, ca, one_es, sa)
                    use fmin_fmax_functions
                        real(8), intent (in) :: lamdp
                        real(8), intent (in) :: lamt
                        real(8), intent (in) :: ca
                        real(8), intent (in) :: one_es
                        real(8), intent (in) :: sa
                        code = atan((-(ca * lamt) / (sa * one_es)))
                    end function
                    
                    public static double code(double lamdp, double lamt, double ca, double one_es, double sa) {
                    	return Math.atan((-(ca * lamt) / (sa * one_es)));
                    }
                    
                    def code(lamdp, lamt, ca, one_es, sa):
                    	return math.atan((-(ca * lamt) / (sa * one_es)))
                    
                    function code(lamdp, lamt, ca, one_es, sa)
                    	return atan(Float64(Float64(-Float64(ca * lamt)) / Float64(sa * one_es)))
                    end
                    
                    function tmp = code(lamdp, lamt, ca, one_es, sa)
                    	tmp = atan((-(ca * lamt) / (sa * one_es)));
                    end
                    
                    code[lamdp_, lamt_, ca_, one$95$es_, sa_] := N[ArcTan[N[((-N[(ca * lamt), $MachinePrecision]) / N[(sa * one$95$es), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                    
                    f(lamdp, lamt, ca, one_es, sa):
                    	lamdp in [-inf, +inf],
                    	lamt in [-inf, +inf],
                    	ca in [-inf, +inf],
                    	one_es in [-inf, +inf],
                    	sa in [-inf, +inf]
                    code: THEORY
                    BEGIN
                    f(lamdp, lamt, ca, one_es, sa: real): real =
                    	atan(((- (ca * lamt)) / (sa * one_es)))
                    END code
                    \tan^{-1} \left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)
                    
                    Derivation
                    1. Initial program 96.7%

                      \[\tan^{-1} \left(\frac{\tan lamdp \cdot \cos lamt - ca \cdot \sin lamt}{one\_es \cdot sa}\right) \]
                    2. Taylor expanded in lamdp around 0

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{\sin lamt}\right)}{one\_es \cdot sa}\right) \]
                      3. lower-sin.f6461.9%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \sin lamt\right)}{one\_es \cdot sa}\right) \]
                    4. Applied rewrites61.9%

                      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(ca \cdot \sin lamt\right)}}{one\_es \cdot sa}\right) \]
                    5. Taylor expanded in lamt around 0

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    6. Step-by-step derivation
                      1. lower-*.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                    7. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \left(ca \cdot \color{blue}{lamt}\right)}{one\_es \cdot sa}\right) \]
                    8. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(ca \cdot lamt\right)}}{one\_es \cdot sa}\right) \]
                      2. mul-1-negN/A

                        \[\leadsto \tan^{-1} \left(\frac{\mathsf{neg}\left(ca \cdot lamt\right)}{one\_es \cdot sa}\right) \]
                      3. lower-neg.f6444.6%

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{one\_es \cdot sa}\right) \]
                      4. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(one\_es \cdot sa\right)\right)}\right) \]
                      5. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(*-commutative, \left(sa \cdot one\_es\right)\right)}\right) \]
                      6. lower-neg.f64N/A

                        \[\leadsto \tan^{-1} \left(\frac{-ca \cdot lamt}{\mathsf{Rewrite<=}\left(lift-*.f64, \left(sa \cdot one\_es\right)\right)}\right) \]
                    9. Applied rewrites44.6%

                      \[\leadsto \tan^{-1} \color{blue}{\left(\frac{-ca \cdot lamt}{sa \cdot one\_es}\right)} \]
                    10. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2025347 
                    (FPCore (lamdp lamt ca one_es sa)
                      :name "inverse-phi"
                      :precision binary64
                      (atan (/ (- (* (tan lamdp) (cos lamt)) (* ca (sin lamt))) (* one_es sa))))