Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.2s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\ \left|\mathsf{fma}\left(\cos t \cdot \cos t\_1, ew, \left(\sin t \cdot eh\right) \cdot \sin t\_1\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* eh (/ (tan t) ew)))))
   (fabs (fma (* (cos t) (cos t_1)) ew (* (* (sin t) eh) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh * (tan(t) / ew)));
	return fabs(fma((cos(t) * cos(t_1)), ew, ((sin(t) * eh) * sin(t_1))));
}
function code(eh, ew, t)
	t_1 = atan(Float64(eh * Float64(tan(t) / ew)))
	return abs(fma(Float64(cos(t) * cos(t_1)), ew, Float64(Float64(sin(t) * eh) * sin(t_1))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\left|\mathsf{fma}\left(\cos t \cdot \cos t\_1, ew, \left(\sin t \cdot eh\right) \cdot \sin t\_1\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Applied rewrites99.8%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
  4. Final simplification99.8%

    \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right| \]
  5. Add Preprocessing

Alternative 2: 99.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (fma
   (* (cos t) (cos (atan (* eh (/ (tan t) ew)))))
   ew
   (* (* (sin t) eh) (sin (atan (* (/ t ew) eh)))))))
double code(double eh, double ew, double t) {
	return fabs(fma((cos(t) * cos(atan((eh * (tan(t) / ew))))), ew, ((sin(t) * eh) * sin(atan(((t / ew) * eh))))));
}
function code(eh, ew, t)
	return abs(fma(Float64(cos(t) * cos(atan(Float64(eh * Float64(tan(t) / ew))))), ew, Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(t / ew) * eh))))))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Applied rewrites99.8%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
  4. Taylor expanded in t around 0

    \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
  5. Step-by-step derivation
    1. lower-/.f6499.6

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
  6. Applied rewrites99.6%

    \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
  7. Final simplification99.6%

    \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right| \]
  8. Add Preprocessing

