Destination given bearing on a great circle

Percentage Accurate: 99.8% → 99.8%
Time: 18.7s
Alternatives: 17
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \end{array} \]
(FPCore (lambda1 phi1 phi2 delta theta)
 :precision binary64
 (+
  lambda1
  (atan2
   (* (* (sin theta) (sin delta)) (cos phi1))
   (-
    (cos delta)
    (*
     (sin phi1)
     (sin
      (asin
       (+
        (* (sin phi1) (cos delta))
        (* (* (cos phi1) (sin delta)) (cos theta))))))))))
double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	return lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))));
}
real(8) function code(lambda1, phi1, phi2, delta, theta)
    real(8), intent (in) :: lambda1
    real(8), intent (in) :: phi1
    real(8), intent (in) :: phi2
    real(8), intent (in) :: delta
    real(8), intent (in) :: theta
    code = lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))))
end function
public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	return lambda1 + Math.atan2(((Math.sin(theta) * Math.sin(delta)) * Math.cos(phi1)), (Math.cos(delta) - (Math.sin(phi1) * Math.sin(Math.asin(((Math.sin(phi1) * Math.cos(delta)) + ((Math.cos(phi1) * Math.sin(delta)) * Math.cos(theta))))))));
}
def code(lambda1, phi1, phi2, delta, theta):
	return lambda1 + math.atan2(((math.sin(theta) * math.sin(delta)) * math.cos(phi1)), (math.cos(delta) - (math.sin(phi1) * math.sin(math.asin(((math.sin(phi1) * math.cos(delta)) + ((math.cos(phi1) * math.sin(delta)) * math.cos(theta))))))))
function code(lambda1, phi1, phi2, delta, theta)
	return Float64(lambda1 + atan(Float64(Float64(sin(theta) * sin(delta)) * cos(phi1)), Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(sin(phi1) * cos(delta)) + Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)))))))))
end
function tmp = code(lambda1, phi1, phi2, delta, theta)
	tmp = lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))));
end
code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[(N[Sin[theta], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[Sin[phi1], $MachinePrecision] * N[Cos[delta], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \end{array} \]
(FPCore (lambda1 phi1 phi2 delta theta)
 :precision binary64
 (+
  lambda1
  (atan2
   (* (* (sin theta) (sin delta)) (cos phi1))
   (-
    (cos delta)
    (*
     (sin phi1)
     (sin
      (asin
       (+
        (* (sin phi1) (cos delta))
        (* (* (cos phi1) (sin delta)) (cos theta))))))))))
double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	return lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))));
}
real(8) function code(lambda1, phi1, phi2, delta, theta)
    real(8), intent (in) :: lambda1
    real(8), intent (in) :: phi1
    real(8), intent (in) :: phi2
    real(8), intent (in) :: delta
    real(8), intent (in) :: theta
    code = lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))))
end function
public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	return lambda1 + Math.atan2(((Math.sin(theta) * Math.sin(delta)) * Math.cos(phi1)), (Math.cos(delta) - (Math.sin(phi1) * Math.sin(Math.asin(((Math.sin(phi1) * Math.cos(delta)) + ((Math.cos(phi1) * Math.sin(delta)) * Math.cos(theta))))))));
}
def code(lambda1, phi1, phi2, delta, theta):
	return lambda1 + math.atan2(((math.sin(theta) * math.sin(delta)) * math.cos(phi1)), (math.cos(delta) - (math.sin(phi1) * math.sin(math.asin(((math.sin(phi1) * math.cos(delta)) + ((math.cos(phi1) * math.sin(delta)) * math.cos(theta))))))))
function code(lambda1, phi1, phi2, delta, theta)
	return Float64(lambda1 + atan(Float64(Float64(sin(theta) * sin(delta)) * cos(phi1)), Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(sin(phi1) * cos(delta)) + Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)))))))))
end
function tmp = code(lambda1, phi1, phi2, delta, theta)
	tmp = lambda1 + atan2(((sin(theta) * sin(delta)) * cos(phi1)), (cos(delta) - (sin(phi1) * sin(asin(((sin(phi1) * cos(delta)) + ((cos(phi1) * sin(delta)) * cos(theta))))))));
end
code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[(N[Sin[theta], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[Sin[phi1], $MachinePrecision] * N[Cos[delta], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}
\end{array}

Alternative 1: 99.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(-\sin \phi_1\right)\right)} + \lambda_1 \end{array} \]
(FPCore (lambda1 phi1 phi2 delta theta)
 :precision binary64
 (+
  (atan2
   (* (cos phi1) (* (sin delta) (sin theta)))
   (fma
    (+ 0.5 (* 0.5 (cos (* phi1 -2.0))))
    (cos delta)
    (* (* (* (cos phi1) (sin delta)) (cos theta)) (- (sin phi1)))))
  lambda1))
double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	return atan2((cos(phi1) * (sin(delta) * sin(theta))), fma((0.5 + (0.5 * cos((phi1 * -2.0)))), cos(delta), (((cos(phi1) * sin(delta)) * cos(theta)) * -sin(phi1)))) + lambda1;
}
function code(lambda1, phi1, phi2, delta, theta)
	return Float64(atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), fma(Float64(0.5 + Float64(0.5 * cos(Float64(phi1 * -2.0)))), cos(delta), Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) * Float64(-sin(phi1))))) + lambda1)
end
code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 + N[(0.5 * N[Cos[N[(phi1 * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[delta], $MachinePrecision] + N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] * (-N[Sin[phi1], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + lambda1), $MachinePrecision]
\begin{array}{l}

\\
\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(-\sin \phi_1\right)\right)} + \lambda_1
\end{array}
Derivation
  1. Initial program 99.8%

    \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right)}} \]
    2. +-commutativeN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right) + \cos delta}} \]
    3. sin-asinN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}\right)\right) + \cos delta} \]
    4. distribute-lft-neg-inN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1\right)\right) \cdot \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} + \cos delta} \]
    5. distribute-rgt-inN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right)\right)} + \cos delta} \]
    6. associate-+l+N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \cos delta\right)}} \]
  4. Applied egg-rr99.8%

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(\left(-\sin \phi_1\right) \cdot \sin \phi_1, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)}} \]
  5. Step-by-step derivation
    1. distribute-lft-neg-outN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(\sin \phi_1 \cdot \sin \phi_1\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    2. neg-lowering-neg.f64N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(\sin \phi_1 \cdot \sin \phi_1\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    3. sqr-sin-aN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    4. sub-negN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    5. +-commutativeN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right) + \frac{1}{2}\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \phi_1\right) \cdot \frac{1}{2}}\right)\right) + \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    7. distribute-rgt-neg-inN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\color{blue}{\cos \left(2 \cdot \phi_1\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    8. accelerator-lowering-fma.f64N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\cos \left(2 \cdot \phi_1\right), \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    9. cos-2N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_1 - \sin \phi_1 \cdot \sin \phi_1}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    10. cos-sumN/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    11. cos-lowering-cos.f64N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    12. +-lowering-+.f64N/A

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
    13. metadata-eval99.8

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(-\mathsf{fma}\left(\cos \left(\phi_1 + \phi_1\right), \color{blue}{-0.5}, 0.5\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)} \]
  6. Applied egg-rr99.8%

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{-\mathsf{fma}\left(\cos \left(\phi_1 + \phi_1\right), -0.5, 0.5\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)} \]
  7. Taylor expanded in lambda1 around 0

    \[\leadsto \color{blue}{\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta + \left(-1 \cdot \left(\cos delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)\right)\right)}} \]
  8. Simplified99.8%

    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, -\left(\left(\sin delta \cdot \cos \phi_1\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} + \lambda_1} \]
  9. Final simplification99.8%

    \[\leadsto \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(-\sin \phi_1\right)\right)} + \lambda_1 \]
  10. Add Preprocessing

Alternative 2: 87.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta}\\ t_2 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\ t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ t_4 := \cos \phi_1 \cdot \sin delta\\ t_5 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(t\_4 \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ \mathbf{if}\;t\_5 \leq -3.14159265358979:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_5 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_5 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot t\_4}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;t\_5 \leq 3.12:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (lambda1 phi1 phi2 delta theta)
 :precision binary64
 (let* ((t_1 (atan2 (* (sin delta) (* (cos phi1) (sin theta))) (cos delta)))
        (t_2 (* (cos phi1) (* (sin delta) (sin theta))))
        (t_3 (+ lambda1 (atan2 t_2 (fma delta (* delta -0.5) 1.0))))
        (t_4 (* (cos phi1) (sin delta)))
        (t_5
         (+
          lambda1
          (atan2
           t_2
           (-
            (cos delta)
            (*
             (sin phi1)
             (sin
              (asin (+ (* t_4 (cos theta)) (* (cos delta) (sin phi1)))))))))))
   (if (<= t_5 -3.14159265358979)
     t_3
     (if (<= t_5 -5e-7)
       t_1
       (if (<= t_5 2e-12)
         (* lambda1 (- (/ (atan2 (* (sin theta) t_4) 1.0) lambda1) -1.0))
         (if (<= t_5 3.12) t_1 t_3))))))
double code(double lambda1, double phi1, double phi2, double delta, double theta) {
	double t_1 = atan2((sin(delta) * (cos(phi1) * sin(theta))), cos(delta));
	double t_2 = cos(phi1) * (sin(delta) * sin(theta));
	double t_3 = lambda1 + atan2(t_2, fma(delta, (delta * -0.5), 1.0));
	double t_4 = cos(phi1) * sin(delta);
	double t_5 = lambda1 + atan2(t_2, (cos(delta) - (sin(phi1) * sin(asin(((t_4 * cos(theta)) + (cos(delta) * sin(phi1))))))));
	double tmp;
	if (t_5 <= -3.14159265358979) {
		tmp = t_3;
	} else if (t_5 <= -5e-7) {
		tmp = t_1;
	} else if (t_5 <= 2e-12) {
		tmp = lambda1 * ((atan2((sin(theta) * t_4), 1.0) / lambda1) - -1.0);
	} else if (t_5 <= 3.12) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(lambda1, phi1, phi2, delta, theta)
	t_1 = atan(Float64(sin(delta) * Float64(cos(phi1) * sin(theta))), cos(delta))
	t_2 = Float64(cos(phi1) * Float64(sin(delta) * sin(theta)))
	t_3 = Float64(lambda1 + atan(t_2, fma(delta, Float64(delta * -0.5), 1.0)))
	t_4 = Float64(cos(phi1) * sin(delta))
	t_5 = Float64(lambda1 + atan(t_2, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(t_4 * cos(theta)) + Float64(cos(delta) * sin(phi1)))))))))
	tmp = 0.0
	if (t_5 <= -3.14159265358979)
		tmp = t_3;
	elseif (t_5 <= -5e-7)
		tmp = t_1;
	elseif (t_5 <= 2e-12)
		tmp = Float64(lambda1 * Float64(Float64(atan(Float64(sin(theta) * t_4), 1.0) / lambda1) - -1.0));
	elseif (t_5 <= 3.12)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[ArcTan[N[(N[Sin[delta], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[delta], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(lambda1 + N[ArcTan[t$95$2 / N[(delta * N[(delta * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(lambda1 + N[ArcTan[t$95$2 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(t$95$4 * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -3.14159265358979], t$95$3, If[LessEqual[t$95$5, -5e-7], t$95$1, If[LessEqual[t$95$5, 2e-12], N[(lambda1 * N[(N[(N[ArcTan[N[(N[Sin[theta], $MachinePrecision] * t$95$4), $MachinePrecision] / 1.0], $MachinePrecision] / lambda1), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 3.12], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta}\\
t_2 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\
t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\
t_4 := \cos \phi_1 \cdot \sin delta\\
t_5 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(t\_4 \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
\mathbf{if}\;t\_5 \leq -3.14159265358979:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_5 \leq -5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot t\_4}{1}}{\lambda_1} - -1\right)\\

\mathbf{elif}\;t\_5 \leq 3.12:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -3.14159265358979001 or 3.1200000000000001 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))))

    1. Initial program 100.0%

      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sin-asinN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}} \]
      2. distribute-rgt-inN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \sin \phi_1 + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
      3. associate-*r*N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      4. *-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      5. associate-*r*N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_1, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
      7. sqr-sin-aN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      8. --lowering--.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      10. cos-lowering-cos.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \color{blue}{\cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \color{blue}{\left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      12. cos-lowering-cos.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \color{blue}{\cos delta}, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
      13. *-lowering-*.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \color{blue}{\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1}\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
    5. Taylor expanded in delta around 0

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)}} \]
    6. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) + \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, -1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right), \frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
    7. Simplified99.4%

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \mathsf{fma}\left(delta, \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos \left(2 \cdot \phi_1\right), -0.5, 0.5\right), -0.5\right), \cos \phi_1 \cdot \left(\cos theta \cdot \left(-\sin \phi_1\right)\right)\right), \mathsf{fma}\left(0.5, \cos \left(2 \cdot \phi_1\right), 0.5\right)\right)}} \]
    8. Taylor expanded in phi1 around 0

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1 + \frac{-1}{2} \cdot {delta}^{2}}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{-1}{2} \cdot {delta}^{2} + 1}} \]
      2. *-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{delta}^{2} \cdot \frac{-1}{2}} + 1} \]
      3. unpow2N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(delta \cdot delta\right)} \cdot \frac{-1}{2} + 1} \]
      4. associate-*l*N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(delta \cdot \frac{-1}{2}\right)} + 1} \]
      5. *-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{delta \cdot \color{blue}{\left(\frac{-1}{2} \cdot delta\right)} + 1} \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \frac{-1}{2} \cdot delta, 1\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot \frac{-1}{2}}, 1\right)} \]
      8. *-lowering-*.f6499.4

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot -0.5}, 1\right)} \]
    10. Simplified99.4%

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}} \]

    if -3.14159265358979001 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -4.99999999999999977e-7 or 1.99999999999999996e-12 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 3.1200000000000001

    1. Initial program 99.3%

      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in lambda1 around 0

      \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
    4. Step-by-step derivation
      1. atan2-lowering-atan2.f64N/A

        \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
      2. associate-*r*N/A

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\cos \phi_1 \cdot \sin delta\right) \cdot \sin theta}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      3. *-commutativeN/A

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\sin delta \cdot \cos \phi_1\right)} \cdot \sin theta}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      4. associate-*l*N/A

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      6. sin-lowering-sin.f64N/A

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      8. cos-lowering-cos.f64N/A

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\color{blue}{\cos \phi_1} \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \color{blue}{\sin theta}\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
      10. sub-negN/A

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right)}} \]
      11. +-commutativeN/A

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right) + \cos delta}} \]
    5. Simplified92.6%

      \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos theta, \sin delta \cdot \cos \phi_1, \cos delta \cdot \sin \phi_1\right), -\sin \phi_1, \cos delta\right)}} \]
    6. Taylor expanded in phi1 around 0

      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
    7. Step-by-step derivation
      1. cos-lowering-cos.f6461.3

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
    8. Simplified61.3%

      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]

    if -4.99999999999999977e-7 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 1.99999999999999996e-12

    1. Initial program 99.5%

      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in delta around 0

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
      2. associate--l+N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
      3. associate-*r*N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
      4. *-commutativeN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
      5. associate-*r*N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
      6. unpow2N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
      7. 1-sub-sinN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
      8. distribute-rgt-outN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
      10. cos-lowering-cos.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
      11. mul-1-negN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
      12. distribute-lft-neg-outN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
    5. Simplified88.4%

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
    6. Taylor expanded in phi1 around 0

      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
    7. Step-by-step derivation
      1. Simplified80.9%

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
      2. Taylor expanded in lambda1 around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right)\right)} \]
      3. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \lambda_1\right) \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right)} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
      4. Simplified80.9%

        \[\leadsto \color{blue}{\left(-1 - \frac{\tan^{-1}_* \frac{\left(\sin delta \cdot \cos \phi_1\right) \cdot \sin theta}{1}}{\lambda_1}\right) \cdot \left(-\lambda_1\right)} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification88.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -3.14159265358979:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot \left(\cos \phi_1 \cdot \sin delta\right)}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 3.12:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 3: 86.4% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin delta \cdot \sin theta\\ t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\ t_3 := \cos \phi_1 \cdot t\_1\\ t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ t_5 := \cos \phi_1 \cdot \sin delta\\ t_6 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(t\_5 \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ \mathbf{if}\;t\_6 \leq -3.14159265358979:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_6 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_6 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot t\_5}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;t\_6 \leq 3:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
    (FPCore (lambda1 phi1 phi2 delta theta)
     :precision binary64
     (let* ((t_1 (* (sin delta) (sin theta)))
            (t_2 (atan2 t_1 (cos delta)))
            (t_3 (* (cos phi1) t_1))
            (t_4 (+ lambda1 (atan2 t_3 (fma delta (* delta -0.5) 1.0))))
            (t_5 (* (cos phi1) (sin delta)))
            (t_6
             (+
              lambda1
              (atan2
               t_3
               (-
                (cos delta)
                (*
                 (sin phi1)
                 (sin
                  (asin (+ (* t_5 (cos theta)) (* (cos delta) (sin phi1)))))))))))
       (if (<= t_6 -3.14159265358979)
         t_4
         (if (<= t_6 -5e-7)
           t_2
           (if (<= t_6 2e-12)
             (* lambda1 (- (/ (atan2 (* (sin theta) t_5) 1.0) lambda1) -1.0))
             (if (<= t_6 3.0) t_2 t_4))))))
    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
    	double t_1 = sin(delta) * sin(theta);
    	double t_2 = atan2(t_1, cos(delta));
    	double t_3 = cos(phi1) * t_1;
    	double t_4 = lambda1 + atan2(t_3, fma(delta, (delta * -0.5), 1.0));
    	double t_5 = cos(phi1) * sin(delta);
    	double t_6 = lambda1 + atan2(t_3, (cos(delta) - (sin(phi1) * sin(asin(((t_5 * cos(theta)) + (cos(delta) * sin(phi1))))))));
    	double tmp;
    	if (t_6 <= -3.14159265358979) {
    		tmp = t_4;
    	} else if (t_6 <= -5e-7) {
    		tmp = t_2;
    	} else if (t_6 <= 2e-12) {
    		tmp = lambda1 * ((atan2((sin(theta) * t_5), 1.0) / lambda1) - -1.0);
    	} else if (t_6 <= 3.0) {
    		tmp = t_2;
    	} else {
    		tmp = t_4;
    	}
    	return tmp;
    }
    
    function code(lambda1, phi1, phi2, delta, theta)
    	t_1 = Float64(sin(delta) * sin(theta))
    	t_2 = atan(t_1, cos(delta))
    	t_3 = Float64(cos(phi1) * t_1)
    	t_4 = Float64(lambda1 + atan(t_3, fma(delta, Float64(delta * -0.5), 1.0)))
    	t_5 = Float64(cos(phi1) * sin(delta))
    	t_6 = Float64(lambda1 + atan(t_3, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(t_5 * cos(theta)) + Float64(cos(delta) * sin(phi1)))))))))
    	tmp = 0.0
    	if (t_6 <= -3.14159265358979)
    		tmp = t_4;
    	elseif (t_6 <= -5e-7)
    		tmp = t_2;
    	elseif (t_6 <= 2e-12)
    		tmp = Float64(lambda1 * Float64(Float64(atan(Float64(sin(theta) * t_5), 1.0) / lambda1) - -1.0));
    	elseif (t_6 <= 3.0)
    		tmp = t_2;
    	else
    		tmp = t_4;
    	end
    	return tmp
    end
    
    code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[phi1], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(lambda1 + N[ArcTan[t$95$3 / N[(delta * N[(delta * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(lambda1 + N[ArcTan[t$95$3 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(t$95$5 * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -3.14159265358979], t$95$4, If[LessEqual[t$95$6, -5e-7], t$95$2, If[LessEqual[t$95$6, 2e-12], N[(lambda1 * N[(N[(N[ArcTan[N[(N[Sin[theta], $MachinePrecision] * t$95$5), $MachinePrecision] / 1.0], $MachinePrecision] / lambda1), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 3.0], t$95$2, t$95$4]]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin delta \cdot \sin theta\\
    t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\
    t_3 := \cos \phi_1 \cdot t\_1\\
    t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\
    t_5 := \cos \phi_1 \cdot \sin delta\\
    t_6 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(t\_5 \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
    \mathbf{if}\;t\_6 \leq -3.14159265358979:\\
    \;\;\;\;t\_4\\
    
    \mathbf{elif}\;t\_6 \leq -5 \cdot 10^{-7}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_6 \leq 2 \cdot 10^{-12}:\\
    \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot t\_5}{1}}{\lambda_1} - -1\right)\\
    
    \mathbf{elif}\;t\_6 \leq 3:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_4\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -3.14159265358979001 or 3 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))))

      1. Initial program 100.0%

        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. sin-asinN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}} \]
        2. distribute-rgt-inN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \sin \phi_1 + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
        3. associate-*r*N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        4. *-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        5. associate-*r*N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        6. accelerator-lowering-fma.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_1, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
        7. sqr-sin-aN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        8. --lowering--.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        9. *-lowering-*.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        10. cos-lowering-cos.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \color{blue}{\cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        11. *-lowering-*.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \color{blue}{\left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        12. cos-lowering-cos.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \color{blue}{\cos delta}, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
        13. *-lowering-*.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \color{blue}{\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1}\right)} \]
      4. Applied egg-rr100.0%

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
      5. Taylor expanded in delta around 0

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)}} \]
      6. Step-by-step derivation
        1. associate-+r+N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) + \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
        3. accelerator-lowering-fma.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, -1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right), \frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
      7. Simplified98.9%

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \mathsf{fma}\left(delta, \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos \left(2 \cdot \phi_1\right), -0.5, 0.5\right), -0.5\right), \cos \phi_1 \cdot \left(\cos theta \cdot \left(-\sin \phi_1\right)\right)\right), \mathsf{fma}\left(0.5, \cos \left(2 \cdot \phi_1\right), 0.5\right)\right)}} \]
      8. Taylor expanded in phi1 around 0

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1 + \frac{-1}{2} \cdot {delta}^{2}}} \]
      9. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{-1}{2} \cdot {delta}^{2} + 1}} \]
        2. *-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{delta}^{2} \cdot \frac{-1}{2}} + 1} \]
        3. unpow2N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(delta \cdot delta\right)} \cdot \frac{-1}{2} + 1} \]
        4. associate-*l*N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(delta \cdot \frac{-1}{2}\right)} + 1} \]
        5. *-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{delta \cdot \color{blue}{\left(\frac{-1}{2} \cdot delta\right)} + 1} \]
        6. accelerator-lowering-fma.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \frac{-1}{2} \cdot delta, 1\right)}} \]
        7. *-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot \frac{-1}{2}}, 1\right)} \]
        8. *-lowering-*.f6498.9

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot -0.5}, 1\right)} \]
      10. Simplified98.9%

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}} \]

      if -3.14159265358979001 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -4.99999999999999977e-7 or 1.99999999999999996e-12 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 3

      1. Initial program 99.3%

        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in lambda1 around 0

        \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
      4. Step-by-step derivation
        1. atan2-lowering-atan2.f64N/A

          \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
        2. associate-*r*N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\cos \phi_1 \cdot \sin delta\right) \cdot \sin theta}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        3. *-commutativeN/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\sin delta \cdot \cos \phi_1\right)} \cdot \sin theta}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        4. associate-*l*N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        6. sin-lowering-sin.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        8. cos-lowering-cos.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\color{blue}{\cos \phi_1} \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        9. sin-lowering-sin.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \color{blue}{\sin theta}\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
        10. sub-negN/A

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right)}} \]
        11. +-commutativeN/A

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right) + \cos delta}} \]
      5. Simplified92.4%

        \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos theta, \sin delta \cdot \cos \phi_1, \cos delta \cdot \sin \phi_1\right), -\sin \phi_1, \cos delta\right)}} \]
      6. Taylor expanded in phi1 around 0

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
      7. Step-by-step derivation
        1. cos-lowering-cos.f6462.0

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
      8. Simplified62.0%

        \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
      9. Taylor expanded in phi1 around 0

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
      10. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
        2. sin-lowering-sin.f64N/A

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{\cos delta} \]
        3. sin-lowering-sin.f6458.3

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{\cos delta} \]
      11. Simplified58.3%

        \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]

      if -4.99999999999999977e-7 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 1.99999999999999996e-12

      1. Initial program 99.5%

        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in delta around 0

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
        2. associate--l+N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
        3. associate-*r*N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
        4. *-commutativeN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
        5. associate-*r*N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
        6. unpow2N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
        7. 1-sub-sinN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
        8. distribute-rgt-outN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
        9. *-lowering-*.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
        10. cos-lowering-cos.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
        11. mul-1-negN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
        12. distribute-lft-neg-outN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
        13. distribute-rgt-neg-inN/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
        14. accelerator-lowering-fma.f64N/A

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
      5. Simplified88.4%

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
      6. Taylor expanded in phi1 around 0

        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
      7. Step-by-step derivation
        1. Simplified80.9%

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
        2. Taylor expanded in lambda1 around -inf

          \[\leadsto \color{blue}{-1 \cdot \left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right)\right)} \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(-1 \cdot \lambda_1\right) \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
        4. Simplified80.9%

          \[\leadsto \color{blue}{\left(-1 - \frac{\tan^{-1}_* \frac{\left(\sin delta \cdot \cos \phi_1\right) \cdot \sin theta}{1}}{\lambda_1}\right) \cdot \left(-\lambda_1\right)} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification87.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -3.14159265358979:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin theta \cdot \left(\cos \phi_1 \cdot \sin delta\right)}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 3:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \end{array} \]
      10. Add Preprocessing

      Alternative 4: 86.4% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin delta \cdot \sin theta\\ t_2 := \cos \phi_1 \cdot t\_1\\ t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ t_5 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\ \mathbf{if}\;t\_4 \leq -3.14159265358979:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_2}{1}\\ \mathbf{elif}\;t\_4 \leq 3:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
      (FPCore (lambda1 phi1 phi2 delta theta)
       :precision binary64
       (let* ((t_1 (* (sin delta) (sin theta)))
              (t_2 (* (cos phi1) t_1))
              (t_3 (+ lambda1 (atan2 t_2 (fma delta (* delta -0.5) 1.0))))
              (t_4
               (+
                lambda1
                (atan2
                 t_2
                 (-
                  (cos delta)
                  (*
                   (sin phi1)
                   (sin
                    (asin
                     (+
                      (* (* (cos phi1) (sin delta)) (cos theta))
                      (* (cos delta) (sin phi1))))))))))
              (t_5 (atan2 t_1 (cos delta))))
         (if (<= t_4 -3.14159265358979)
           t_3
           (if (<= t_4 -5e-7)
             t_5
             (if (<= t_4 2e-12)
               (+ lambda1 (atan2 t_2 1.0))
               (if (<= t_4 3.0) t_5 t_3))))))
      double code(double lambda1, double phi1, double phi2, double delta, double theta) {
      	double t_1 = sin(delta) * sin(theta);
      	double t_2 = cos(phi1) * t_1;
      	double t_3 = lambda1 + atan2(t_2, fma(delta, (delta * -0.5), 1.0));
      	double t_4 = lambda1 + atan2(t_2, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
      	double t_5 = atan2(t_1, cos(delta));
      	double tmp;
      	if (t_4 <= -3.14159265358979) {
      		tmp = t_3;
      	} else if (t_4 <= -5e-7) {
      		tmp = t_5;
      	} else if (t_4 <= 2e-12) {
      		tmp = lambda1 + atan2(t_2, 1.0);
      	} else if (t_4 <= 3.0) {
      		tmp = t_5;
      	} else {
      		tmp = t_3;
      	}
      	return tmp;
      }
      
      function code(lambda1, phi1, phi2, delta, theta)
      	t_1 = Float64(sin(delta) * sin(theta))
      	t_2 = Float64(cos(phi1) * t_1)
      	t_3 = Float64(lambda1 + atan(t_2, fma(delta, Float64(delta * -0.5), 1.0)))
      	t_4 = Float64(lambda1 + atan(t_2, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) + Float64(cos(delta) * sin(phi1)))))))))
      	t_5 = atan(t_1, cos(delta))
      	tmp = 0.0
      	if (t_4 <= -3.14159265358979)
      		tmp = t_3;
      	elseif (t_4 <= -5e-7)
      		tmp = t_5;
      	elseif (t_4 <= 2e-12)
      		tmp = Float64(lambda1 + atan(t_2, 1.0));
      	elseif (t_4 <= 3.0)
      		tmp = t_5;
      	else
      		tmp = t_3;
      	end
      	return tmp
      end
      
      code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[phi1], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(lambda1 + N[ArcTan[t$95$2 / N[(delta * N[(delta * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(lambda1 + N[ArcTan[t$95$2 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, -3.14159265358979], t$95$3, If[LessEqual[t$95$4, -5e-7], t$95$5, If[LessEqual[t$95$4, 2e-12], N[(lambda1 + N[ArcTan[t$95$2 / 1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 3.0], t$95$5, t$95$3]]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin delta \cdot \sin theta\\
      t_2 := \cos \phi_1 \cdot t\_1\\
      t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\
      t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_2}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
      t_5 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\
      \mathbf{if}\;t\_4 \leq -3.14159265358979:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-7}:\\
      \;\;\;\;t\_5\\
      
      \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-12}:\\
      \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_2}{1}\\
      
      \mathbf{elif}\;t\_4 \leq 3:\\
      \;\;\;\;t\_5\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_3\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -3.14159265358979001 or 3 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))))

        1. Initial program 100.0%

          \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. sin-asinN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}} \]
          2. distribute-rgt-inN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \sin \phi_1 + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
          3. associate-*r*N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          4. *-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          5. associate-*r*N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          6. accelerator-lowering-fma.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_1, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
          7. sqr-sin-aN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          8. --lowering--.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          9. *-lowering-*.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          10. cos-lowering-cos.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \color{blue}{\cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          11. *-lowering-*.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \color{blue}{\left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          12. cos-lowering-cos.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \color{blue}{\cos delta}, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
          13. *-lowering-*.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \color{blue}{\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1}\right)} \]
        4. Applied egg-rr100.0%

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
        5. Taylor expanded in delta around 0

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)}} \]
        6. Step-by-step derivation
          1. associate-+r+N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right) + delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)}} \]
          2. +-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(-1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) + \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
          3. accelerator-lowering-fma.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, -1 \cdot \left(delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) - \cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right), \frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}} \]
        7. Simplified98.9%

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \mathsf{fma}\left(delta, \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos \left(2 \cdot \phi_1\right), -0.5, 0.5\right), -0.5\right), \cos \phi_1 \cdot \left(\cos theta \cdot \left(-\sin \phi_1\right)\right)\right), \mathsf{fma}\left(0.5, \cos \left(2 \cdot \phi_1\right), 0.5\right)\right)}} \]
        8. Taylor expanded in phi1 around 0

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1 + \frac{-1}{2} \cdot {delta}^{2}}} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{-1}{2} \cdot {delta}^{2} + 1}} \]
          2. *-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{delta}^{2} \cdot \frac{-1}{2}} + 1} \]
          3. unpow2N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(delta \cdot delta\right)} \cdot \frac{-1}{2} + 1} \]
          4. associate-*l*N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{delta \cdot \left(delta \cdot \frac{-1}{2}\right)} + 1} \]
          5. *-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{delta \cdot \color{blue}{\left(\frac{-1}{2} \cdot delta\right)} + 1} \]
          6. accelerator-lowering-fma.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, \frac{-1}{2} \cdot delta, 1\right)}} \]
          7. *-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot \frac{-1}{2}}, 1\right)} \]
          8. *-lowering-*.f6498.9

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(delta, \color{blue}{delta \cdot -0.5}, 1\right)} \]
        10. Simplified98.9%

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}} \]

        if -3.14159265358979001 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -4.99999999999999977e-7 or 1.99999999999999996e-12 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 3

        1. Initial program 99.3%

          \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in lambda1 around 0

          \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
        4. Step-by-step derivation
          1. atan2-lowering-atan2.f64N/A

            \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
          2. associate-*r*N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\cos \phi_1 \cdot \sin delta\right) \cdot \sin theta}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          3. *-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\sin delta \cdot \cos \phi_1\right)} \cdot \sin theta}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          4. associate-*l*N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          6. sin-lowering-sin.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          7. *-lowering-*.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          8. cos-lowering-cos.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\color{blue}{\cos \phi_1} \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          9. sin-lowering-sin.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \color{blue}{\sin theta}\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
          10. sub-negN/A

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right)}} \]
          11. +-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right) + \cos delta}} \]
        5. Simplified92.4%

          \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos theta, \sin delta \cdot \cos \phi_1, \cos delta \cdot \sin \phi_1\right), -\sin \phi_1, \cos delta\right)}} \]
        6. Taylor expanded in phi1 around 0

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
        7. Step-by-step derivation
          1. cos-lowering-cos.f6462.0

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
        8. Simplified62.0%

          \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
        9. Taylor expanded in phi1 around 0

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
        10. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
          2. sin-lowering-sin.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{\cos delta} \]
          3. sin-lowering-sin.f6458.3

            \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{\cos delta} \]
        11. Simplified58.3%

          \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]

        if -4.99999999999999977e-7 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 1.99999999999999996e-12

        1. Initial program 99.5%

          \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in delta around 0

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
          2. associate--l+N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
          3. associate-*r*N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
          4. *-commutativeN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
          5. associate-*r*N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
          6. unpow2N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
          7. 1-sub-sinN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
          8. distribute-rgt-outN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
          9. *-lowering-*.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
          10. cos-lowering-cos.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
          11. mul-1-negN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
          12. distribute-lft-neg-outN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
          13. distribute-rgt-neg-inN/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
          14. accelerator-lowering-fma.f64N/A

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
        5. Simplified88.4%

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
        6. Taylor expanded in phi1 around 0

          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
        7. Step-by-step derivation
          1. Simplified80.9%

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification87.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -3.14159265358979:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 3:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(delta, delta \cdot -0.5, 1\right)}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 5: 84.4% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin delta \cdot \sin theta\\ t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\ t_3 := \cos \phi_1 \cdot t\_1\\ t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ \mathbf{if}\;t\_4 \leq -500:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\ \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_3}{1}\\ \mathbf{elif}\;t\_4 \leq 5:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\ \end{array} \end{array} \]
        (FPCore (lambda1 phi1 phi2 delta theta)
         :precision binary64
         (let* ((t_1 (* (sin delta) (sin theta)))
                (t_2 (atan2 t_1 (cos delta)))
                (t_3 (* (cos phi1) t_1))
                (t_4
                 (+
                  lambda1
                  (atan2
                   t_3
                   (-
                    (cos delta)
                    (*
                     (sin phi1)
                     (sin
                      (asin
                       (+
                        (* (* (cos phi1) (sin delta)) (cos theta))
                        (* (cos delta) (sin phi1)))))))))))
           (if (<= t_4 -500.0)
             (+
              lambda1
              (atan2
               (*
                (sin theta)
                (fma delta (* -0.16666666666666666 (* delta delta)) delta))
               1.0))
             (if (<= t_4 -5e-7)
               t_2
               (if (<= t_4 2e-12)
                 (+ lambda1 (atan2 t_3 1.0))
                 (if (<= t_4 5.0)
                   t_2
                   (+ lambda1 (atan2 (* delta (sin theta)) 1.0))))))))
        double code(double lambda1, double phi1, double phi2, double delta, double theta) {
        	double t_1 = sin(delta) * sin(theta);
        	double t_2 = atan2(t_1, cos(delta));
        	double t_3 = cos(phi1) * t_1;
        	double t_4 = lambda1 + atan2(t_3, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
        	double tmp;
        	if (t_4 <= -500.0) {
        		tmp = lambda1 + atan2((sin(theta) * fma(delta, (-0.16666666666666666 * (delta * delta)), delta)), 1.0);
        	} else if (t_4 <= -5e-7) {
        		tmp = t_2;
        	} else if (t_4 <= 2e-12) {
        		tmp = lambda1 + atan2(t_3, 1.0);
        	} else if (t_4 <= 5.0) {
        		tmp = t_2;
        	} else {
        		tmp = lambda1 + atan2((delta * sin(theta)), 1.0);
        	}
        	return tmp;
        }
        
        function code(lambda1, phi1, phi2, delta, theta)
        	t_1 = Float64(sin(delta) * sin(theta))
        	t_2 = atan(t_1, cos(delta))
        	t_3 = Float64(cos(phi1) * t_1)
        	t_4 = Float64(lambda1 + atan(t_3, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) + Float64(cos(delta) * sin(phi1)))))))))
        	tmp = 0.0
        	if (t_4 <= -500.0)
        		tmp = Float64(lambda1 + atan(Float64(sin(theta) * fma(delta, Float64(-0.16666666666666666 * Float64(delta * delta)), delta)), 1.0));
        	elseif (t_4 <= -5e-7)
        		tmp = t_2;
        	elseif (t_4 <= 2e-12)
        		tmp = Float64(lambda1 + atan(t_3, 1.0));
        	elseif (t_4 <= 5.0)
        		tmp = t_2;
        	else
        		tmp = Float64(lambda1 + atan(Float64(delta * sin(theta)), 1.0));
        	end
        	return tmp
        end
        
        code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[phi1], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(lambda1 + N[ArcTan[t$95$3 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -500.0], N[(lambda1 + N[ArcTan[N[(N[Sin[theta], $MachinePrecision] * N[(delta * N[(-0.16666666666666666 * N[(delta * delta), $MachinePrecision]), $MachinePrecision] + delta), $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -5e-7], t$95$2, If[LessEqual[t$95$4, 2e-12], N[(lambda1 + N[ArcTan[t$95$3 / 1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5.0], t$95$2, N[(lambda1 + N[ArcTan[N[(delta * N[Sin[theta], $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision]]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \sin delta \cdot \sin theta\\
        t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\
        t_3 := \cos \phi_1 \cdot t\_1\\
        t_4 := \lambda_1 + \tan^{-1}_* \frac{t\_3}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
        \mathbf{if}\;t\_4 \leq -500:\\
        \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\
        
        \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-7}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-12}:\\
        \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_3}{1}\\
        
        \mathbf{elif}\;t\_4 \leq 5:\\
        \;\;\;\;t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -500

          1. Initial program 100.0%

            \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in delta around 0

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
            2. associate--l+N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
            3. associate-*r*N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
            4. *-commutativeN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
            5. associate-*r*N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
            6. unpow2N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
            7. 1-sub-sinN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
            8. distribute-rgt-outN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
            9. *-lowering-*.f64N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
            10. cos-lowering-cos.f64N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
            11. mul-1-negN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
            12. distribute-lft-neg-outN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
            13. distribute-rgt-neg-inN/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
            14. accelerator-lowering-fma.f64N/A

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
          5. Simplified100.0%

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
          6. Taylor expanded in phi1 around 0

            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
          7. Step-by-step derivation
            1. Simplified99.4%

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
            2. Taylor expanded in phi1 around 0

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
            3. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
              2. sin-lowering-sin.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
              3. sin-lowering-sin.f6499.4

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
            4. Simplified99.4%

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
            5. Taylor expanded in delta around 0

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \left(1 + \frac{-1}{6} \cdot {delta}^{2}\right)\right)} \cdot \sin theta}{1} \]
            6. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \color{blue}{\left(\frac{-1}{6} \cdot {delta}^{2} + 1\right)}\right) \cdot \sin theta}{1} \]
              2. distribute-lft-inN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \left(\frac{-1}{6} \cdot {delta}^{2}\right) + delta \cdot 1\right)} \cdot \sin theta}{1} \]
              3. *-rgt-identityN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \left(\frac{-1}{6} \cdot {delta}^{2}\right) + \color{blue}{delta}\right) \cdot \sin theta}{1} \]
              4. accelerator-lowering-fma.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\mathsf{fma}\left(delta, \frac{-1}{6} \cdot {delta}^{2}, delta\right)} \cdot \sin theta}{1} \]
              5. *-lowering-*.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, \color{blue}{\frac{-1}{6} \cdot {delta}^{2}}, delta\right) \cdot \sin theta}{1} \]
              6. unpow2N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, \frac{-1}{6} \cdot \color{blue}{\left(delta \cdot delta\right)}, delta\right) \cdot \sin theta}{1} \]
              7. *-lowering-*.f6499.4

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, -0.16666666666666666 \cdot \color{blue}{\left(delta \cdot delta\right)}, delta\right) \cdot \sin theta}{1} \]
            7. Simplified99.4%

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)} \cdot \sin theta}{1} \]

            if -500 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -4.99999999999999977e-7 or 1.99999999999999996e-12 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 5

            1. Initial program 99.5%

              \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in lambda1 around 0

              \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
            4. Step-by-step derivation
              1. atan2-lowering-atan2.f64N/A

                \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
              2. associate-*r*N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\cos \phi_1 \cdot \sin delta\right) \cdot \sin theta}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              3. *-commutativeN/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\sin delta \cdot \cos \phi_1\right)} \cdot \sin theta}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              4. associate-*l*N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              5. *-lowering-*.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              6. sin-lowering-sin.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              7. *-lowering-*.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              8. cos-lowering-cos.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\color{blue}{\cos \phi_1} \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              9. sin-lowering-sin.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \color{blue}{\sin theta}\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
              10. sub-negN/A

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right)}} \]
              11. +-commutativeN/A

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right) + \cos delta}} \]
            5. Simplified94.4%

              \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos theta, \sin delta \cdot \cos \phi_1, \cos delta \cdot \sin \phi_1\right), -\sin \phi_1, \cos delta\right)}} \]
            6. Taylor expanded in phi1 around 0

              \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
            7. Step-by-step derivation
              1. cos-lowering-cos.f6467.5

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
            8. Simplified67.5%

              \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
            9. Taylor expanded in phi1 around 0

              \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
              2. sin-lowering-sin.f64N/A

                \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{\cos delta} \]
              3. sin-lowering-sin.f6455.6

                \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{\cos delta} \]
            11. Simplified55.6%

              \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]

            if -4.99999999999999977e-7 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 1.99999999999999996e-12

            1. Initial program 99.5%

              \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in delta around 0

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
              2. associate--l+N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
              3. associate-*r*N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
              4. *-commutativeN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
              5. associate-*r*N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
              6. unpow2N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
              7. 1-sub-sinN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
              8. distribute-rgt-outN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
              9. *-lowering-*.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
              10. cos-lowering-cos.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
              11. mul-1-negN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
              12. distribute-lft-neg-outN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
              13. distribute-rgt-neg-inN/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
              14. accelerator-lowering-fma.f64N/A

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
            5. Simplified88.4%

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
            6. Taylor expanded in phi1 around 0

              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
            7. Step-by-step derivation
              1. Simplified80.9%

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]

              if 5 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))))

              1. Initial program 100.0%

                \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in delta around 0

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                2. associate--l+N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                3. associate-*r*N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                4. *-commutativeN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                5. associate-*r*N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                6. unpow2N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                7. 1-sub-sinN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                8. distribute-rgt-outN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                10. cos-lowering-cos.f64N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                11. mul-1-negN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                12. distribute-lft-neg-outN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                13. distribute-rgt-neg-inN/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                14. accelerator-lowering-fma.f64N/A

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
              5. Simplified98.7%

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
              6. Taylor expanded in phi1 around 0

                \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
              7. Step-by-step derivation
                1. Simplified98.7%

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                2. Taylor expanded in phi1 around 0

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                3. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                  2. sin-lowering-sin.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                  3. sin-lowering-sin.f6498.7

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                4. Simplified98.7%

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                5. Taylor expanded in delta around 0

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                6. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                  2. sin-lowering-sin.f6498.8

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{delta \cdot \color{blue}{\sin theta}}{1} \]
                7. Simplified98.8%

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
              8. Recombined 4 regimes into one program.
              9. Final simplification84.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -500:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{1}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 5:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 6: 84.0% accurate, 0.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin delta \cdot \sin theta\\ t_2 := \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ t_3 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\ \mathbf{if}\;t\_2 \leq -500:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{t\_1}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;t\_2 \leq 5:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\ \end{array} \end{array} \]
              (FPCore (lambda1 phi1 phi2 delta theta)
               :precision binary64
               (let* ((t_1 (* (sin delta) (sin theta)))
                      (t_2
                       (+
                        lambda1
                        (atan2
                         (* (cos phi1) t_1)
                         (-
                          (cos delta)
                          (*
                           (sin phi1)
                           (sin
                            (asin
                             (+
                              (* (* (cos phi1) (sin delta)) (cos theta))
                              (* (cos delta) (sin phi1))))))))))
                      (t_3 (atan2 t_1 (cos delta))))
                 (if (<= t_2 -500.0)
                   (+
                    lambda1
                    (atan2
                     (*
                      (sin theta)
                      (fma delta (* -0.16666666666666666 (* delta delta)) delta))
                     1.0))
                   (if (<= t_2 -5e-7)
                     t_3
                     (if (<= t_2 2e-12)
                       (* lambda1 (- (/ (atan2 t_1 1.0) lambda1) -1.0))
                       (if (<= t_2 5.0)
                         t_3
                         (+ lambda1 (atan2 (* delta (sin theta)) 1.0))))))))
              double code(double lambda1, double phi1, double phi2, double delta, double theta) {
              	double t_1 = sin(delta) * sin(theta);
              	double t_2 = lambda1 + atan2((cos(phi1) * t_1), (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
              	double t_3 = atan2(t_1, cos(delta));
              	double tmp;
              	if (t_2 <= -500.0) {
              		tmp = lambda1 + atan2((sin(theta) * fma(delta, (-0.16666666666666666 * (delta * delta)), delta)), 1.0);
              	} else if (t_2 <= -5e-7) {
              		tmp = t_3;
              	} else if (t_2 <= 2e-12) {
              		tmp = lambda1 * ((atan2(t_1, 1.0) / lambda1) - -1.0);
              	} else if (t_2 <= 5.0) {
              		tmp = t_3;
              	} else {
              		tmp = lambda1 + atan2((delta * sin(theta)), 1.0);
              	}
              	return tmp;
              }
              
              function code(lambda1, phi1, phi2, delta, theta)
              	t_1 = Float64(sin(delta) * sin(theta))
              	t_2 = Float64(lambda1 + atan(Float64(cos(phi1) * t_1), Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) + Float64(cos(delta) * sin(phi1)))))))))
              	t_3 = atan(t_1, cos(delta))
              	tmp = 0.0
              	if (t_2 <= -500.0)
              		tmp = Float64(lambda1 + atan(Float64(sin(theta) * fma(delta, Float64(-0.16666666666666666 * Float64(delta * delta)), delta)), 1.0));
              	elseif (t_2 <= -5e-7)
              		tmp = t_3;
              	elseif (t_2 <= 2e-12)
              		tmp = Float64(lambda1 * Float64(Float64(atan(t_1, 1.0) / lambda1) - -1.0));
              	elseif (t_2 <= 5.0)
              		tmp = t_3;
              	else
              		tmp = Float64(lambda1 + atan(Float64(delta * sin(theta)), 1.0));
              	end
              	return tmp
              end
              
              code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -500.0], N[(lambda1 + N[ArcTan[N[(N[Sin[theta], $MachinePrecision] * N[(delta * N[(-0.16666666666666666 * N[(delta * delta), $MachinePrecision]), $MachinePrecision] + delta), $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-7], t$95$3, If[LessEqual[t$95$2, 2e-12], N[(lambda1 * N[(N[(N[ArcTan[t$95$1 / 1.0], $MachinePrecision] / lambda1), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5.0], t$95$3, N[(lambda1 + N[ArcTan[N[(delta * N[Sin[theta], $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision]]]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \sin delta \cdot \sin theta\\
              t_2 := \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
              t_3 := \tan^{-1}_* \frac{t\_1}{\cos delta}\\
              \mathbf{if}\;t\_2 \leq -500:\\
              \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\
              
              \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-7}:\\
              \;\;\;\;t\_3\\
              
              \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-12}:\\
              \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{t\_1}{1}}{\lambda_1} - -1\right)\\
              
              \mathbf{elif}\;t\_2 \leq 5:\\
              \;\;\;\;t\_3\\
              
              \mathbf{else}:\\
              \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -500

                1. Initial program 100.0%

                  \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in delta around 0

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                  2. associate--l+N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                  3. associate-*r*N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                  4. *-commutativeN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                  5. associate-*r*N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                  6. unpow2N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                  7. 1-sub-sinN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                  8. distribute-rgt-outN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                  10. cos-lowering-cos.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                  11. mul-1-negN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                  12. distribute-lft-neg-outN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                  13. distribute-rgt-neg-inN/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                  14. accelerator-lowering-fma.f64N/A

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                5. Simplified100.0%

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                6. Taylor expanded in phi1 around 0

                  \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                7. Step-by-step derivation
                  1. Simplified99.4%

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                  2. Taylor expanded in phi1 around 0

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                  3. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                    2. sin-lowering-sin.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                    3. sin-lowering-sin.f6499.4

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                  4. Simplified99.4%

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                  5. Taylor expanded in delta around 0

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \left(1 + \frac{-1}{6} \cdot {delta}^{2}\right)\right)} \cdot \sin theta}{1} \]
                  6. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \color{blue}{\left(\frac{-1}{6} \cdot {delta}^{2} + 1\right)}\right) \cdot \sin theta}{1} \]
                    2. distribute-lft-inN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \left(\frac{-1}{6} \cdot {delta}^{2}\right) + delta \cdot 1\right)} \cdot \sin theta}{1} \]
                    3. *-rgt-identityN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \left(\frac{-1}{6} \cdot {delta}^{2}\right) + \color{blue}{delta}\right) \cdot \sin theta}{1} \]
                    4. accelerator-lowering-fma.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\mathsf{fma}\left(delta, \frac{-1}{6} \cdot {delta}^{2}, delta\right)} \cdot \sin theta}{1} \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, \color{blue}{\frac{-1}{6} \cdot {delta}^{2}}, delta\right) \cdot \sin theta}{1} \]
                    6. unpow2N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, \frac{-1}{6} \cdot \color{blue}{\left(delta \cdot delta\right)}, delta\right) \cdot \sin theta}{1} \]
                    7. *-lowering-*.f6499.4

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\mathsf{fma}\left(delta, -0.16666666666666666 \cdot \color{blue}{\left(delta \cdot delta\right)}, delta\right) \cdot \sin theta}{1} \]
                  7. Simplified99.4%

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)} \cdot \sin theta}{1} \]

                  if -500 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < -4.99999999999999977e-7 or 1.99999999999999996e-12 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 5

                  1. Initial program 99.5%

                    \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in lambda1 around 0

                    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
                  4. Step-by-step derivation
                    1. atan2-lowering-atan2.f64N/A

                      \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)}} \]
                    2. associate-*r*N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\cos \phi_1 \cdot \sin delta\right) \cdot \sin theta}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    3. *-commutativeN/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\left(\sin delta \cdot \cos \phi_1\right)} \cdot \sin theta}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    4. associate-*l*N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    6. sin-lowering-sin.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\left(\cos \phi_1 \cdot \sin theta\right)}}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    8. cos-lowering-cos.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\color{blue}{\cos \phi_1} \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    9. sin-lowering-sin.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \color{blue}{\sin theta}\right)}{\cos delta - \sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)} \]
                    10. sub-negN/A

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right)}} \]
                    11. +-commutativeN/A

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos theta \cdot \sin delta\right)\right)\right)\right) + \cos delta}} \]
                  5. Simplified94.4%

                    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\cos theta, \sin delta \cdot \cos \phi_1, \cos delta \cdot \sin \phi_1\right), -\sin \phi_1, \cos delta\right)}} \]
                  6. Taylor expanded in phi1 around 0

                    \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
                  7. Step-by-step derivation
                    1. cos-lowering-cos.f6467.5

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
                  8. Simplified67.5%

                    \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \left(\cos \phi_1 \cdot \sin theta\right)}{\color{blue}{\cos delta}} \]
                  9. Taylor expanded in phi1 around 0

                    \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
                  10. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]
                    2. sin-lowering-sin.f64N/A

                      \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{\cos delta} \]
                    3. sin-lowering-sin.f6455.6

                      \[\leadsto \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{\cos delta} \]
                  11. Simplified55.6%

                    \[\leadsto \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{\cos delta} \]

                  if -4.99999999999999977e-7 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))) < 1.99999999999999996e-12

                  1. Initial program 99.5%

                    \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in delta around 0

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                    2. associate--l+N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                    3. associate-*r*N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                    4. *-commutativeN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                    5. associate-*r*N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                    6. unpow2N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                    7. 1-sub-sinN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                    8. distribute-rgt-outN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                    9. *-lowering-*.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                    10. cos-lowering-cos.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                    11. mul-1-negN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                    12. distribute-lft-neg-outN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                    13. distribute-rgt-neg-inN/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                    14. accelerator-lowering-fma.f64N/A

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                  5. Simplified88.4%

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                  6. Taylor expanded in phi1 around 0

                    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                  7. Step-by-step derivation
                    1. Simplified80.9%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                    2. Taylor expanded in phi1 around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                    3. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                      2. sin-lowering-sin.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                      3. sin-lowering-sin.f6479.6

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                    4. Simplified79.6%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                    5. Taylor expanded in lambda1 around -inf

                      \[\leadsto \color{blue}{-1 \cdot \left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right)\right)} \]
                    6. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \color{blue}{\mathsf{neg}\left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right)\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \lambda_1}\right) \]
                      3. distribute-rgt-neg-inN/A

                        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \left(\mathsf{neg}\left(\lambda_1\right)\right)} \]
                      4. mul-1-negN/A

                        \[\leadsto \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \color{blue}{\left(-1 \cdot \lambda_1\right)} \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
                    7. Simplified79.6%

                      \[\leadsto \color{blue}{\left(-1 - \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1}\right) \cdot \left(-\lambda_1\right)} \]

                    if 5 < (+.f64 lambda1 (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))))

                    1. Initial program 100.0%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in delta around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                      2. associate--l+N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                      3. associate-*r*N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      4. *-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      5. associate-*r*N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      6. unpow2N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                      7. 1-sub-sinN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                      8. distribute-rgt-outN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                      9. *-lowering-*.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                      10. cos-lowering-cos.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                      11. mul-1-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                      12. distribute-lft-neg-outN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                      13. distribute-rgt-neg-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                      14. accelerator-lowering-fma.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                    5. Simplified98.7%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                    7. Step-by-step derivation
                      1. Simplified98.7%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                      2. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                      3. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                        2. sin-lowering-sin.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                        3. sin-lowering-sin.f6498.7

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                      4. Simplified98.7%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                      5. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                      6. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                        2. sin-lowering-sin.f6498.8

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{delta \cdot \color{blue}{\sin theta}}{1} \]
                      7. Simplified98.8%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                    8. Recombined 4 regimes into one program.
                    9. Final simplification84.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -500:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\sin theta \cdot \mathsf{fma}\left(delta, -0.16666666666666666 \cdot \left(delta \cdot delta\right), delta\right)}{1}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - -1\right)\\ \mathbf{elif}\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 5:\\ \;\;\;\;\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{\cos delta}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 7: 91.0% accurate, 0.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\ t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_1}{\cos delta}\\ \mathbf{if}\;t\_2 \leq -0.002:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_1}{{\cos \phi_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (let* ((t_1 (* (cos phi1) (* (sin delta) (sin theta))))
                            (t_2
                             (atan2
                              t_1
                              (-
                               (cos delta)
                               (*
                                (sin phi1)
                                (sin
                                 (asin
                                  (+
                                   (* (* (cos phi1) (sin delta)) (cos theta))
                                   (* (cos delta) (sin phi1)))))))))
                            (t_3 (+ lambda1 (atan2 t_1 (cos delta)))))
                       (if (<= t_2 -0.002)
                         t_3
                         (if (<= t_2 2e-19) (+ lambda1 (atan2 t_1 (pow (cos phi1) 2.0))) t_3))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	double t_1 = cos(phi1) * (sin(delta) * sin(theta));
                    	double t_2 = atan2(t_1, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
                    	double t_3 = lambda1 + atan2(t_1, cos(delta));
                    	double tmp;
                    	if (t_2 <= -0.002) {
                    		tmp = t_3;
                    	} else if (t_2 <= 2e-19) {
                    		tmp = lambda1 + atan2(t_1, pow(cos(phi1), 2.0));
                    	} else {
                    		tmp = t_3;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(lambda1, phi1, phi2, delta, theta)
                        real(8), intent (in) :: lambda1
                        real(8), intent (in) :: phi1
                        real(8), intent (in) :: phi2
                        real(8), intent (in) :: delta
                        real(8), intent (in) :: theta
                        real(8) :: t_1
                        real(8) :: t_2
                        real(8) :: t_3
                        real(8) :: tmp
                        t_1 = cos(phi1) * (sin(delta) * sin(theta))
                        t_2 = atan2(t_1, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))))
                        t_3 = lambda1 + atan2(t_1, cos(delta))
                        if (t_2 <= (-0.002d0)) then
                            tmp = t_3
                        else if (t_2 <= 2d-19) then
                            tmp = lambda1 + atan2(t_1, (cos(phi1) ** 2.0d0))
                        else
                            tmp = t_3
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	double t_1 = Math.cos(phi1) * (Math.sin(delta) * Math.sin(theta));
                    	double t_2 = Math.atan2(t_1, (Math.cos(delta) - (Math.sin(phi1) * Math.sin(Math.asin((((Math.cos(phi1) * Math.sin(delta)) * Math.cos(theta)) + (Math.cos(delta) * Math.sin(phi1))))))));
                    	double t_3 = lambda1 + Math.atan2(t_1, Math.cos(delta));
                    	double tmp;
                    	if (t_2 <= -0.002) {
                    		tmp = t_3;
                    	} else if (t_2 <= 2e-19) {
                    		tmp = lambda1 + Math.atan2(t_1, Math.pow(Math.cos(phi1), 2.0));
                    	} else {
                    		tmp = t_3;
                    	}
                    	return tmp;
                    }
                    
                    def code(lambda1, phi1, phi2, delta, theta):
                    	t_1 = math.cos(phi1) * (math.sin(delta) * math.sin(theta))
                    	t_2 = math.atan2(t_1, (math.cos(delta) - (math.sin(phi1) * math.sin(math.asin((((math.cos(phi1) * math.sin(delta)) * math.cos(theta)) + (math.cos(delta) * math.sin(phi1))))))))
                    	t_3 = lambda1 + math.atan2(t_1, math.cos(delta))
                    	tmp = 0
                    	if t_2 <= -0.002:
                    		tmp = t_3
                    	elif t_2 <= 2e-19:
                    		tmp = lambda1 + math.atan2(t_1, math.pow(math.cos(phi1), 2.0))
                    	else:
                    		tmp = t_3
                    	return tmp
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	t_1 = Float64(cos(phi1) * Float64(sin(delta) * sin(theta)))
                    	t_2 = atan(t_1, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) + Float64(cos(delta) * sin(phi1))))))))
                    	t_3 = Float64(lambda1 + atan(t_1, cos(delta)))
                    	tmp = 0.0
                    	if (t_2 <= -0.002)
                    		tmp = t_3;
                    	elseif (t_2 <= 2e-19)
                    		tmp = Float64(lambda1 + atan(t_1, (cos(phi1) ^ 2.0)));
                    	else
                    		tmp = t_3;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(lambda1, phi1, phi2, delta, theta)
                    	t_1 = cos(phi1) * (sin(delta) * sin(theta));
                    	t_2 = atan2(t_1, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
                    	t_3 = lambda1 + atan2(t_1, cos(delta));
                    	tmp = 0.0;
                    	if (t_2 <= -0.002)
                    		tmp = t_3;
                    	elseif (t_2 <= 2e-19)
                    		tmp = lambda1 + atan2(t_1, (cos(phi1) ^ 2.0));
                    	else
                    		tmp = t_3;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[t$95$1 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(lambda1 + N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.002], t$95$3, If[LessEqual[t$95$2, 2e-19], N[(lambda1 + N[ArcTan[t$95$1 / N[Power[N[Cos[phi1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\
                    t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
                    t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_1}{\cos delta}\\
                    \mathbf{if}\;t\_2 \leq -0.002:\\
                    \;\;\;\;t\_3\\
                    
                    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-19}:\\
                    \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_1}{{\cos \phi_1}^{2}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_3\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))) < -2e-3 or 2e-19 < (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))

                      1. Initial program 99.7%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      4. Step-by-step derivation
                        1. cos-lowering-cos.f6485.3

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      5. Simplified85.3%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]

                      if -2e-3 < (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))) < 2e-19

                      1. Initial program 99.8%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right)}} \]
                        2. +-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right) + \cos delta}} \]
                        3. sin-asinN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}\right)\right) + \cos delta} \]
                        4. distribute-lft-neg-inN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1\right)\right) \cdot \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} + \cos delta} \]
                        5. distribute-rgt-inN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right)\right)} + \cos delta} \]
                        6. associate-+l+N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \cos delta\right)}} \]
                      4. Applied egg-rr99.8%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(\left(-\sin \phi_1\right) \cdot \sin \phi_1, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)}} \]
                      5. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1 + -1 \cdot {\sin \phi_1}^{2}}} \]
                      6. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{1 + \color{blue}{\left(\mathsf{neg}\left({\sin \phi_1}^{2}\right)\right)}} \]
                        2. sub-negN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1 - {\sin \phi_1}^{2}}} \]
                        3. unpow2N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}} \]
                        4. 1-sub-sinN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                        5. unpow2N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                        6. pow-lowering-pow.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                        7. cos-lowering-cos.f6496.5

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{{\color{blue}{\cos \phi_1}}^{2}} \]
                      7. Simplified96.5%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification91.6%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -0.002:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \mathbf{elif}\;\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{{\cos \phi_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 8: 90.9% accurate, 0.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\ t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\ t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_1}{\cos delta}\\ \mathbf{if}\;t\_2 \leq -0.002:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_1}{\mathsf{fma}\left(0.5, \cos \left(\phi_1 \cdot 2\right), 0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (let* ((t_1 (* (cos phi1) (* (sin delta) (sin theta))))
                            (t_2
                             (atan2
                              t_1
                              (-
                               (cos delta)
                               (*
                                (sin phi1)
                                (sin
                                 (asin
                                  (+
                                   (* (* (cos phi1) (sin delta)) (cos theta))
                                   (* (cos delta) (sin phi1)))))))))
                            (t_3 (+ lambda1 (atan2 t_1 (cos delta)))))
                       (if (<= t_2 -0.002)
                         t_3
                         (if (<= t_2 2e-19)
                           (+ lambda1 (atan2 t_1 (fma 0.5 (cos (* phi1 2.0)) 0.5)))
                           t_3))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	double t_1 = cos(phi1) * (sin(delta) * sin(theta));
                    	double t_2 = atan2(t_1, (cos(delta) - (sin(phi1) * sin(asin((((cos(phi1) * sin(delta)) * cos(theta)) + (cos(delta) * sin(phi1))))))));
                    	double t_3 = lambda1 + atan2(t_1, cos(delta));
                    	double tmp;
                    	if (t_2 <= -0.002) {
                    		tmp = t_3;
                    	} else if (t_2 <= 2e-19) {
                    		tmp = lambda1 + atan2(t_1, fma(0.5, cos((phi1 * 2.0)), 0.5));
                    	} else {
                    		tmp = t_3;
                    	}
                    	return tmp;
                    }
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	t_1 = Float64(cos(phi1) * Float64(sin(delta) * sin(theta)))
                    	t_2 = atan(t_1, Float64(cos(delta) - Float64(sin(phi1) * sin(asin(Float64(Float64(Float64(cos(phi1) * sin(delta)) * cos(theta)) + Float64(cos(delta) * sin(phi1))))))))
                    	t_3 = Float64(lambda1 + atan(t_1, cos(delta)))
                    	tmp = 0.0
                    	if (t_2 <= -0.002)
                    		tmp = t_3;
                    	elseif (t_2 <= 2e-19)
                    		tmp = Float64(lambda1 + atan(t_1, fma(0.5, cos(Float64(phi1 * 2.0)), 0.5)));
                    	else
                    		tmp = t_3;
                    	end
                    	return tmp
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[t$95$1 / N[(N[Cos[delta], $MachinePrecision] - N[(N[Sin[phi1], $MachinePrecision] * N[Sin[N[ArcSin[N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision]), $MachinePrecision] * N[Cos[theta], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(lambda1 + N[ArcTan[t$95$1 / N[Cos[delta], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.002], t$95$3, If[LessEqual[t$95$2, 2e-19], N[(lambda1 + N[ArcTan[t$95$1 / N[(0.5 * N[Cos[N[(phi1 * 2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)\\
                    t_2 := \tan^{-1}_* \frac{t\_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)}\\
                    t_3 := \lambda_1 + \tan^{-1}_* \frac{t\_1}{\cos delta}\\
                    \mathbf{if}\;t\_2 \leq -0.002:\\
                    \;\;\;\;t\_3\\
                    
                    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-19}:\\
                    \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{t\_1}{\mathsf{fma}\left(0.5, \cos \left(\phi_1 \cdot 2\right), 0.5\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_3\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))) < -2e-3 or 2e-19 < (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta))))))))

                      1. Initial program 99.7%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      4. Step-by-step derivation
                        1. cos-lowering-cos.f6485.3

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      5. Simplified85.3%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]

                      if -2e-3 < (atan2.f64 (*.f64 (*.f64 (sin.f64 theta) (sin.f64 delta)) (cos.f64 phi1)) (-.f64 (cos.f64 delta) (*.f64 (sin.f64 phi1) (sin.f64 (asin.f64 (+.f64 (*.f64 (sin.f64 phi1) (cos.f64 delta)) (*.f64 (*.f64 (cos.f64 phi1) (sin.f64 delta)) (cos.f64 theta)))))))) < 2e-19

                      1. Initial program 99.8%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. sin-asinN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}} \]
                        2. distribute-rgt-inN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \sin \phi_1 + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
                        3. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\sin \phi_1 \cdot \left(\cos delta \cdot \sin \phi_1\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        4. *-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta\right)} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        5. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \left(\color{blue}{\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta} + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        6. accelerator-lowering-fma.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_1, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
                        7. sqr-sin-aN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        8. --lowering--.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        10. cos-lowering-cos.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \color{blue}{\cos \left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \color{blue}{\left(2 \cdot \phi_1\right)}, \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        12. cos-lowering-cos.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \color{blue}{\cos delta}, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \color{blue}{\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1}\right)} \]
                      4. Applied egg-rr99.8%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \phi_1\right), \cos delta, \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \sin \phi_1\right)}} \]
                      5. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)}} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right) + \frac{1}{2}}} \]
                        2. accelerator-lowering-fma.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(\frac{1}{2}, \cos \left(2 \cdot \phi_1\right), \frac{1}{2}\right)}} \]
                        3. cos-lowering-cos.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(2 \cdot \phi_1\right)}, \frac{1}{2}\right)} \]
                        4. *-lowering-*.f6496.4

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(0.5, \cos \color{blue}{\left(2 \cdot \phi_1\right)}, 0.5\right)} \]
                      7. Simplified96.4%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(0.5, \cos \left(2 \cdot \phi_1\right), 0.5\right)}} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification91.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq -0.002:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \mathbf{elif}\;\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta + \cos delta \cdot \sin \phi_1\right)} \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5, \cos \left(\phi_1 \cdot 2\right), 0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 9: 94.5% accurate, 1.3× speedup?

                    \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(-\sin \phi_1, \mathsf{fma}\left(\cos \phi_1, \sin delta, \cos delta \cdot \sin \phi_1\right), \cos delta\right)} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (+
                      lambda1
                      (atan2
                       (* (cos phi1) (* (sin delta) (sin theta)))
                       (fma
                        (- (sin phi1))
                        (fma (cos phi1) (sin delta) (* (cos delta) (sin phi1)))
                        (cos delta)))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), fma(-sin(phi1), fma(cos(phi1), sin(delta), (cos(delta) * sin(phi1))), cos(delta)));
                    }
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	return Float64(lambda1 + atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), fma(Float64(-sin(phi1)), fma(cos(phi1), sin(delta), Float64(cos(delta) * sin(phi1))), cos(delta))))
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-N[Sin[phi1], $MachinePrecision]) * N[(N[Cos[phi1], $MachinePrecision] * N[Sin[delta], $MachinePrecision] + N[(N[Cos[delta], $MachinePrecision] * N[Sin[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Cos[delta], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(-\sin \phi_1, \mathsf{fma}\left(\cos \phi_1, \sin delta, \cos delta \cdot \sin \phi_1\right), \cos delta\right)}
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. sub-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right)}} \]
                      2. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right) + \cos delta}} \]
                      3. sin-asinN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}\right)\right) + \cos delta} \]
                      4. distribute-lft-neg-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1\right)\right) \cdot \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} + \cos delta} \]
                      5. distribute-rgt-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right)\right)} + \cos delta} \]
                      6. associate-+l+N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \cos delta\right)}} \]
                    4. Applied egg-rr99.8%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(\left(-\sin \phi_1\right) \cdot \sin \phi_1, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)}} \]
                    5. Taylor expanded in theta around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(-1 \cdot \left(\cos delta \cdot {\sin \phi_1}^{2}\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)\right)}} \]
                    6. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(\cos delta \cdot {\sin \phi_1}^{2}\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)\right) + \cos delta}} \]
                      2. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right) + -1 \cdot \left(\cos delta \cdot {\sin \phi_1}^{2}\right)\right)} + \cos delta} \]
                    7. Simplified94.1%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(-\sin \phi_1, \mathsf{fma}\left(\cos \phi_1, \sin delta, \sin \phi_1 \cdot \cos delta\right), \cos delta\right)}} \]
                    8. Final simplification94.1%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(-\sin \phi_1, \mathsf{fma}\left(\cos \phi_1, \sin delta, \cos delta \cdot \sin \phi_1\right), \cos delta\right)} \]
                    9. Add Preprocessing

                    Alternative 10: 94.5% accurate, 1.4× speedup?

                    \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \left(-\sin delta\right)\right)\right)} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (+
                      lambda1
                      (atan2
                       (* (cos phi1) (* (sin delta) (sin theta)))
                       (fma
                        (+ 0.5 (* 0.5 (cos (* phi1 -2.0))))
                        (cos delta)
                        (* (sin phi1) (* (cos phi1) (- (sin delta))))))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), fma((0.5 + (0.5 * cos((phi1 * -2.0)))), cos(delta), (sin(phi1) * (cos(phi1) * -sin(delta)))));
                    }
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	return Float64(lambda1 + atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), fma(Float64(0.5 + Float64(0.5 * cos(Float64(phi1 * -2.0)))), cos(delta), Float64(sin(phi1) * Float64(cos(phi1) * Float64(-sin(delta)))))))
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 + N[(0.5 * N[Cos[N[(phi1 * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[delta], $MachinePrecision] + N[(N[Sin[phi1], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * (-N[Sin[delta], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \left(-\sin delta\right)\right)\right)}
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. sub-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right)}} \]
                      2. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right) + \cos delta}} \]
                      3. sin-asinN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\mathsf{neg}\left(\sin \phi_1 \cdot \color{blue}{\left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)}\right)\right) + \cos delta} \]
                      4. distribute-lft-neg-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\mathsf{neg}\left(\sin \phi_1\right)\right) \cdot \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} + \cos delta} \]
                      5. distribute-rgt-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right)\right)} + \cos delta} \]
                      6. associate-+l+N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\sin \phi_1 \cdot \cos delta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \left(\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right) \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right) + \cos delta\right)}} \]
                    4. Applied egg-rr99.8%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(\left(-\sin \phi_1\right) \cdot \sin \phi_1, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)}} \]
                    5. Step-by-step derivation
                      1. distribute-lft-neg-outN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(\sin \phi_1 \cdot \sin \phi_1\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      2. neg-lowering-neg.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(\sin \phi_1 \cdot \sin \phi_1\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      3. sqr-sin-aN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      4. sub-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      5. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right) + \frac{1}{2}\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      6. *-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \phi_1\right) \cdot \frac{1}{2}}\right)\right) + \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      7. distribute-rgt-neg-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\color{blue}{\cos \left(2 \cdot \phi_1\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      8. accelerator-lowering-fma.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\cos \left(2 \cdot \phi_1\right), \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)}\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      9. cos-2N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_1 - \sin \phi_1 \cdot \sin \phi_1}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      10. cos-sumN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      11. cos-lowering-cos.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 + \phi_1\right)}, \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right)\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, \mathsf{neg}\left(\sin \phi_1\right), \cos delta\right)\right)} \]
                      13. metadata-eval99.8

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(-\mathsf{fma}\left(\cos \left(\phi_1 + \phi_1\right), \color{blue}{-0.5}, 0.5\right), \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)} \]
                    6. Applied egg-rr99.8%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\mathsf{fma}\left(\color{blue}{-\mathsf{fma}\left(\cos \left(\phi_1 + \phi_1\right), -0.5, 0.5\right)}, \cos delta, \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta, -\sin \phi_1, \cos delta\right)\right)} \]
                    7. Taylor expanded in theta around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta + \left(-1 \cdot \left(\cos delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)\right)}} \]
                    8. Step-by-step derivation
                      1. associate-+r+N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\cos delta + -1 \cdot \left(\cos delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)}} \]
                      2. mul-1-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\cos delta + \color{blue}{\left(\mathsf{neg}\left(\cos delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right)}\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      3. unsub-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\cos delta - \cos delta \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)} + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      4. *-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\cos delta - \color{blue}{\left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right) \cdot \cos delta}\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      5. cancel-sign-sub-invN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\cos delta + \left(\mathsf{neg}\left(\left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)\right) \cdot \cos delta\right)} + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      6. mul-1-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\cos delta + \color{blue}{\left(-1 \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)} \cdot \cos delta\right) + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      7. distribute-rgt1-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right) + 1\right) \cdot \cos delta} + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      8. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right)\right)} \cdot \cos delta + -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)} \]
                      9. accelerator-lowering-fma.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(1 + -1 \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(2 \cdot \phi_1\right)\right), \cos delta, -1 \cdot \left(\cos \phi_1 \cdot \left(\sin delta \cdot \sin \phi_1\right)\right)\right)}} \]
                    9. Simplified94.0%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, -\sin \phi_1 \cdot \left(\sin delta \cdot \cos \phi_1\right)\right)}} \]
                    10. Final simplification94.0%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(\phi_1 \cdot -2\right), \cos delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \left(-\sin delta\right)\right)\right)} \]
                    11. Add Preprocessing

                    Alternative 11: 92.2% accurate, 2.1× speedup?

                    \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta + \left(0.5 \cdot \cos \left(\phi_1 + \phi_1\right) - 0.5\right)} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (+
                      lambda1
                      (atan2
                       (* (cos phi1) (* (sin delta) (sin theta)))
                       (+ (cos delta) (- (* 0.5 (cos (+ phi1 phi1))) 0.5)))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), (cos(delta) + ((0.5 * cos((phi1 + phi1))) - 0.5)));
                    }
                    
                    real(8) function code(lambda1, phi1, phi2, delta, theta)
                        real(8), intent (in) :: lambda1
                        real(8), intent (in) :: phi1
                        real(8), intent (in) :: phi2
                        real(8), intent (in) :: delta
                        real(8), intent (in) :: theta
                        code = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), (cos(delta) + ((0.5d0 * cos((phi1 + phi1))) - 0.5d0)))
                    end function
                    
                    public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + Math.atan2((Math.cos(phi1) * (Math.sin(delta) * Math.sin(theta))), (Math.cos(delta) + ((0.5 * Math.cos((phi1 + phi1))) - 0.5)));
                    }
                    
                    def code(lambda1, phi1, phi2, delta, theta):
                    	return lambda1 + math.atan2((math.cos(phi1) * (math.sin(delta) * math.sin(theta))), (math.cos(delta) + ((0.5 * math.cos((phi1 + phi1))) - 0.5)))
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	return Float64(lambda1 + atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), Float64(cos(delta) + Float64(Float64(0.5 * cos(Float64(phi1 + phi1))) - 0.5))))
                    end
                    
                    function tmp = code(lambda1, phi1, phi2, delta, theta)
                    	tmp = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), (cos(delta) + ((0.5 * cos((phi1 + phi1))) - 0.5)));
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[delta], $MachinePrecision] + N[(N[(0.5 * N[Cos[N[(phi1 + phi1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta + \left(0.5 \cdot \cos \left(\phi_1 + \phi_1\right) - 0.5\right)}
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in delta around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{{\sin \phi_1}^{2}}} \]
                    4. Step-by-step derivation
                      1. pow-lowering-pow.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{{\sin \phi_1}^{2}}} \]
                      2. sin-lowering-sin.f6490.0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - {\color{blue}{\sin \phi_1}}^{2}} \]
                    5. Simplified90.0%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \color{blue}{{\sin \phi_1}^{2}}} \]
                    6. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{\tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - {\sin \phi_1}^{2}} + \lambda_1} \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \color{blue}{\tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - {\sin \phi_1}^{2}} + \lambda_1} \]
                    7. Applied egg-rr90.0%

                      \[\leadsto \color{blue}{\tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta - \left(0.5 - 0.5 \cdot \cos \left(\phi_1 + \phi_1\right)\right)} + \lambda_1} \]
                    8. Final simplification90.0%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta + \left(0.5 \cdot \cos \left(\phi_1 + \phi_1\right) - 0.5\right)} \]
                    9. Add Preprocessing

                    Alternative 12: 91.8% accurate, 2.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \mathbf{if}\;delta \leq -4.5 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;delta \leq 8.6 \cdot 10^{-18}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(delta \cdot \sin theta\right)}{{\cos \phi_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (let* ((t_1
                             (+
                              lambda1
                              (atan2 (* (cos phi1) (* (sin delta) (sin theta))) (cos delta)))))
                       (if (<= delta -4.5e-6)
                         t_1
                         (if (<= delta 8.6e-18)
                           (+
                            lambda1
                            (atan2 (* (cos phi1) (* delta (sin theta))) (pow (cos phi1) 2.0)))
                           t_1))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	double t_1 = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta));
                    	double tmp;
                    	if (delta <= -4.5e-6) {
                    		tmp = t_1;
                    	} else if (delta <= 8.6e-18) {
                    		tmp = lambda1 + atan2((cos(phi1) * (delta * sin(theta))), pow(cos(phi1), 2.0));
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(lambda1, phi1, phi2, delta, theta)
                        real(8), intent (in) :: lambda1
                        real(8), intent (in) :: phi1
                        real(8), intent (in) :: phi2
                        real(8), intent (in) :: delta
                        real(8), intent (in) :: theta
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta))
                        if (delta <= (-4.5d-6)) then
                            tmp = t_1
                        else if (delta <= 8.6d-18) then
                            tmp = lambda1 + atan2((cos(phi1) * (delta * sin(theta))), (cos(phi1) ** 2.0d0))
                        else
                            tmp = t_1
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	double t_1 = lambda1 + Math.atan2((Math.cos(phi1) * (Math.sin(delta) * Math.sin(theta))), Math.cos(delta));
                    	double tmp;
                    	if (delta <= -4.5e-6) {
                    		tmp = t_1;
                    	} else if (delta <= 8.6e-18) {
                    		tmp = lambda1 + Math.atan2((Math.cos(phi1) * (delta * Math.sin(theta))), Math.pow(Math.cos(phi1), 2.0));
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    def code(lambda1, phi1, phi2, delta, theta):
                    	t_1 = lambda1 + math.atan2((math.cos(phi1) * (math.sin(delta) * math.sin(theta))), math.cos(delta))
                    	tmp = 0
                    	if delta <= -4.5e-6:
                    		tmp = t_1
                    	elif delta <= 8.6e-18:
                    		tmp = lambda1 + math.atan2((math.cos(phi1) * (delta * math.sin(theta))), math.pow(math.cos(phi1), 2.0))
                    	else:
                    		tmp = t_1
                    	return tmp
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	t_1 = Float64(lambda1 + atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), cos(delta)))
                    	tmp = 0.0
                    	if (delta <= -4.5e-6)
                    		tmp = t_1;
                    	elseif (delta <= 8.6e-18)
                    		tmp = Float64(lambda1 + atan(Float64(cos(phi1) * Float64(delta * sin(theta))), (cos(phi1) ^ 2.0)));
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(lambda1, phi1, phi2, delta, theta)
                    	t_1 = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta));
                    	tmp = 0.0;
                    	if (delta <= -4.5e-6)
                    		tmp = t_1;
                    	elseif (delta <= 8.6e-18)
                    		tmp = lambda1 + atan2((cos(phi1) * (delta * sin(theta))), (cos(phi1) ^ 2.0));
                    	else
                    		tmp = t_1;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := Block[{t$95$1 = N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[delta], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[delta, -4.5e-6], t$95$1, If[LessEqual[delta, 8.6e-18], N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(delta * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Cos[phi1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\
                    \mathbf{if}\;delta \leq -4.5 \cdot 10^{-6}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;delta \leq 8.6 \cdot 10^{-18}:\\
                    \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(delta \cdot \sin theta\right)}{{\cos \phi_1}^{2}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if delta < -4.50000000000000011e-6 or 8.6000000000000005e-18 < delta

                      1. Initial program 99.8%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      4. Step-by-step derivation
                        1. cos-lowering-cos.f6482.9

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                      5. Simplified82.9%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]

                      if -4.50000000000000011e-6 < delta < 8.6000000000000005e-18

                      1. Initial program 99.7%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                        2. associate--l+N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                        3. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        4. *-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        5. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        6. unpow2N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                        7. 1-sub-sinN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                        8. distribute-rgt-outN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                        10. cos-lowering-cos.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                        11. mul-1-negN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                        12. distribute-lft-neg-outN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                        13. distribute-rgt-neg-inN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                        14. accelerator-lowering-fma.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                      5. Simplified99.8%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                      6. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \sin theta\right)} \cdot \cos \phi_1}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right), \cos \phi_1\right)} \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \sin theta\right)} \cdot \cos \phi_1}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(\mathsf{neg}\left(\sin \phi_1\right)\right), \cos \phi_1\right)} \]
                        2. sin-lowering-sin.f6499.8

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \color{blue}{\sin theta}\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)} \]
                      8. Simplified99.8%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\left(delta \cdot \sin theta\right)} \cdot \cos \phi_1}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)} \]
                      9. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \sin theta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                      10. Step-by-step derivation
                        1. pow-lowering-pow.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \sin theta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                        2. cos-lowering-cos.f6499.5

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \sin theta\right) \cdot \cos \phi_1}{{\color{blue}{\cos \phi_1}}^{2}} \]
                      11. Simplified99.5%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(delta \cdot \sin theta\right) \cdot \cos \phi_1}{\color{blue}{{\cos \phi_1}^{2}}} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification90.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;delta \leq -4.5 \cdot 10^{-6}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \mathbf{elif}\;delta \leq 8.6 \cdot 10^{-18}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(delta \cdot \sin theta\right)}{{\cos \phi_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 13: 88.5% accurate, 2.6× speedup?

                    \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta} \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (+ lambda1 (atan2 (* (cos phi1) (* (sin delta) (sin theta))) (cos delta))))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta));
                    }
                    
                    real(8) function code(lambda1, phi1, phi2, delta, theta)
                        real(8), intent (in) :: lambda1
                        real(8), intent (in) :: phi1
                        real(8), intent (in) :: phi2
                        real(8), intent (in) :: delta
                        real(8), intent (in) :: theta
                        code = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta))
                    end function
                    
                    public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 + Math.atan2((Math.cos(phi1) * (Math.sin(delta) * Math.sin(theta))), Math.cos(delta));
                    }
                    
                    def code(lambda1, phi1, phi2, delta, theta):
                    	return lambda1 + math.atan2((math.cos(phi1) * (math.sin(delta) * math.sin(theta))), math.cos(delta))
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	return Float64(lambda1 + atan(Float64(cos(phi1) * Float64(sin(delta) * sin(theta))), cos(delta)))
                    end
                    
                    function tmp = code(lambda1, phi1, phi2, delta, theta)
                    	tmp = lambda1 + atan2((cos(phi1) * (sin(delta) * sin(theta))), cos(delta));
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[Cos[phi1], $MachinePrecision] * N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[delta], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta}
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi1 around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                    4. Step-by-step derivation
                      1. cos-lowering-cos.f6487.3

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                    5. Simplified87.3%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos delta}} \]
                    6. Final simplification87.3%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\cos delta} \]
                    7. Add Preprocessing

                    Alternative 14: 76.2% accurate, 4.1× speedup?

                    \[\begin{array}{l} \\ \lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - -1\right) \end{array} \]
                    (FPCore (lambda1 phi1 phi2 delta theta)
                     :precision binary64
                     (* lambda1 (- (/ (atan2 (* (sin delta) (sin theta)) 1.0) lambda1) -1.0)))
                    double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 * ((atan2((sin(delta) * sin(theta)), 1.0) / lambda1) - -1.0);
                    }
                    
                    real(8) function code(lambda1, phi1, phi2, delta, theta)
                        real(8), intent (in) :: lambda1
                        real(8), intent (in) :: phi1
                        real(8), intent (in) :: phi2
                        real(8), intent (in) :: delta
                        real(8), intent (in) :: theta
                        code = lambda1 * ((atan2((sin(delta) * sin(theta)), 1.0d0) / lambda1) - (-1.0d0))
                    end function
                    
                    public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                    	return lambda1 * ((Math.atan2((Math.sin(delta) * Math.sin(theta)), 1.0) / lambda1) - -1.0);
                    }
                    
                    def code(lambda1, phi1, phi2, delta, theta):
                    	return lambda1 * ((math.atan2((math.sin(delta) * math.sin(theta)), 1.0) / lambda1) - -1.0)
                    
                    function code(lambda1, phi1, phi2, delta, theta)
                    	return Float64(lambda1 * Float64(Float64(atan(Float64(sin(delta) * sin(theta)), 1.0) / lambda1) - -1.0))
                    end
                    
                    function tmp = code(lambda1, phi1, phi2, delta, theta)
                    	tmp = lambda1 * ((atan2((sin(delta) * sin(theta)), 1.0) / lambda1) - -1.0);
                    end
                    
                    code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 * N[(N[(N[ArcTan[N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision] / lambda1), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - -1\right)
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in delta around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                      2. associate--l+N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                      3. associate-*r*N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      4. *-commutativeN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      5. associate-*r*N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                      6. unpow2N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                      7. 1-sub-sinN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                      8. distribute-rgt-outN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                      9. *-lowering-*.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                      10. cos-lowering-cos.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                      11. mul-1-negN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                      12. distribute-lft-neg-outN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                      13. distribute-rgt-neg-inN/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                      14. accelerator-lowering-fma.f64N/A

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                    5. Simplified79.7%

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                    7. Step-by-step derivation
                      1. Simplified76.1%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                      2. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                      3. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                        2. sin-lowering-sin.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                        3. sin-lowering-sin.f6475.1

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                      4. Simplified75.1%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                      5. Taylor expanded in lambda1 around -inf

                        \[\leadsto \color{blue}{-1 \cdot \left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right)\right)} \]
                      6. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left(\lambda_1 \cdot \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right)\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \lambda_1}\right) \]
                        3. distribute-rgt-neg-inN/A

                          \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \left(\mathsf{neg}\left(\lambda_1\right)\right)} \]
                        4. mul-1-negN/A

                          \[\leadsto \left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \color{blue}{\left(-1 \cdot \lambda_1\right)} \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \color{blue}{\left(-1 \cdot \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - 1\right) \cdot \left(-1 \cdot \lambda_1\right)} \]
                      7. Simplified75.1%

                        \[\leadsto \color{blue}{\left(-1 - \frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1}\right) \cdot \left(-\lambda_1\right)} \]
                      8. Final simplification75.1%

                        \[\leadsto \lambda_1 \cdot \left(\frac{\tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}}{\lambda_1} - -1\right) \]
                      9. Add Preprocessing

                      Alternative 15: 76.3% accurate, 4.3× speedup?

                      \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1} \end{array} \]
                      (FPCore (lambda1 phi1 phi2 delta theta)
                       :precision binary64
                       (+ lambda1 (atan2 (* (sin delta) (sin theta)) 1.0)))
                      double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                      	return lambda1 + atan2((sin(delta) * sin(theta)), 1.0);
                      }
                      
                      real(8) function code(lambda1, phi1, phi2, delta, theta)
                          real(8), intent (in) :: lambda1
                          real(8), intent (in) :: phi1
                          real(8), intent (in) :: phi2
                          real(8), intent (in) :: delta
                          real(8), intent (in) :: theta
                          code = lambda1 + atan2((sin(delta) * sin(theta)), 1.0d0)
                      end function
                      
                      public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                      	return lambda1 + Math.atan2((Math.sin(delta) * Math.sin(theta)), 1.0);
                      }
                      
                      def code(lambda1, phi1, phi2, delta, theta):
                      	return lambda1 + math.atan2((math.sin(delta) * math.sin(theta)), 1.0)
                      
                      function code(lambda1, phi1, phi2, delta, theta)
                      	return Float64(lambda1 + atan(Float64(sin(delta) * sin(theta)), 1.0))
                      end
                      
                      function tmp = code(lambda1, phi1, phi2, delta, theta)
                      	tmp = lambda1 + atan2((sin(delta) * sin(theta)), 1.0);
                      end
                      
                      code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(N[Sin[delta], $MachinePrecision] * N[Sin[theta], $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \sin theta}{1}
                      \end{array}
                      
                      Derivation
                      1. Initial program 99.8%

                        \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in delta around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                        2. associate--l+N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                        3. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        4. *-commutativeN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        5. associate-*r*N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                        6. unpow2N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                        7. 1-sub-sinN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                        8. distribute-rgt-outN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                        10. cos-lowering-cos.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                        11. mul-1-negN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                        12. distribute-lft-neg-outN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                        13. distribute-rgt-neg-inN/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                        14. accelerator-lowering-fma.f64N/A

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                      5. Simplified79.7%

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                      6. Taylor expanded in phi1 around 0

                        \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                      7. Step-by-step derivation
                        1. Simplified76.1%

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                        2. Taylor expanded in phi1 around 0

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                        3. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                          2. sin-lowering-sin.f64N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                          3. sin-lowering-sin.f6475.1

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                        4. Simplified75.1%

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                        5. Add Preprocessing

                        Alternative 16: 73.6% accurate, 6.4× speedup?

                        \[\begin{array}{l} \\ \lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1} \end{array} \]
                        (FPCore (lambda1 phi1 phi2 delta theta)
                         :precision binary64
                         (+ lambda1 (atan2 (* delta (sin theta)) 1.0)))
                        double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                        	return lambda1 + atan2((delta * sin(theta)), 1.0);
                        }
                        
                        real(8) function code(lambda1, phi1, phi2, delta, theta)
                            real(8), intent (in) :: lambda1
                            real(8), intent (in) :: phi1
                            real(8), intent (in) :: phi2
                            real(8), intent (in) :: delta
                            real(8), intent (in) :: theta
                            code = lambda1 + atan2((delta * sin(theta)), 1.0d0)
                        end function
                        
                        public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                        	return lambda1 + Math.atan2((delta * Math.sin(theta)), 1.0);
                        }
                        
                        def code(lambda1, phi1, phi2, delta, theta):
                        	return lambda1 + math.atan2((delta * math.sin(theta)), 1.0)
                        
                        function code(lambda1, phi1, phi2, delta, theta)
                        	return Float64(lambda1 + atan(Float64(delta * sin(theta)), 1.0))
                        end
                        
                        function tmp = code(lambda1, phi1, phi2, delta, theta)
                        	tmp = lambda1 + atan2((delta * sin(theta)), 1.0);
                        end
                        
                        code[lambda1_, phi1_, phi2_, delta_, theta_] := N[(lambda1 + N[ArcTan[N[(delta * N[Sin[theta], $MachinePrecision]), $MachinePrecision] / 1.0], $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        \lambda_1 + \tan^{-1}_* \frac{delta \cdot \sin theta}{1}
                        \end{array}
                        
                        Derivation
                        1. Initial program 99.8%

                          \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in delta around 0

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(1 + -1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)\right) - {\sin \phi_1}^{2}}} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + 1\right)} - {\sin \phi_1}^{2}} \]
                          2. associate--l+N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{-1 \cdot \left(delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right) + \left(1 - {\sin \phi_1}^{2}\right)}} \]
                          3. associate-*r*N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(-1 \cdot delta\right) \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                          4. *-commutativeN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(-1 \cdot delta\right) \cdot \color{blue}{\left(\left(\cos theta \cdot \sin \phi_1\right) \cdot \cos \phi_1\right)} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                          5. associate-*r*N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1} + \left(1 - {\sin \phi_1}^{2}\right)} \]
                          6. unpow2N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \left(1 - \color{blue}{\sin \phi_1 \cdot \sin \phi_1}\right)} \]
                          7. 1-sub-sinN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)\right) \cdot \cos \phi_1 + \color{blue}{\cos \phi_1 \cdot \cos \phi_1}} \]
                          8. distribute-rgt-outN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                          9. *-lowering-*.f64N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)}} \]
                          10. cos-lowering-cos.f64N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1} \cdot \left(\left(-1 \cdot delta\right) \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                          11. mul-1-negN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta\right)\right)} \cdot \left(\cos theta \cdot \sin \phi_1\right) + \cos \phi_1\right)} \]
                          12. distribute-lft-neg-outN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(delta \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)} + \cos \phi_1\right)} \]
                          13. distribute-rgt-neg-inN/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \left(\color{blue}{delta \cdot \left(\mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right)\right)} + \cos \phi_1\right)} \]
                          14. accelerator-lowering-fma.f64N/A

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos \phi_1 \cdot \color{blue}{\mathsf{fma}\left(delta, \mathsf{neg}\left(\cos theta \cdot \sin \phi_1\right), \cos \phi_1\right)}} \]
                        5. Simplified79.7%

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\cos \phi_1 \cdot \mathsf{fma}\left(delta, \cos theta \cdot \left(-\sin \phi_1\right), \cos \phi_1\right)}} \]
                        6. Taylor expanded in phi1 around 0

                          \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                        7. Step-by-step derivation
                          1. Simplified76.1%

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{1}} \]
                          2. Taylor expanded in phi1 around 0

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                          3. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                            2. sin-lowering-sin.f64N/A

                              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta} \cdot \sin theta}{1} \]
                            3. sin-lowering-sin.f6475.1

                              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\sin delta \cdot \color{blue}{\sin theta}}{1} \]
                          4. Simplified75.1%

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{\sin delta \cdot \sin theta}}{1} \]
                          5. Taylor expanded in delta around 0

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                          6. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                            2. sin-lowering-sin.f6472.9

                              \[\leadsto \lambda_1 + \tan^{-1}_* \frac{delta \cdot \color{blue}{\sin theta}}{1} \]
                          7. Simplified72.9%

                            \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\color{blue}{delta \cdot \sin theta}}{1} \]
                          8. Add Preprocessing

                          Alternative 17: 70.3% accurate, 1341.0× speedup?

                          \[\begin{array}{l} \\ \lambda_1 \end{array} \]
                          (FPCore (lambda1 phi1 phi2 delta theta) :precision binary64 lambda1)
                          double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                          	return lambda1;
                          }
                          
                          real(8) function code(lambda1, phi1, phi2, delta, theta)
                              real(8), intent (in) :: lambda1
                              real(8), intent (in) :: phi1
                              real(8), intent (in) :: phi2
                              real(8), intent (in) :: delta
                              real(8), intent (in) :: theta
                              code = lambda1
                          end function
                          
                          public static double code(double lambda1, double phi1, double phi2, double delta, double theta) {
                          	return lambda1;
                          }
                          
                          def code(lambda1, phi1, phi2, delta, theta):
                          	return lambda1
                          
                          function code(lambda1, phi1, phi2, delta, theta)
                          	return lambda1
                          end
                          
                          function tmp = code(lambda1, phi1, phi2, delta, theta)
                          	tmp = lambda1;
                          end
                          
                          code[lambda1_, phi1_, phi2_, delta_, theta_] := lambda1
                          
                          \begin{array}{l}
                          
                          \\
                          \lambda_1
                          \end{array}
                          
                          Derivation
                          1. Initial program 99.8%

                            \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in lambda1 around inf

                            \[\leadsto \color{blue}{\lambda_1} \]
                          4. Step-by-step derivation
                            1. Simplified69.3%

                              \[\leadsto \color{blue}{\lambda_1} \]
                            2. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024198 
                            (FPCore (lambda1 phi1 phi2 delta theta)
                              :name "Destination given bearing on a great circle"
                              :precision binary64
                              (+ lambda1 (atan2 (* (* (sin theta) (sin delta)) (cos phi1)) (- (cos delta) (* (sin phi1) (sin (asin (+ (* (sin phi1) (cos delta)) (* (* (cos phi1) (sin delta)) (cos theta))))))))))