Alternative 3: 92.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \left|\frac{t\_1 \cdot \left(eh \cdot \frac{\tan t}{ew}\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\ \mathbf{if}\;ew \leq -1.85 \cdot 10^{+22}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;ew \leq 1.8 \cdot 10^{-10}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, t\_1 \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh))
        (t_2
         (fabs
          (/
           (+ (* t_1 (* eh (/ (tan t) ew))) (* (cos t) ew))
           (/ 1.0 (pow (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)) -0.5))))))
   (if (<= ew -1.85e+22)
     t_2
     (if (<= ew 1.8e-10)
       (fabs
        (fma
         (* (cos (atan (/ (* eh t) ew))) (cos t))
         ew
         (* t_1 (sin (atan (* (/ t ew) eh))))))
       t_2))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double t_2 = fabs((((t_1 * (eh * (tan(t) / ew))) + (cos(t) * ew)) / (1.0 / pow((1.0 + pow((ew / (eh * tan(t))), -2.0)), -0.5))));
	double tmp;
	if (ew <= -1.85e+22) {
		tmp = t_2;
	} else if (ew <= 1.8e-10) {
		tmp = fabs(fma((cos(atan(((eh * t) / ew))) * cos(t)), ew, (t_1 * sin(atan(((t / ew) * eh))))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	t_2 = abs(Float64(Float64(Float64(t_1 * Float64(eh * Float64(tan(t) / ew))) + Float64(cos(t) * ew)) / Float64(1.0 / (Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0)) ^ -0.5))))
	tmp = 0.0
	if (ew <= -1.85e+22)
		tmp = t_2;
	elseif (ew <= 1.8e-10)
		tmp = abs(fma(Float64(cos(atan(Float64(Float64(eh * t) / ew))) * cos(t)), ew, Float64(t_1 * sin(atan(Float64(Float64(t / ew) * eh))))));
	else
		tmp = t_2;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(N[(t$95$1 * N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Power[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.85e+22], t$95$2, If[LessEqual[ew, 1.8e-10], N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew + N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \left|\frac{t\_1 \cdot \left(eh \cdot \frac{\tan t}{ew}\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\
\mathbf{if}\;ew \leq -1.85 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;ew \leq 1.8 \cdot 10^{-10}:\\
\;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, t\_1 \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.8499999999999999e22 or 1.8e-10 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites86.4%

      \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
    4. Applied rewrites95.8%

      \[\leadsto \left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\color{blue}{{\left({\left(\frac{ew}{\tan t \cdot eh}\right)}^{-2} + 1\right)}^{-0.5}}}}\right| \]

    if -1.8499999999999999e22 < ew < 1.8e-10

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
    4. Taylor expanded in t around 0

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    5. Step-by-step derivation
      1. lower-/.f6499.7

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    6. Applied rewrites99.7%

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
      3. lower-*.f6495.8

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
    9. Applied rewrites95.8%

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{t \cdot eh}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.85 \cdot 10^{+22}:\\ \;\;\;\;\left|\frac{\left(\sin t \cdot eh\right) \cdot \left(eh \cdot \frac{\tan t}{ew}\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\ \mathbf{elif}\;ew \leq 1.8 \cdot 10^{-10}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(\sin t \cdot eh\right) \cdot \left(eh \cdot \frac{\tan t}{ew}\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\ \mathbf{if}\;eh \leq -1.55 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 9.6 \cdot 10^{-20}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1
         (fabs
          (fma
           (* (cos (atan (/ (* eh t) ew))) (cos t))
           ew
           (* (* (sin t) eh) (sin (atan (* (/ t ew) eh))))))))
   (if (<= eh -1.55e+60)
     t_1
     (if (<= eh 9.6e-20)
       (/
        1.0
        (/
         (sqrt (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)))
         (fabs (+ (* (* (* eh (/ (tan t) ew)) eh) (sin t)) (* (cos t) ew)))))
       t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(fma((cos(atan(((eh * t) / ew))) * cos(t)), ew, ((sin(t) * eh) * sin(atan(((t / ew) * eh))))));
	double tmp;
	if (eh <= -1.55e+60) {
		tmp = t_1;
	} else if (eh <= 9.6e-20) {
		tmp = 1.0 / (sqrt((1.0 + pow((ew / (eh * tan(t))), -2.0))) / fabs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + (cos(t) * ew))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = abs(fma(Float64(cos(atan(Float64(Float64(eh * t) / ew))) * cos(t)), ew, Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(t / ew) * eh))))))
	tmp = 0.0
	if (eh <= -1.55e+60)
		tmp = t_1;
	elseif (eh <= 9.6e-20)
		tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0))) / abs(Float64(Float64(Float64(Float64(eh * Float64(tan(t) / ew)) * eh) * sin(t)) + Float64(cos(t) * ew)))));
	else
		tmp = t_1;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.55e+60], t$95$1, If[LessEqual[eh, 9.6e-20], N[(1.0 / N[(N[Sqrt[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[(N[(N[(N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\
\mathbf{if}\;eh \leq -1.55 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 9.6 \cdot 10^{-20}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.55e60 or 9.59999999999999971e-20 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
    4. Taylor expanded in t around 0

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    5. Step-by-step derivation
      1. lower-/.f6499.6

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    6. Applied rewrites99.6%

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
      3. lower-*.f6492.3

        \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]
    9. Applied rewrites92.3%

      \[\leadsto \left|\mathsf{fma}\left(\cos \tan^{-1} \color{blue}{\left(\frac{t \cdot eh}{ew}\right)} \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right)\right| \]

    if -1.55e60 < eh < 9.59999999999999971e-20

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
    4. Applied rewrites83.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}^{-1}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}}} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{1}{\frac{\color{blue}{{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}^{-1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      2. inv-powN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      3. lift-cos.f64N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\color{blue}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      4. lift-atan.f64N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\cos \color{blue}{\tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      5. cos-atanN/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\color{blue}{\frac{1}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      6. remove-double-divN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      8. +-commutativeN/A

        \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      9. lower-+.f64N/A

        \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
    6. Applied rewrites97.4%

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{{\left(\frac{ew}{\tan t \cdot eh}\right)}^{-2} + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.55 \cdot 10^{+60}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\ \mathbf{elif}\;eh \leq 9.6 \cdot 10^{-20}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \cos t \cdot ew\\ t_3 := \frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + t\_2\right|}}\\ t_4 := \left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{if}\;eh \leq -3.3 \cdot 10^{+93}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;eh \leq 1.95 \cdot 10^{+139}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;eh \leq 4 \cdot 10^{+192}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh))
        (t_2 (* (cos t) ew))
        (t_3
         (/
          1.0
          (/
           (sqrt (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)))
           (fabs (+ (* (* (* eh (/ (tan t) ew)) eh) (sin t)) t_2)))))
        (t_4
         (fabs
          (* (sin (atan (* (/ (sin t) t_2) (- eh)))) (* (- eh) (sin t))))))
   (if (<= eh -3.3e+93)
     (/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
     (if (<= eh 4.8e+70)
       t_3
       (if (<= eh 1.95e+139) t_4 (if (<= eh 4e+192) t_3 t_4))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double t_2 = cos(t) * ew;
	double t_3 = 1.0 / (sqrt((1.0 + pow((ew / (eh * tan(t))), -2.0))) / fabs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2)));
	double t_4 = fabs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))));
	double tmp;
	if (eh <= -3.3e+93) {
		tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
	} else if (eh <= 4.8e+70) {
		tmp = t_3;
	} else if (eh <= 1.95e+139) {
		tmp = t_4;
	} else if (eh <= 4e+192) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = sin(t) * eh
    t_2 = cos(t) * ew
    t_3 = 1.0d0 / (sqrt((1.0d0 + ((ew / (eh * tan(t))) ** (-2.0d0)))) / abs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2)))
    t_4 = abs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))))
    if (eh <= (-3.3d+93)) then
        tmp = 1.0d0 / abs((1.0d0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)))
    else if (eh <= 4.8d+70) then
        tmp = t_3
    else if (eh <= 1.95d+139) then
        tmp = t_4
    else if (eh <= 4d+192) then
        tmp = t_3
    else
        tmp = t_4
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * eh;
	double t_2 = Math.cos(t) * ew;
	double t_3 = 1.0 / (Math.sqrt((1.0 + Math.pow((ew / (eh * Math.tan(t))), -2.0))) / Math.abs(((((eh * (Math.tan(t) / ew)) * eh) * Math.sin(t)) + t_2)));
	double t_4 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / t_2) * -eh))) * (-eh * Math.sin(t))));
	double tmp;
	if (eh <= -3.3e+93) {
		tmp = 1.0 / Math.abs((1.0 / (Math.sin(Math.atan(((t_1 / ew) / Math.cos(t)))) * t_1)));
	} else if (eh <= 4.8e+70) {
		tmp = t_3;
	} else if (eh <= 1.95e+139) {
		tmp = t_4;
	} else if (eh <= 4e+192) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * eh
	t_2 = math.cos(t) * ew
	t_3 = 1.0 / (math.sqrt((1.0 + math.pow((ew / (eh * math.tan(t))), -2.0))) / math.fabs(((((eh * (math.tan(t) / ew)) * eh) * math.sin(t)) + t_2)))
	t_4 = math.fabs((math.sin(math.atan(((math.sin(t) / t_2) * -eh))) * (-eh * math.sin(t))))
	tmp = 0
	if eh <= -3.3e+93:
		tmp = 1.0 / math.fabs((1.0 / (math.sin(math.atan(((t_1 / ew) / math.cos(t)))) * t_1)))
	elif eh <= 4.8e+70:
		tmp = t_3
	elif eh <= 1.95e+139:
		tmp = t_4
	elif eh <= 4e+192:
		tmp = t_3
	else:
		tmp = t_4
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	t_2 = Float64(cos(t) * ew)
	t_3 = Float64(1.0 / Float64(sqrt(Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0))) / abs(Float64(Float64(Float64(Float64(eh * Float64(tan(t) / ew)) * eh) * sin(t)) + t_2))))
	t_4 = abs(Float64(sin(atan(Float64(Float64(sin(t) / t_2) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t))))
	tmp = 0.0
	if (eh <= -3.3e+93)
		tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1))));
	elseif (eh <= 4.8e+70)
		tmp = t_3;
	elseif (eh <= 1.95e+139)
		tmp = t_4;
	elseif (eh <= 4e+192)
		tmp = t_3;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * eh;
	t_2 = cos(t) * ew;
	t_3 = 1.0 / (sqrt((1.0 + ((ew / (eh * tan(t))) ^ -2.0))) / abs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2)));
	t_4 = abs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))));
	tmp = 0.0;
	if (eh <= -3.3e+93)
		tmp = 1.0 / abs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
	elseif (eh <= 4.8e+70)
		tmp = t_3;
	elseif (eh <= 1.95e+139)
		tmp = t_4;
	elseif (eh <= 4e+192)
		tmp = t_3;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[(N[(N[(N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / t$95$2), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -3.3e+93], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 4.8e+70], t$95$3, If[LessEqual[eh, 1.95e+139], t$95$4, If[LessEqual[eh, 4e+192], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \cos t \cdot ew\\
t_3 := \frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + t\_2\right|}}\\
t_4 := \left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
\mathbf{if}\;eh \leq -3.3 \cdot 10^{+93}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\

\mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;eh \leq 1.95 \cdot 10^{+139}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;eh \leq 4 \cdot 10^{+192}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -3.30000000000000009e93

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{\mathsf{fma}\left(\sin t \cdot \left(-eh\right), -\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\cos t \cdot ew\right)\right)}\right|}} \]
    4. Taylor expanded in ew around 0

      \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}}\right|} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
      3. *-commutativeN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
      5. lower-sin.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
      6. lower-sin.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
      7. lower-atan.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
      8. associate-/r*N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\frac{eh \cdot \sin t}{ew}}}{\cos t}\right)}\right|} \]
      11. *-commutativeN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
      13. lower-sin.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t} \cdot eh}{ew}}{\cos t}\right)}\right|} \]
      14. lower-cos.f6474.4

        \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\color{blue}{\cos t}}\right)}\right|} \]
    6. Applied rewrites74.4%

      \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right)}}\right|} \]

    if -3.30000000000000009e93 < eh < 4.79999999999999974e70 or 1.95000000000000003e139 < eh < 4.00000000000000016e192

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied rewrites99.8%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t, ew, \left(\sin t \cdot \left(-eh\right)\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right)}\right| \]
    4. Applied rewrites79.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}^{-1}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}}} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{1}{\frac{\color{blue}{{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}^{-1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      2. inv-powN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      3. lift-cos.f64N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\color{blue}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      4. lift-atan.f64N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\cos \color{blue}{\tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      5. cos-atanN/A

        \[\leadsto \frac{1}{\frac{\frac{1}{\color{blue}{\frac{1}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      6. remove-double-divN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      8. +-commutativeN/A

        \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
      9. lower-+.f64N/A

        \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]
    6. Applied rewrites95.5%

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{{\left(\frac{ew}{\tan t \cdot eh}\right)}^{-2} + 1}}}{\left|\cos t \cdot ew - \left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \left(-\sin t\right)\right|}} \]

    if 4.79999999999999974e70 < eh < 1.95000000000000003e139 or 4.00000000000000016e192 < eh

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
      2. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
    5. Applied rewrites14.4%

      \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot ew}\right| \]
    6. Taylor expanded in t around 0

      \[\leadsto \left|\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot ew\right| \]
    7. Step-by-step derivation
      1. Applied rewrites13.5%

        \[\leadsto \left|\cos \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right) \cdot ew\right| \]
      2. Taylor expanded in ew around 0

        \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
        2. associate-*r*N/A

          \[\leadsto \left|\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right)\right| \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        4. mul-1-negN/A

          \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        5. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        6. mul-1-negN/A

          \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        7. lower-neg.f64N/A

          \[\leadsto \left|\color{blue}{\left(-eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        8. *-commutativeN/A

          \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        9. lower-*.f64N/A

          \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        10. lower-sin.f64N/A

          \[\leadsto \left|\left(-\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
        11. lower-sin.f64N/A

          \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        12. lower-atan.f64N/A

          \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        13. mul-1-negN/A

          \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
        14. associate-/l*N/A

          \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{eh \cdot \frac{\sin t}{ew \cdot \cos t}}\right)\right)\right| \]
        15. distribute-lft-neg-inN/A

          \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\sin t}{ew \cdot \cos t}\right)}\right| \]
      4. Applied rewrites86.7%

        \[\leadsto \left|\color{blue}{\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\sin t}{\cos t \cdot ew}\right)}\right| \]
    8. Recombined 3 regimes into one program.
    9. Final simplification90.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -3.3 \cdot 10^{+93}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right) \cdot \left(\sin t \cdot eh\right)}\right|}\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\ \mathbf{elif}\;eh \leq 1.95 \cdot 10^{+139}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{elif}\;eh \leq 4 \cdot 10^{+192}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \]
    10. Add Preprocessing

    Alternative 6: 82.2% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \cos t \cdot ew\\ \mathbf{if}\;eh \leq -8 \cdot 10^{+86}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\left(eh \cdot \tan t\right) \cdot eh, \frac{\sin t}{ew}, t\_2\right)\right|}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) eh)) (t_2 (* (cos t) ew)))
       (if (<= eh -8e+86)
         (/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
         (if (<= eh 4.8e+70)
           (/
            (fabs (fma (* (* eh (tan t)) eh) (/ (sin t) ew) t_2))
            (sqrt (+ 1.0 (pow (* eh (/ (tan t) ew)) 2.0))))
           (fabs
            (* (sin (atan (* (/ (sin t) t_2) (- eh)))) (* (- eh) (sin t))))))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * eh;
    	double t_2 = cos(t) * ew;
    	double tmp;
    	if (eh <= -8e+86) {
    		tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
    	} else if (eh <= 4.8e+70) {
    		tmp = fabs(fma(((eh * tan(t)) * eh), (sin(t) / ew), t_2)) / sqrt((1.0 + pow((eh * (tan(t) / ew)), 2.0)));
    	} else {
    		tmp = fabs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * eh)
    	t_2 = Float64(cos(t) * ew)
    	tmp = 0.0
    	if (eh <= -8e+86)
    		tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1))));
    	elseif (eh <= 4.8e+70)
    		tmp = Float64(abs(fma(Float64(Float64(eh * tan(t)) * eh), Float64(sin(t) / ew), t_2)) / sqrt(Float64(1.0 + (Float64(eh * Float64(tan(t) / ew)) ^ 2.0))));
    	else
    		tmp = abs(Float64(sin(atan(Float64(Float64(sin(t) / t_2) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t))));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[eh, -8e+86], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 4.8e+70], N[(N[Abs[N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / t$95$2), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot eh\\
    t_2 := \cos t \cdot ew\\
    \mathbf{if}\;eh \leq -8 \cdot 10^{+86}:\\
    \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\
    
    \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\
    \;\;\;\;\frac{\left|\mathsf{fma}\left(\left(eh \cdot \tan t\right) \cdot eh, \frac{\sin t}{ew}, t\_2\right)\right|}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -8.0000000000000001e86

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Applied rewrites99.8%

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{\mathsf{fma}\left(\sin t \cdot \left(-eh\right), -\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\cos t \cdot ew\right)\right)}\right|}} \]
      4. Taylor expanded in ew around 0

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}}\right|} \]
      5. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
        3. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
        5. lower-sin.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
        6. lower-sin.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
        7. lower-atan.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
        8. associate-/r*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\frac{eh \cdot \sin t}{ew}}}{\cos t}\right)}\right|} \]
        11. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
        12. lower-*.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
        13. lower-sin.f64N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t} \cdot eh}{ew}}{\cos t}\right)}\right|} \]
        14. lower-cos.f6475.6

          \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\color{blue}{\cos t}}\right)}\right|} \]
      6. Applied rewrites75.6%

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right)}}\right|} \]

      if -8.0000000000000001e86 < eh < 4.79999999999999974e70

      1. Initial program 99.7%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Applied rewrites99.6%

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{\mathsf{fma}\left(\sin t \cdot \left(-eh\right), -\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\cos t \cdot ew\right)\right)}\right|}} \]
      4. Applied rewrites80.6%

        \[\leadsto \frac{1}{\color{blue}{{\left({\left(\left|\mathsf{fma}\left(\frac{eh \cdot \sin t}{ew}, \tan t \cdot eh, \cos t \cdot ew\right)\right| \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}^{-0.5}\right)}^{2}}} \]
      5. Applied rewrites92.0%

        \[\leadsto \color{blue}{\frac{\left|\mathsf{fma}\left(\left(\tan t \cdot eh\right) \cdot eh, \frac{\sin t}{ew}, \cos t \cdot ew\right)\right|}{\sqrt{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} + 1}}} \]

      if 4.79999999999999974e70 < eh

      1. Initial program 99.9%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
      5. Applied rewrites21.0%

        \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot ew}\right| \]
      6. Taylor expanded in t around 0

        \[\leadsto \left|\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot ew\right| \]
      7. Step-by-step derivation
        1. Applied rewrites19.9%

          \[\leadsto \left|\cos \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right) \cdot ew\right| \]
        2. Taylor expanded in ew around 0

          \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
        3. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
          2. associate-*r*N/A

            \[\leadsto \left|\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right)\right| \]
          3. distribute-lft-neg-inN/A

            \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          4. mul-1-negN/A

            \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          5. lower-*.f64N/A

            \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          6. mul-1-negN/A

            \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          7. lower-neg.f64N/A

            \[\leadsto \left|\color{blue}{\left(-eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          8. *-commutativeN/A

            \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          9. lower-*.f64N/A

            \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          10. lower-sin.f64N/A

            \[\leadsto \left|\left(-\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
          11. lower-sin.f64N/A

            \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          12. lower-atan.f64N/A

            \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          13. mul-1-negN/A

            \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
          14. associate-/l*N/A

            \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{eh \cdot \frac{\sin t}{ew \cdot \cos t}}\right)\right)\right| \]
          15. distribute-lft-neg-inN/A

            \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\sin t}{ew \cdot \cos t}\right)}\right| \]
        4. Applied rewrites77.5%

          \[\leadsto \left|\color{blue}{\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\sin t}{\cos t \cdot ew}\right)}\right| \]
      8. Recombined 3 regimes into one program.
      9. Final simplification86.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -8 \cdot 10^{+86}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right) \cdot \left(\sin t \cdot eh\right)}\right|}\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\left(eh \cdot \tan t\right) \cdot eh, \frac{\sin t}{ew}, \cos t \cdot ew\right)\right|}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \]
      10. Add Preprocessing

      Alternative 7: 74.9% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\ \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (sin t) eh)))
         (if (<= eh -6e+85)
           (/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
           (if (<= eh 3.7e+63)
             (fabs
              (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))
             (fabs
              (*
               (sin (atan (* (/ (sin t) (* (cos t) ew)) (- eh))))
               (* (- eh) (sin t))))))))
      double code(double eh, double ew, double t) {
      	double t_1 = sin(t) * eh;
      	double tmp;
      	if (eh <= -6e+85) {
      		tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
      	} else if (eh <= 3.7e+63) {
      		tmp = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
      	} else {
      		tmp = fabs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))));
      	}
      	return tmp;
      }
      
      real(8) function code(eh, ew, t)
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = sin(t) * eh
          if (eh <= (-6d+85)) then
              tmp = 1.0d0 / abs((1.0d0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)))
          else if (eh <= 3.7d+63) then
              tmp = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
          else
              tmp = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.sin(t) * eh;
      	double tmp;
      	if (eh <= -6e+85) {
      		tmp = 1.0 / Math.abs((1.0 / (Math.sin(Math.atan(((t_1 / ew) / Math.cos(t)))) * t_1)));
      	} else if (eh <= 3.7e+63) {
      		tmp = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
      	} else {
      		tmp = Math.abs((Math.sin(Math.atan(((Math.sin(t) / (Math.cos(t) * ew)) * -eh))) * (-eh * Math.sin(t))));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.sin(t) * eh
      	tmp = 0
      	if eh <= -6e+85:
      		tmp = 1.0 / math.fabs((1.0 / (math.sin(math.atan(((t_1 / ew) / math.cos(t)))) * t_1)))
      	elif eh <= 3.7e+63:
      		tmp = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew)))))))
      	else:
      		tmp = math.fabs((math.sin(math.atan(((math.sin(t) / (math.cos(t) * ew)) * -eh))) * (-eh * math.sin(t))))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(sin(t) * eh)
      	tmp = 0.0
      	if (eh <= -6e+85)
      		tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1))));
      	elseif (eh <= 3.7e+63)
      		tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew)))))));
      	else
      		tmp = abs(Float64(sin(atan(Float64(Float64(sin(t) / Float64(cos(t) * ew)) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = sin(t) * eh;
      	tmp = 0.0;
      	if (eh <= -6e+85)
      		tmp = 1.0 / abs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
      	elseif (eh <= 3.7e+63)
      		tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
      	else
      		tmp = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -6e+85], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 3.7e+63], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin t \cdot eh\\
      \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\
      \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\
      
      \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\
      \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if eh < -6.0000000000000001e85

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Applied rewrites99.8%

          \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{\mathsf{fma}\left(\sin t \cdot \left(-eh\right), -\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right), \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\cos t \cdot ew\right)\right)}\right|}} \]
        4. Taylor expanded in ew around 0

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}}\right|} \]
        5. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
          3. *-commutativeN/A

            \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
          5. lower-sin.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right|} \]
          6. lower-sin.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
          7. lower-atan.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}}\right|} \]
          8. associate-/r*N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \sin t}{ew}}{\cos t}\right)}}\right|} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\frac{eh \cdot \sin t}{ew}}}{\cos t}\right)}\right|} \]
          11. *-commutativeN/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
          12. lower-*.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t \cdot eh}}{ew}}{\cos t}\right)}\right|} \]
          13. lower-sin.f64N/A

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\color{blue}{\sin t} \cdot eh}{ew}}{\cos t}\right)}\right|} \]
          14. lower-cos.f6475.6

            \[\leadsto \frac{1}{\left|\frac{1}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\color{blue}{\cos t}}\right)}\right|} \]
        6. Applied rewrites75.6%

          \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right)}}\right|} \]

        if -6.0000000000000001e85 < eh < 3.69999999999999968e63

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Applied rewrites81.5%

          \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
        4. Taylor expanded in ew around inf

          \[\leadsto \left|\frac{\color{blue}{-1 \cdot \left(ew \cdot \cos t\right)}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
        5. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left|\frac{\color{blue}{\left(-1 \cdot ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          2. mul-1-negN/A

            \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          3. lower-*.f64N/A

            \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          4. lower-neg.f64N/A

            \[\leadsto \left|\frac{\color{blue}{\left(-ew\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          5. lower-cos.f6479.7

            \[\leadsto \left|\frac{\left(-ew\right) \cdot \color{blue}{\cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
        6. Applied rewrites79.7%

          \[\leadsto \left|\frac{\color{blue}{\left(-ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]

        if 3.69999999999999968e63 < eh

        1. Initial program 99.9%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

          \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
          2. lower-*.f64N/A

            \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
        5. Applied rewrites22.2%

          \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot ew}\right| \]
        6. Taylor expanded in t around 0

          \[\leadsto \left|\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot ew\right| \]
        7. Step-by-step derivation
          1. Applied rewrites21.1%

            \[\leadsto \left|\cos \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right) \cdot ew\right| \]
          2. Taylor expanded in ew around 0

            \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
          3. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
            2. associate-*r*N/A

              \[\leadsto \left|\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right)\right| \]
            3. distribute-lft-neg-inN/A

              \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
            4. mul-1-negN/A

              \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            5. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
            6. mul-1-negN/A

              \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            7. lower-neg.f64N/A

              \[\leadsto \left|\color{blue}{\left(-eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            9. lower-*.f64N/A

              \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            10. lower-sin.f64N/A

              \[\leadsto \left|\left(-\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
            11. lower-sin.f64N/A

              \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
            12. lower-atan.f64N/A

              \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
            13. mul-1-negN/A

              \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
            14. associate-/l*N/A

              \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{eh \cdot \frac{\sin t}{ew \cdot \cos t}}\right)\right)\right| \]
            15. distribute-lft-neg-inN/A

              \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\sin t}{ew \cdot \cos t}\right)}\right| \]
          4. Applied rewrites76.6%

            \[\leadsto \left|\color{blue}{\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\sin t}{\cos t \cdot ew}\right)}\right| \]
        8. Recombined 3 regimes into one program.
        9. Final simplification78.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right) \cdot \left(\sin t \cdot eh\right)}\right|}\\ \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \]
        10. Add Preprocessing

        Alternative 8: 74.9% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1
                 (fabs
                  (*
                   (sin (atan (* (/ (sin t) (* (cos t) ew)) (- eh))))
                   (* (- eh) (sin t))))))
           (if (<= eh -6e+85)
             t_1
             (if (<= eh 3.7e+63)
               (fabs
                (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))
               t_1))))
        double code(double eh, double ew, double t) {
        	double t_1 = fabs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))));
        	double tmp;
        	if (eh <= -6e+85) {
        		tmp = t_1;
        	} else if (eh <= 3.7e+63) {
        		tmp = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(eh, ew, t)
            real(8), intent (in) :: eh
            real(8), intent (in) :: ew
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: tmp
            t_1 = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))))
            if (eh <= (-6d+85)) then
                tmp = t_1
            else if (eh <= 3.7d+63) then
                tmp = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double eh, double ew, double t) {
        	double t_1 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / (Math.cos(t) * ew)) * -eh))) * (-eh * Math.sin(t))));
        	double tmp;
        	if (eh <= -6e+85) {
        		tmp = t_1;
        	} else if (eh <= 3.7e+63) {
        		tmp = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	t_1 = math.fabs((math.sin(math.atan(((math.sin(t) / (math.cos(t) * ew)) * -eh))) * (-eh * math.sin(t))))
        	tmp = 0
        	if eh <= -6e+85:
        		tmp = t_1
        	elif eh <= 3.7e+63:
        		tmp = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew)))))))
        	else:
        		tmp = t_1
        	return tmp
        
        function code(eh, ew, t)
        	t_1 = abs(Float64(sin(atan(Float64(Float64(sin(t) / Float64(cos(t) * ew)) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t))))
        	tmp = 0.0
        	if (eh <= -6e+85)
        		tmp = t_1;
        	elseif (eh <= 3.7e+63)
        		tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew)))))));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	t_1 = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))));
        	tmp = 0.0;
        	if (eh <= -6e+85)
        		tmp = t_1;
        	elseif (eh <= 3.7e+63)
        		tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -6e+85], t$95$1, If[LessEqual[eh, 3.7e+63], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
        \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\
        \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if eh < -6.0000000000000001e85 or 3.69999999999999968e63 < eh

          1. Initial program 99.9%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
            2. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
          5. Applied rewrites20.7%

            \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot ew}\right| \]
          6. Taylor expanded in t around 0

            \[\leadsto \left|\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot ew\right| \]
          7. Step-by-step derivation
            1. Applied rewrites19.6%

              \[\leadsto \left|\cos \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right) \cdot ew\right| \]
            2. Taylor expanded in ew around 0

              \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
            3. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right)}\right| \]
              2. associate-*r*N/A

                \[\leadsto \left|\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right)\right| \]
              3. distribute-lft-neg-inN/A

                \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
              4. mul-1-negN/A

                \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              5. lower-*.f64N/A

                \[\leadsto \left|\color{blue}{\left(-1 \cdot \left(eh \cdot \sin t\right)\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
              6. mul-1-negN/A

                \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(eh \cdot \sin t\right)\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              7. lower-neg.f64N/A

                \[\leadsto \left|\color{blue}{\left(-eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              8. *-commutativeN/A

                \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              9. lower-*.f64N/A

                \[\leadsto \left|\left(-\color{blue}{\sin t \cdot eh}\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              10. lower-sin.f64N/A

                \[\leadsto \left|\left(-\color{blue}{\sin t} \cdot eh\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right| \]
              11. lower-sin.f64N/A

                \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \color{blue}{\sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
              12. lower-atan.f64N/A

                \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
              13. mul-1-negN/A

                \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
              14. associate-/l*N/A

                \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{eh \cdot \frac{\sin t}{ew \cdot \cos t}}\right)\right)\right| \]
              15. distribute-lft-neg-inN/A

                \[\leadsto \left|\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\left(\mathsf{neg}\left(eh\right)\right) \cdot \frac{\sin t}{ew \cdot \cos t}\right)}\right| \]
            4. Applied rewrites76.1%

              \[\leadsto \left|\color{blue}{\left(-\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\sin t}{\cos t \cdot ew}\right)}\right| \]

            if -6.0000000000000001e85 < eh < 3.69999999999999968e63

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Applied rewrites81.5%

              \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
            4. Taylor expanded in ew around inf

              \[\leadsto \left|\frac{\color{blue}{-1 \cdot \left(ew \cdot \cos t\right)}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            5. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \left|\frac{\color{blue}{\left(-1 \cdot ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              2. mul-1-negN/A

                \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              3. lower-*.f64N/A

                \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              4. lower-neg.f64N/A

                \[\leadsto \left|\frac{\color{blue}{\left(-ew\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              5. lower-cos.f6479.7

                \[\leadsto \left|\frac{\left(-ew\right) \cdot \color{blue}{\cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            6. Applied rewrites79.7%

              \[\leadsto \left|\frac{\color{blue}{\left(-ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          8. Recombined 2 regimes into one program.
          9. Final simplification78.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\ \end{array} \]
          10. Add Preprocessing

          Alternative 9: 65.7% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{-17}:\\ \;\;\;\;\left|\frac{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew} - \cos t \cdot ew}{\frac{-1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1
                   (fabs
                    (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))))
             (if (<= t -3.5e+19)
               t_1
               (if (<= t 4.7e-17)
                 (fabs
                  (/
                   (- (/ (* (* eh t) (* eh t)) (- ew)) (* (cos t) ew))
                   (/ -1.0 (pow (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)) -0.5))))
                 t_1))))
          double code(double eh, double ew, double t) {
          	double t_1 = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
          	double tmp;
          	if (t <= -3.5e+19) {
          		tmp = t_1;
          	} else if (t <= 4.7e-17) {
          		tmp = fabs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / (-1.0 / pow((1.0 + pow((ew / (eh * tan(t))), -2.0)), -0.5))));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(eh, ew, t)
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
              if (t <= (-3.5d+19)) then
                  tmp = t_1
              else if (t <= 4.7d-17) then
                  tmp = abs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / ((-1.0d0) / ((1.0d0 + ((ew / (eh * tan(t))) ** (-2.0d0))) ** (-0.5d0)))))
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double t_1 = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
          	double tmp;
          	if (t <= -3.5e+19) {
          		tmp = t_1;
          	} else if (t <= 4.7e-17) {
          		tmp = Math.abs((((((eh * t) * (eh * t)) / -ew) - (Math.cos(t) * ew)) / (-1.0 / Math.pow((1.0 + Math.pow((ew / (eh * Math.tan(t))), -2.0)), -0.5))));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	t_1 = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew)))))))
          	tmp = 0
          	if t <= -3.5e+19:
          		tmp = t_1
          	elif t <= 4.7e-17:
          		tmp = math.fabs((((((eh * t) * (eh * t)) / -ew) - (math.cos(t) * ew)) / (-1.0 / math.pow((1.0 + math.pow((ew / (eh * math.tan(t))), -2.0)), -0.5))))
          	else:
          		tmp = t_1
          	return tmp
          
          function code(eh, ew, t)
          	t_1 = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew)))))))
          	tmp = 0.0
          	if (t <= -3.5e+19)
          		tmp = t_1;
          	elseif (t <= 4.7e-17)
          		tmp = abs(Float64(Float64(Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(-ew)) - Float64(cos(t) * ew)) / Float64(-1.0 / (Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0)) ^ -0.5))));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	t_1 = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
          	tmp = 0.0;
          	if (t <= -3.5e+19)
          		tmp = t_1;
          	elseif (t <= 4.7e-17)
          		tmp = abs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / (-1.0 / ((1.0 + ((ew / (eh * tan(t))) ^ -2.0)) ^ -0.5))));
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.5e+19], t$95$1, If[LessEqual[t, 4.7e-17], N[Abs[N[(N[(N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision] - N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Power[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
          \mathbf{if}\;t \leq -3.5 \cdot 10^{+19}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \leq 4.7 \cdot 10^{-17}:\\
          \;\;\;\;\left|\frac{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew} - \cos t \cdot ew}{\frac{-1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -3.5e19 or 4.7e-17 < t

            1. Initial program 99.6%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Applied rewrites49.1%

              \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
            4. Taylor expanded in ew around inf

              \[\leadsto \left|\frac{\color{blue}{-1 \cdot \left(ew \cdot \cos t\right)}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            5. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \left|\frac{\color{blue}{\left(-1 \cdot ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              2. mul-1-negN/A

                \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              3. lower-*.f64N/A

                \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              4. lower-neg.f64N/A

                \[\leadsto \left|\frac{\color{blue}{\left(-ew\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              5. lower-cos.f6447.5

                \[\leadsto \left|\frac{\left(-ew\right) \cdot \color{blue}{\cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            6. Applied rewrites47.5%

              \[\leadsto \left|\frac{\color{blue}{\left(-ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]

            if -3.5e19 < t < 4.7e-17

            1. Initial program 100.0%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Applied rewrites75.5%

              \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
            4. Taylor expanded in t around 0

              \[\leadsto \left|\frac{\color{blue}{-1 \cdot \frac{{eh}^{2} \cdot {t}^{2}}{ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            5. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(\frac{{eh}^{2} \cdot {t}^{2}}{ew}\right)\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              2. distribute-neg-frac2N/A

                \[\leadsto \left|\frac{\color{blue}{\frac{{eh}^{2} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              3. lower-/.f64N/A

                \[\leadsto \left|\frac{\color{blue}{\frac{{eh}^{2} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              4. unpow2N/A

                \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot eh\right)} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              5. unpow2N/A

                \[\leadsto \left|\frac{\frac{\left(eh \cdot eh\right) \cdot \color{blue}{\left(t \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              6. unswap-sqrN/A

                \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              7. lower-*.f64N/A

                \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              8. *-commutativeN/A

                \[\leadsto \left|\frac{\frac{\color{blue}{\left(t \cdot eh\right)} \cdot \left(eh \cdot t\right)}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              9. lower-*.f64N/A

                \[\leadsto \left|\frac{\frac{\color{blue}{\left(t \cdot eh\right)} \cdot \left(eh \cdot t\right)}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              10. *-commutativeN/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \color{blue}{\left(t \cdot eh\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              11. lower-*.f64N/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \color{blue}{\left(t \cdot eh\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
              12. lower-neg.f6473.8

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{\color{blue}{-ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            6. Applied rewrites73.8%

              \[\leadsto \left|\frac{\color{blue}{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            7. Step-by-step derivation
              1. lift-cos.f64N/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}\right| \]
              2. lift-atan.f64N/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \color{blue}{\tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}}\right| \]
              3. cos-atanN/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{\frac{1}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}}}}\right| \]
              4. inv-powN/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{{\left(\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}\right)}^{-1}}}}\right| \]
              5. sqrt-pow2N/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{{\left(1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)}^{\left(\frac{-1}{2}\right)}}}}\right| \]
              6. lower-pow.f64N/A

                \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{{\left(1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)}^{\left(\frac{-1}{2}\right)}}}}\right| \]
            8. Applied rewrites82.8%

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\color{blue}{{\left({\left(\frac{ew}{\tan t \cdot eh}\right)}^{-2} + 1\right)}^{-0.5}}}}\right| \]
          3. Recombined 2 regimes into one program.
          4. Final simplification65.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{+19}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{-17}:\\ \;\;\;\;\left|\frac{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew} - \cos t \cdot ew}{\frac{-1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\ \end{array} \]
          5. Add Preprocessing

          Alternative 10: 61.0% accurate, 1.9× speedup?

          \[\begin{array}{l} \\ \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right| \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (fabs (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew))))))))
          double code(double eh, double ew, double t) {
          	return fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
          }
          
          real(8) function code(eh, ew, t)
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              code = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
          end function
          
          public static double code(double eh, double ew, double t) {
          	return Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
          }
          
          def code(eh, ew, t):
          	return math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew)))))))
          
          function code(eh, ew, t)
          	return abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew)))))))
          end
          
          function tmp = code(eh, ew, t)
          	tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
          end
          
          code[eh_, ew_, t_] := N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|
          \end{array}
          
          Derivation
          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Applied rewrites62.3%

            \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
          4. Taylor expanded in ew around inf

            \[\leadsto \left|\frac{\color{blue}{-1 \cdot \left(ew \cdot \cos t\right)}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          5. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \left|\frac{\color{blue}{\left(-1 \cdot ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            2. mul-1-negN/A

              \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            3. lower-*.f64N/A

              \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            4. lower-neg.f64N/A

              \[\leadsto \left|\frac{\color{blue}{\left(-ew\right)} \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            5. lower-cos.f6460.1

              \[\leadsto \left|\frac{\left(-ew\right) \cdot \color{blue}{\cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          6. Applied rewrites60.1%

            \[\leadsto \left|\frac{\color{blue}{\left(-ew\right) \cdot \cos t}}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          7. Final simplification60.1%

            \[\leadsto \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right| \]
          8. Add Preprocessing

          Alternative 11: 50.2% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \left|\frac{\cos t \cdot ew - \frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew}}{\frac{1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right| \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (fabs
            (/
             (- (* (cos t) ew) (/ (* (* eh t) (* eh t)) (- ew)))
             (/ 1.0 (cos (atan (* (/ eh ew) t)))))))
          double code(double eh, double ew, double t) {
          	return fabs((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / cos(atan(((eh / ew) * t))))));
          }
          
          real(8) function code(eh, ew, t)
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              code = abs((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0d0 / cos(atan(((eh / ew) * t))))))
          end function
          
          public static double code(double eh, double ew, double t) {
          	return Math.abs((((Math.cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / Math.cos(Math.atan(((eh / ew) * t))))));
          }
          
          def code(eh, ew, t):
          	return math.fabs((((math.cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / math.cos(math.atan(((eh / ew) * t))))))
          
          function code(eh, ew, t)
          	return abs(Float64(Float64(Float64(cos(t) * ew) - Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(-ew))) / Float64(1.0 / cos(atan(Float64(Float64(eh / ew) * t))))))
          end
          
          function tmp = code(eh, ew, t)
          	tmp = abs((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / cos(atan(((eh / ew) * t))))));
          end
          
          code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] - N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|\frac{\cos t \cdot ew - \frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew}}{\frac{1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right|
          \end{array}
          
          Derivation
          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Applied rewrites62.3%

            \[\leadsto \color{blue}{\left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|} \]
          4. Taylor expanded in t around 0

            \[\leadsto \left|\frac{\color{blue}{-1 \cdot \frac{{eh}^{2} \cdot {t}^{2}}{ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          5. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(\frac{{eh}^{2} \cdot {t}^{2}}{ew}\right)\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            2. distribute-neg-frac2N/A

              \[\leadsto \left|\frac{\color{blue}{\frac{{eh}^{2} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            3. lower-/.f64N/A

              \[\leadsto \left|\frac{\color{blue}{\frac{{eh}^{2} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            4. unpow2N/A

              \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot eh\right)} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            5. unpow2N/A

              \[\leadsto \left|\frac{\frac{\left(eh \cdot eh\right) \cdot \color{blue}{\left(t \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            6. unswap-sqrN/A

              \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            7. lower-*.f64N/A

              \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\frac{\frac{\color{blue}{\left(t \cdot eh\right)} \cdot \left(eh \cdot t\right)}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            9. lower-*.f64N/A

              \[\leadsto \left|\frac{\frac{\color{blue}{\left(t \cdot eh\right)} \cdot \left(eh \cdot t\right)}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            10. *-commutativeN/A

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \color{blue}{\left(t \cdot eh\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            11. lower-*.f64N/A

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \color{blue}{\left(t \cdot eh\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
            12. lower-neg.f6448.8

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{\color{blue}{-ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          6. Applied rewrites48.8%

            \[\leadsto \left|\frac{\color{blue}{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
          7. Taylor expanded in t around 0

            \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}}}\right| \]
          8. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)}}\right| \]
            2. associate-*r/N/A

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \color{blue}{\left(t \cdot \frac{eh}{ew}\right)}}}\right| \]
            3. lower-*.f64N/A

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \color{blue}{\left(t \cdot \frac{eh}{ew}\right)}}}\right| \]
            4. lower-/.f6448.8

              \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(t \cdot \color{blue}{\frac{eh}{ew}}\right)}}\right| \]
          9. Applied rewrites48.8%

            \[\leadsto \left|\frac{\frac{\left(t \cdot eh\right) \cdot \left(t \cdot eh\right)}{-ew} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \color{blue}{\left(t \cdot \frac{eh}{ew}\right)}}}\right| \]
          10. Final simplification48.8%

            \[\leadsto \left|\frac{\cos t \cdot ew - \frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew}}{\frac{1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right| \]
          11. Add Preprocessing

          Alternative 12: 42.2% accurate, 61.6× speedup?

          \[\begin{array}{l} \\ \left|\frac{ew}{1}\right| \end{array} \]
          (FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
          double code(double eh, double ew, double t) {
          	return fabs((ew / 1.0));
          }
          
          real(8) function code(eh, ew, t)
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              code = abs((ew / 1.0d0))
          end function
          
          public static double code(double eh, double ew, double t) {
          	return Math.abs((ew / 1.0));
          }
          
          def code(eh, ew, t):
          	return math.fabs((ew / 1.0))
          
          function code(eh, ew, t)
          	return abs(Float64(ew / 1.0))
          end
          
          function tmp = code(eh, ew, t)
          	tmp = abs((ew / 1.0));
          end
          
          code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|\frac{ew}{1}\right|
          \end{array}
          
          Derivation
          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
            2. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right) \cdot ew}\right| \]
          5. Applied rewrites41.6%

            \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot ew}\right| \]
          6. Taylor expanded in t around 0

            \[\leadsto \left|\cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot ew\right| \]
          7. Step-by-step derivation
            1. Applied rewrites40.2%

              \[\leadsto \left|\cos \tan^{-1} \left(t \cdot \frac{-eh}{ew}\right) \cdot ew\right| \]
            2. Step-by-step derivation
              1. Applied rewrites39.3%

                \[\leadsto \left|\frac{ew}{\color{blue}{\sqrt{{\left(\frac{-eh}{ew} \cdot t\right)}^{2} + 1}}}\right| \]
              2. Taylor expanded in ew around inf

                \[\leadsto \left|\frac{ew}{1}\right| \]
              3. Step-by-step derivation
                1. Applied rewrites41.7%

                  \[\leadsto \left|\frac{ew}{1}\right| \]
                2. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2024259 
                (FPCore (eh ew t)
                  :name "Example 2 from Robby"
                  :precision binary64
                  (fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))