Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 23.2s
Alternatives: 18
Speedup: N/A×

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 18 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.1× speedup?

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

\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\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. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. associate-*l*99.8%

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
    3. distribute-rgt-neg-in99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cos-atan99.8%

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

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    3. hypot-1-def99.8%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    4. associate-*r/99.8%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    5. *-commutative99.8%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    6. associate-/l*99.8%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    7. add-sqr-sqrt51.0%

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    9. sqr-neg93.6%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    10. sqrt-unprod48.8%

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    11. add-sqr-sqrt99.8%

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

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

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

Alternative 2: 87.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\ \mathbf{if}\;ew \leq -1.1 \cdot 10^{+23}:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\ \mathbf{elif}\;ew \leq 2.25 \cdot 10^{+30}:\\ \;\;\;\;\left|\frac{ew}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin t\_1\right)\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* eh (/ (tan t) (- ew))))))
   (if (<= ew -1.1e+23)
     (fabs (* (* ew (cos t)) (cos t_1)))
     (if (<= ew 2.25e+30)
       (fabs
        (-
         (/ ew (hypot 1.0 (* (tan t) (/ eh ew))))
         (* eh (* (sin t) (sin t_1)))))
       (* ew (fabs (cos t)))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh * (tan(t) / -ew)));
	double tmp;
	if (ew <= -1.1e+23) {
		tmp = fabs(((ew * cos(t)) * cos(t_1)));
	} else if (ew <= 2.25e+30) {
		tmp = fabs(((ew / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(t_1)))));
	} else {
		tmp = ew * fabs(cos(t));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((eh * (Math.tan(t) / -ew)));
	double tmp;
	if (ew <= -1.1e+23) {
		tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(t_1)));
	} else if (ew <= 2.25e+30) {
		tmp = Math.abs(((ew / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))) - (eh * (Math.sin(t) * Math.sin(t_1)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((eh * (math.tan(t) / -ew)))
	tmp = 0
	if ew <= -1.1e+23:
		tmp = math.fabs(((ew * math.cos(t)) * math.cos(t_1)))
	elif ew <= 2.25e+30:
		tmp = math.fabs(((ew / math.hypot(1.0, (math.tan(t) * (eh / ew)))) - (eh * (math.sin(t) * math.sin(t_1)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew))))
	tmp = 0.0
	if (ew <= -1.1e+23)
		tmp = abs(Float64(Float64(ew * cos(t)) * cos(t_1)));
	elseif (ew <= 2.25e+30)
		tmp = abs(Float64(Float64(ew / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) - Float64(eh * Float64(sin(t) * sin(t_1)))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((eh * (tan(t) / -ew)));
	tmp = 0.0;
	if (ew <= -1.1e+23)
		tmp = abs(((ew * cos(t)) * cos(t_1)));
	elseif (ew <= 2.25e+30)
		tmp = abs(((ew / hypot(1.0, (tan(t) * (eh / ew)))) - (eh * (sin(t) * sin(t_1)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.1e+23], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.25e+30], N[Abs[N[(N[(ew / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;ew \leq -1.1 \cdot 10^{+23}:\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\

\mathbf{elif}\;ew \leq 2.25 \cdot 10^{+30}:\\
\;\;\;\;\left|\frac{ew}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin t\_1\right)\right|\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -1.10000000000000004e23

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      3. distribute-frac-neg291.4%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      4. associate-/l*91.4%

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

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

    if -1.10000000000000004e23 < ew < 2.24999999999999997e30

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan99.8%

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

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      3. hypot-1-def99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      5. *-commutative99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      7. add-sqr-sqrt52.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{-eh} \cdot \sqrt{-eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      8. sqrt-unprod98.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      9. sqr-neg98.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod47.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt99.8%

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

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

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

    if 2.24999999999999997e30 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 71.2%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt71.0%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod91.4%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow291.4%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr91.4%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow291.4%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square91.4%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified91.4%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.1 \cdot 10^{+23}:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 2.25 \cdot 10^{+30}:\\ \;\;\;\;\left|\frac{ew}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\ \mathbf{if}\;t \leq -3.9 \cdot 10^{+186}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{elif}\;t \leq -0.00028 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin t\_1 \cdot \left(t \cdot eh\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* eh (/ (tan t) (- ew))))))
   (if (<= t -3.9e+186)
     (* ew (+ (cos t) (* eh (/ (* (sin t) (sin (atan (/ (* t eh) ew)))) ew))))
     (if (or (<= t -0.00028) (not (<= t 1.15e-24)))
       (fabs (* (* ew (cos t)) (cos t_1)))
       (fabs (- ew (* (sin t_1) (* t eh))))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh * (tan(t) / -ew)));
	double tmp;
	if (t <= -3.9e+186) {
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	} else if ((t <= -0.00028) || !(t <= 1.15e-24)) {
		tmp = fabs(((ew * cos(t)) * cos(t_1)));
	} else {
		tmp = fabs((ew - (sin(t_1) * (t * eh))));
	}
	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 = atan((eh * (tan(t) / -ew)))
    if (t <= (-3.9d+186)) then
        tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)))
    else if ((t <= (-0.00028d0)) .or. (.not. (t <= 1.15d-24))) then
        tmp = abs(((ew * cos(t)) * cos(t_1)))
    else
        tmp = abs((ew - (sin(t_1) * (t * eh))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((eh * (Math.tan(t) / -ew)));
	double tmp;
	if (t <= -3.9e+186) {
		tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(((t * eh) / ew)))) / ew)));
	} else if ((t <= -0.00028) || !(t <= 1.15e-24)) {
		tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(t_1)));
	} else {
		tmp = Math.abs((ew - (Math.sin(t_1) * (t * eh))));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((eh * (math.tan(t) / -ew)))
	tmp = 0
	if t <= -3.9e+186:
		tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(((t * eh) / ew)))) / ew)))
	elif (t <= -0.00028) or not (t <= 1.15e-24):
		tmp = math.fabs(((ew * math.cos(t)) * math.cos(t_1)))
	else:
		tmp = math.fabs((ew - (math.sin(t_1) * (t * eh))))
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew))))
	tmp = 0.0
	if (t <= -3.9e+186)
		tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(t * eh) / ew)))) / ew))));
	elseif ((t <= -0.00028) || !(t <= 1.15e-24))
		tmp = abs(Float64(Float64(ew * cos(t)) * cos(t_1)));
	else
		tmp = abs(Float64(ew - Float64(sin(t_1) * Float64(t * eh))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((eh * (tan(t) / -ew)));
	tmp = 0.0;
	if (t <= -3.9e+186)
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	elseif ((t <= -0.00028) || ~((t <= 1.15e-24)))
		tmp = abs(((ew * cos(t)) * cos(t_1)));
	else
		tmp = abs((ew - (sin(t_1) * (t * eh))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.9e+186], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -0.00028], N[Not[LessEqual[t, 1.15e-24]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[t$95$1], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+186}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\

\mathbf{elif}\;t \leq -0.00028 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew - \sin t\_1 \cdot \left(t \cdot eh\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.9000000000000001e186

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{2}} \]
    6. Taylor expanded in ew around inf 46.2%

      \[\leadsto \color{blue}{ew \cdot \left(\cos t + \frac{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)}{ew}\right)} \]
    7. Step-by-step derivation
      1. associate-/l*46.0%

        \[\leadsto ew \cdot \left(\cos t + \color{blue}{eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}{ew}}\right) \]
      2. *-commutative46.0%

        \[\leadsto ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right)}{ew}\right) \]
      3. associate-*r/46.0%

        \[\leadsto ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right)}}{ew}\right) \]
    8. Simplified46.0%

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

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

    if -3.9000000000000001e186 < t < -2.7999999999999998e-4 or 1.1500000000000001e-24 < 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. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.6%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.6%

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      3. distribute-frac-neg262.2%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      4. associate-/l*62.2%

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

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

    if -2.7999999999999998e-4 < t < 1.1500000000000001e-24

    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. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub100.0%

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan100.0%

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

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      3. hypot-1-def100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/100.0%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      7. add-sqr-sqrt55.3%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod44.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt100.0%

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

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

      \[\leadsto \left|\color{blue}{ew + -1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    8. Step-by-step derivation
      1. mul-1-neg98.2%

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

        \[\leadsto \left|\color{blue}{ew - eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      3. associate-*r*98.2%

        \[\leadsto \left|ew - \color{blue}{\left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. mul-1-neg98.2%

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

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

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      7. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)\right| \]
      8. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-\tan t \cdot eh}}{ew}\right)\right| \]
      9. *-commutative98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{eh \cdot \tan t}}{ew}\right)\right| \]
      10. distribute-frac-neg98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      11. distribute-frac-neg298.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      12. associate-/l*98.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{+186}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{elif}\;t \leq -0.00028 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\ \mathbf{if}\;ew \leq -1.9 \cdot 10^{-79}:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\ \mathbf{elif}\;ew \leq 8.4 \cdot 10^{-156}:\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin t\_1\right|\\ \mathbf{elif}\;ew \leq 1.9 \cdot 10^{+20}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* eh (/ (tan t) (- ew))))))
   (if (<= ew -1.9e-79)
     (fabs (* (* ew (cos t)) (cos t_1)))
     (if (<= ew 8.4e-156)
       (fabs (* (* eh (sin t)) (sin t_1)))
       (if (<= ew 1.9e+20)
         (*
          ew
          (+ (cos t) (* eh (/ (* (sin t) (sin (atan (/ (* t eh) ew)))) ew))))
         (* ew (fabs (cos t))))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh * (tan(t) / -ew)));
	double tmp;
	if (ew <= -1.9e-79) {
		tmp = fabs(((ew * cos(t)) * cos(t_1)));
	} else if (ew <= 8.4e-156) {
		tmp = fabs(((eh * sin(t)) * sin(t_1)));
	} else if (ew <= 1.9e+20) {
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	} else {
		tmp = ew * fabs(cos(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 = atan((eh * (tan(t) / -ew)))
    if (ew <= (-1.9d-79)) then
        tmp = abs(((ew * cos(t)) * cos(t_1)))
    else if (ew <= 8.4d-156) then
        tmp = abs(((eh * sin(t)) * sin(t_1)))
    else if (ew <= 1.9d+20) then
        tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((eh * (Math.tan(t) / -ew)));
	double tmp;
	if (ew <= -1.9e-79) {
		tmp = Math.abs(((ew * Math.cos(t)) * Math.cos(t_1)));
	} else if (ew <= 8.4e-156) {
		tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(t_1)));
	} else if (ew <= 1.9e+20) {
		tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(((t * eh) / ew)))) / ew)));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((eh * (math.tan(t) / -ew)))
	tmp = 0
	if ew <= -1.9e-79:
		tmp = math.fabs(((ew * math.cos(t)) * math.cos(t_1)))
	elif ew <= 8.4e-156:
		tmp = math.fabs(((eh * math.sin(t)) * math.sin(t_1)))
	elif ew <= 1.9e+20:
		tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(((t * eh) / ew)))) / ew)))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew))))
	tmp = 0.0
	if (ew <= -1.9e-79)
		tmp = abs(Float64(Float64(ew * cos(t)) * cos(t_1)));
	elseif (ew <= 8.4e-156)
		tmp = abs(Float64(Float64(eh * sin(t)) * sin(t_1)));
	elseif (ew <= 1.9e+20)
		tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(t * eh) / ew)))) / ew))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((eh * (tan(t) / -ew)));
	tmp = 0.0;
	if (ew <= -1.9e-79)
		tmp = abs(((ew * cos(t)) * cos(t_1)));
	elseif (ew <= 8.4e-156)
		tmp = abs(((eh * sin(t)) * sin(t_1)));
	elseif (ew <= 1.9e+20)
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.9e-79], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 8.4e-156], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.9e+20], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;ew \leq -1.9 \cdot 10^{-79}:\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1\right|\\

\mathbf{elif}\;ew \leq 8.4 \cdot 10^{-156}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin t\_1\right|\\

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

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.9000000000000001e-79

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      4. associate-/l*84.9%

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

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

    if -1.9000000000000001e-79 < ew < 8.40000000000000049e-156

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    6. Step-by-step derivation
      1. mul-1-neg74.0%

        \[\leadsto \left|\color{blue}{-eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*r*74.0%

        \[\leadsto \left|-\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      3. mul-1-neg74.0%

        \[\leadsto \left|-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. distribute-frac-neg274.0%

        \[\leadsto \left|-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      5. associate-/l*74.0%

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

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

    if 8.40000000000000049e-156 < ew < 1.9e20

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{2}} \]
    6. Taylor expanded in ew around inf 76.3%

      \[\leadsto \color{blue}{ew \cdot \left(\cos t + \frac{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)}{ew}\right)} \]
    7. Step-by-step derivation
      1. associate-/l*76.2%

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

        \[\leadsto ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right)}{ew}\right) \]
      3. associate-*r/76.2%

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

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

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

    if 1.9e20 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 69.5%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt69.2%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod90.2%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow290.2%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr90.2%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow290.2%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square90.2%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified90.2%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.9 \cdot 10^{-79}:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 8.4 \cdot 10^{-156}:\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.9 \cdot 10^{+20}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.32 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq 5 \cdot 10^{-301}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \mathbf{elif}\;ew \leq 2.4 \cdot 10^{-163}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2.9e+146)
   (fabs (* ew (cos (atan (* eh (+ (- 1.0 (/ (tan t) ew)) -1.0))))))
   (if (<= ew -1.32e-39)
     (sqrt (pow (* ew (cos t)) 2.0))
     (if (<= ew 5e-301)
       (fabs (- ew (* (sin (atan (* eh (/ (tan t) (- ew))))) (* t eh))))
       (if (<= ew 2.4e-163)
         (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
         (* ew (fabs (cos t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2.9e+146) {
		tmp = fabs((ew * cos(atan((eh * ((1.0 - (tan(t) / ew)) + -1.0))))));
	} else if (ew <= -1.32e-39) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= 5e-301) {
		tmp = fabs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	} else if (ew <= 2.4e-163) {
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-2.9d+146)) then
        tmp = abs((ew * cos(atan((eh * ((1.0d0 - (tan(t) / ew)) + (-1.0d0)))))))
    else if (ew <= (-1.32d-39)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= 5d-301) then
        tmp = abs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))))
    else if (ew <= 2.4d-163) then
        tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2.9e+146) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * ((1.0 - (Math.tan(t) / ew)) + -1.0))))));
	} else if (ew <= -1.32e-39) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= 5e-301) {
		tmp = Math.abs((ew - (Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (t * eh))));
	} else if (ew <= 2.4e-163) {
		tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -2.9e+146:
		tmp = math.fabs((ew * math.cos(math.atan((eh * ((1.0 - (math.tan(t) / ew)) + -1.0))))))
	elif ew <= -1.32e-39:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= 5e-301:
		tmp = math.fabs((ew - (math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (t * eh))))
	elif ew <= 2.4e-163:
		tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2.9e+146)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(Float64(1.0 - Float64(tan(t) / ew)) + -1.0))))));
	elseif (ew <= -1.32e-39)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= 5e-301)
		tmp = abs(Float64(ew - Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(t * eh))));
	elseif (ew <= 2.4e-163)
		tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew)))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -2.9e+146)
		tmp = abs((ew * cos(atan((eh * ((1.0 - (tan(t) / ew)) + -1.0))))));
	elseif (ew <= -1.32e-39)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= 5e-301)
		tmp = abs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	elseif (ew <= 2.4e-163)
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2.9e+146], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(N[(1.0 - N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1.32e-39], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5e-301], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.4e-163], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\

\mathbf{elif}\;ew \leq -1.32 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq 5 \cdot 10^{-301}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\

\mathbf{elif}\;ew \leq 2.4 \cdot 10^{-163}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if ew < -2.8999999999999998e146

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. distribute-frac-neg260.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*60.3%

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u60.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)\right)}\right)\right| \]
      2. expm1-undefine60.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    9. Applied egg-rr60.4%

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    10. Step-by-step derivation
      1. sub-neg60.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} + \left(-1\right)\right)}\right)\right| \]
      2. log1p-undefine60.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(e^{\color{blue}{\log \left(1 + \frac{\tan t}{-ew}\right)}} + \left(-1\right)\right)\right)\right| \]
      3. rem-exp-log60.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\color{blue}{\left(1 + \frac{\tan t}{-ew}\right)} + \left(-1\right)\right)\right)\right| \]
      4. distribute-frac-neg260.4%

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + \color{blue}{-1}\right)\right)\right| \]
    11. Simplified60.4%

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

    if -2.8999999999999998e146 < ew < -1.31999999999999997e-39

    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. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.6%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.6%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 27.0%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt26.1%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod78.5%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow278.5%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -1.31999999999999997e-39 < ew < 5.00000000000000013e-301

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan99.8%

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

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      3. hypot-1-def99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\frac{\left(-eh\right) \cdot \tan t}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      5. *-commutative99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*99.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      7. add-sqr-sqrt56.0%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod43.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt99.8%

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

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

      \[\leadsto \left|\color{blue}{ew + -1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    8. Step-by-step derivation
      1. mul-1-neg56.3%

        \[\leadsto \left|ew + \color{blue}{\left(-eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
      2. unsub-neg56.3%

        \[\leadsto \left|\color{blue}{ew - eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      3. associate-*r*56.3%

        \[\leadsto \left|ew - \color{blue}{\left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. mul-1-neg56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      5. distribute-frac-neg56.3%

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

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      7. distribute-rgt-neg-out56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)\right| \]
      8. distribute-rgt-neg-out56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-\tan t \cdot eh}}{ew}\right)\right| \]
      9. *-commutative56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{eh \cdot \tan t}}{ew}\right)\right| \]
      10. distribute-frac-neg56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      11. distribute-frac-neg256.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      12. associate-/l*56.3%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    9. Simplified56.3%

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

    if 5.00000000000000013e-301 < ew < 2.4000000000000001e-163

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*59.0%

        \[\leadsto \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)} \]
      2. *-commutative59.0%

        \[\leadsto \color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right) \]
      3. *-commutative59.0%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right) \]
      4. associate-*r/59.0%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right)} \]
    8. Simplified59.0%

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

    if 2.4000000000000001e-163 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 62.0%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt61.7%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod79.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr79.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square79.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified79.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification68.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.32 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq 5 \cdot 10^{-301}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \mathbf{elif}\;ew \leq 2.4 \cdot 10^{-163}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\ \mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq -2.25 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -7.2 \cdot 10^{-290}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 3.5 \cdot 10^{-160}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1
         (fabs (* ew (cos (atan (* eh (+ (- 1.0 (/ (tan t) ew)) -1.0))))))))
   (if (<= ew -2.9e+146)
     t_1
     (if (<= ew -2.25e-159)
       (sqrt (pow (* ew (cos t)) 2.0))
       (if (<= ew -7.2e-290)
         t_1
         (if (<= ew 3.5e-160)
           (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
           (* ew (fabs (cos t)))))))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * cos(atan((eh * ((1.0 - (tan(t) / ew)) + -1.0))))));
	double tmp;
	if (ew <= -2.9e+146) {
		tmp = t_1;
	} else if (ew <= -2.25e-159) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -7.2e-290) {
		tmp = t_1;
	} else if (ew <= 3.5e-160) {
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	} else {
		tmp = ew * fabs(cos(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 = abs((ew * cos(atan((eh * ((1.0d0 - (tan(t) / ew)) + (-1.0d0)))))))
    if (ew <= (-2.9d+146)) then
        tmp = t_1
    else if (ew <= (-2.25d-159)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= (-7.2d-290)) then
        tmp = t_1
    else if (ew <= 3.5d-160) then
        tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs((ew * Math.cos(Math.atan((eh * ((1.0 - (Math.tan(t) / ew)) + -1.0))))));
	double tmp;
	if (ew <= -2.9e+146) {
		tmp = t_1;
	} else if (ew <= -2.25e-159) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -7.2e-290) {
		tmp = t_1;
	} else if (ew <= 3.5e-160) {
		tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((ew * math.cos(math.atan((eh * ((1.0 - (math.tan(t) / ew)) + -1.0))))))
	tmp = 0
	if ew <= -2.9e+146:
		tmp = t_1
	elif ew <= -2.25e-159:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -7.2e-290:
		tmp = t_1
	elif ew <= 3.5e-160:
		tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(ew * cos(atan(Float64(eh * Float64(Float64(1.0 - Float64(tan(t) / ew)) + -1.0))))))
	tmp = 0.0
	if (ew <= -2.9e+146)
		tmp = t_1;
	elseif (ew <= -2.25e-159)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -7.2e-290)
		tmp = t_1;
	elseif (ew <= 3.5e-160)
		tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew)))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((ew * cos(atan((eh * ((1.0 - (tan(t) / ew)) + -1.0))))));
	tmp = 0.0;
	if (ew <= -2.9e+146)
		tmp = t_1;
	elseif (ew <= -2.25e-159)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -7.2e-290)
		tmp = t_1;
	elseif (ew <= 3.5e-160)
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(N[(1.0 - N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.9e+146], t$95$1, If[LessEqual[ew, -2.25e-159], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -7.2e-290], t$95$1, If[LessEqual[ew, 3.5e-160], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\
\mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq -2.25 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -7.2 \cdot 10^{-290}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq 3.5 \cdot 10^{-160}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -2.8999999999999998e146 or -2.24999999999999994e-159 < ew < -7.19999999999999959e-290

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
    6. Step-by-step derivation
      1. mul-1-neg48.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. distribute-frac-neg248.4%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*48.4%

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u39.6%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)\right)}\right)\right| \]
      2. expm1-undefine39.6%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    9. Applied egg-rr39.6%

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    10. Step-by-step derivation
      1. sub-neg39.6%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} + \left(-1\right)\right)}\right)\right| \]
      2. log1p-undefine39.6%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(e^{\color{blue}{\log \left(1 + \frac{\tan t}{-ew}\right)}} + \left(-1\right)\right)\right)\right| \]
      3. rem-exp-log48.5%

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

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

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

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

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

    if -2.8999999999999998e146 < ew < -2.24999999999999994e-159

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.6%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.6%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 20.5%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt19.4%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod64.2%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow264.2%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr64.2%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -7.19999999999999959e-290 < ew < 3.5000000000000003e-160

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*56.2%

        \[\leadsto \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)} \]
      2. *-commutative56.2%

        \[\leadsto \color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right) \]
      3. *-commutative56.2%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right) \]
      4. associate-*r/56.2%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right)} \]
    8. Simplified56.2%

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

    if 3.5000000000000003e-160 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 62.0%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt61.7%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod79.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr79.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square79.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified79.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.9 \cdot 10^{+146}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\ \mathbf{elif}\;ew \leq -2.25 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -7.2 \cdot 10^{-290}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + -1\right)\right)\right|\\ \mathbf{elif}\;ew \leq 3.5 \cdot 10^{-160}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -3.9 \cdot 10^{-290}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 6.5 \cdot 10^{-163}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -1.35e+154)
   (fabs (* ew (cos (atan (* eh (+ -1.0 (- 1.0 (/ t ew))))))))
   (if (<= ew -1.8e-159)
     (sqrt (pow (* ew (cos t)) 2.0))
     (if (<= ew -3.9e-290)
       (fabs (* ew (cos (atan (* eh (/ (tan t) (- ew)))))))
       (if (<= ew 6.5e-163)
         (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh ew)))))
         (* ew (fabs (cos t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = fabs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -1.8e-159) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -3.9e-290) {
		tmp = fabs((ew * cos(atan((eh * (tan(t) / -ew))))));
	} else if (ew <= 6.5e-163) {
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-1.35d+154)) then
        tmp = abs((ew * cos(atan((eh * ((-1.0d0) + (1.0d0 - (t / ew))))))))
    else if (ew <= (-1.8d-159)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= (-3.9d-290)) then
        tmp = abs((ew * cos(atan((eh * (tan(t) / -ew))))))
    else if (ew <= 6.5d-163) then
        tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -1.8e-159) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -3.9e-290) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * (Math.tan(t) / -ew))))));
	} else if (ew <= 6.5e-163) {
		tmp = (eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -1.35e+154:
		tmp = math.fabs((ew * math.cos(math.atan((eh * (-1.0 + (1.0 - (t / ew))))))))
	elif ew <= -1.8e-159:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -3.9e-290:
		tmp = math.fabs((ew * math.cos(math.atan((eh * (math.tan(t) / -ew))))))
	elif ew <= 6.5e-163:
		tmp = (eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / ew))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -1.35e+154)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(-1.0 + Float64(1.0 - Float64(t / ew))))))));
	elseif (ew <= -1.8e-159)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -3.9e-290)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))));
	elseif (ew <= 6.5e-163)
		tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / ew)))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -1.35e+154)
		tmp = abs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	elseif (ew <= -1.8e-159)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -3.9e-290)
		tmp = abs((ew * cos(atan((eh * (tan(t) / -ew))))));
	elseif (ew <= 6.5e-163)
		tmp = (eh * sin(t)) * sin(atan((tan(t) * (eh / ew))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.35e+154], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(-1.0 + N[(1.0 - N[(t / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1.8e-159], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -3.9e-290], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 6.5e-163], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\

\mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -3.9 \cdot 10^{-290}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\

\mathbf{elif}\;ew \leq 6.5 \cdot 10^{-163}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if ew < -1.35000000000000003e154

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*62.3%

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)\right)}\right)\right| \]
      2. expm1-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    9. Applied egg-rr62.3%

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    10. Step-by-step derivation
      1. sub-neg62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} + \left(-1\right)\right)}\right)\right| \]
      2. log1p-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(e^{\color{blue}{\log \left(1 + \frac{\tan t}{-ew}\right)}} + \left(-1\right)\right)\right)\right| \]
      3. rem-exp-log62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\color{blue}{\left(1 + \frac{\tan t}{-ew}\right)} + \left(-1\right)\right)\right)\right| \]
      4. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 + \color{blue}{\left(-\frac{\tan t}{ew}\right)}\right) + \left(-1\right)\right)\right)\right| \]
      5. unsub-neg62.3%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + \color{blue}{-1}\right)\right)\right| \]
    11. Simplified62.3%

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

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

    if -1.35000000000000003e154 < ew < -1.80000000000000011e-159

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 19.4%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod62.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow262.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -1.80000000000000011e-159 < ew < -3.89999999999999973e-290

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
    6. Step-by-step derivation
      1. mul-1-neg31.9%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*31.9%

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

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

    if -3.89999999999999973e-290 < ew < 6.4999999999999999e-163

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*56.2%

        \[\leadsto \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)} \]
      2. *-commutative56.2%

        \[\leadsto \color{blue}{\left(\sin t \cdot eh\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right) \]
      3. *-commutative56.2%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right) \]
      4. associate-*r/56.2%

        \[\leadsto \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right)} \]
    8. Simplified56.2%

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

    if 6.4999999999999999e-163 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 62.0%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt61.7%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod79.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr79.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow279.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square79.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified79.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -3.9 \cdot 10^{-290}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 6.5 \cdot 10^{-163}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 72.9% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.16 \cdot 10^{+186}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{elif}\;t \leq -0.00033 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= t -1.16e+186)
   (* ew (+ (cos t) (* eh (/ (* (sin t) (sin (atan (/ (* t eh) ew)))) ew))))
   (if (or (<= t -0.00033) (not (<= t 1.15e-24)))
     (fabs (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))))
     (fabs (- ew (* (sin (atan (* eh (/ (tan t) (- ew))))) (* t eh)))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (t <= -1.16e+186) {
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	} else if ((t <= -0.00033) || !(t <= 1.15e-24)) {
		tmp = fabs(((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))));
	} else {
		tmp = fabs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if (t <= -1.16e+186) {
		tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan(((t * eh) / ew)))) / ew)));
	} else if ((t <= -0.00033) || !(t <= 1.15e-24)) {
		tmp = Math.abs(((ew * Math.cos(t)) / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))));
	} else {
		tmp = Math.abs((ew - (Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (t * eh))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if t <= -1.16e+186:
		tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan(((t * eh) / ew)))) / ew)))
	elif (t <= -0.00033) or not (t <= 1.15e-24):
		tmp = math.fabs(((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) * (eh / ew)))))
	else:
		tmp = math.fabs((ew - (math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (t * eh))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (t <= -1.16e+186)
		tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(Float64(t * eh) / ew)))) / ew))));
	elseif ((t <= -0.00033) || !(t <= 1.15e-24))
		tmp = abs(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))));
	else
		tmp = abs(Float64(ew - Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(t * eh))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (t <= -1.16e+186)
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan(((t * eh) / ew)))) / ew)));
	elseif ((t <= -0.00033) || ~((t <= 1.15e-24)))
		tmp = abs(((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))));
	else
		tmp = abs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[t, -1.16e+186], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -0.00033], N[Not[LessEqual[t, 1.15e-24]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+186}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\

\mathbf{elif}\;t \leq -0.00033 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\
\;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.15999999999999995e186

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{2}} \]
    6. Taylor expanded in ew around inf 46.2%

      \[\leadsto \color{blue}{ew \cdot \left(\cos t + \frac{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)}{ew}\right)} \]
    7. Step-by-step derivation
      1. associate-/l*46.0%

        \[\leadsto ew \cdot \left(\cos t + \color{blue}{eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}{ew}}\right) \]
      2. *-commutative46.0%

        \[\leadsto ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{ew}\right)}{ew}\right) \]
      3. associate-*r/46.0%

        \[\leadsto ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \color{blue}{\left(\tan t \cdot \frac{eh}{ew}\right)}}{ew}\right) \]
    8. Simplified46.0%

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

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

    if -1.15999999999999995e186 < t < -3.3e-4 or 1.1500000000000001e-24 < 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. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.6%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.6%

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

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan99.6%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/99.6%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*99.6%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{-eh} \cdot \sqrt{-eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      8. sqrt-unprod95.5%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      9. sqr-neg95.5%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod49.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt99.6%

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

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    7. Step-by-step derivation
      1. sin-mult64.8%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \color{blue}{\frac{\cos \left(t - \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)}{2}}\right| \]
      2. associate-*r/64.8%

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \color{blue}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
    9. Step-by-step derivation
      1. +-inverses62.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \frac{eh \cdot \color{blue}{0}}{2}\right| \]
      2. mul0-rgt62.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \frac{\color{blue}{0}}{2}\right| \]
      3. metadata-eval62.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \color{blue}{0}\right| \]
    10. Simplified62.0%

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

    if -3.3e-4 < t < 1.1500000000000001e-24

    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. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub100.0%

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan100.0%

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

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      3. hypot-1-def100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/100.0%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      7. add-sqr-sqrt55.3%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod44.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt100.0%

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

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

      \[\leadsto \left|\color{blue}{ew + -1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    8. Step-by-step derivation
      1. mul-1-neg98.2%

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

        \[\leadsto \left|\color{blue}{ew - eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      3. associate-*r*98.2%

        \[\leadsto \left|ew - \color{blue}{\left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. mul-1-neg98.2%

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

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

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      7. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)\right| \]
      8. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-\tan t \cdot eh}}{ew}\right)\right| \]
      9. *-commutative98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{eh \cdot \tan t}}{ew}\right)\right| \]
      10. distribute-frac-neg98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      11. distribute-frac-neg298.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      12. associate-/l*98.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.16 \cdot 10^{+186}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{elif}\;t \leq -0.00033 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 59.9% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.5 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -2.2 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.5 \cdot 10^{-144}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -1.5e+154)
   (fabs (* ew (cos (atan (* eh (+ -1.0 (- 1.0 (/ t ew))))))))
   (if (<= ew -2.2e-159)
     (sqrt (pow (* ew (cos t)) 2.0))
     (if (<= ew -1e-310)
       (fabs (* ew (cos (atan (* eh (/ (tan t) (- ew)))))))
       (if (<= ew 1.5e-144)
         (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
         (* ew (fabs (cos t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.5e+154) {
		tmp = fabs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -2.2e-159) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = fabs((ew * cos(atan((eh * (tan(t) / -ew))))));
	} else if (ew <= 1.5e-144) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-1.5d+154)) then
        tmp = abs((ew * cos(atan((eh * ((-1.0d0) + (1.0d0 - (t / ew))))))))
    else if (ew <= (-2.2d-159)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= (-1d-310)) then
        tmp = abs((ew * cos(atan((eh * (tan(t) / -ew))))))
    else if (ew <= 1.5d-144) then
        tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.5e+154) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -2.2e-159) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * (Math.tan(t) / -ew))))));
	} else if (ew <= 1.5e-144) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -1.5e+154:
		tmp = math.fabs((ew * math.cos(math.atan((eh * (-1.0 + (1.0 - (t / ew))))))))
	elif ew <= -2.2e-159:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -1e-310:
		tmp = math.fabs((ew * math.cos(math.atan((eh * (math.tan(t) / -ew))))))
	elif ew <= 1.5e-144:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -1.5e+154)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(-1.0 + Float64(1.0 - Float64(t / ew))))))));
	elseif (ew <= -2.2e-159)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(tan(t) / Float64(-ew)))))));
	elseif (ew <= 1.5e-144)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -1.5e+154)
		tmp = abs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	elseif (ew <= -2.2e-159)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = abs((ew * cos(atan((eh * (tan(t) / -ew))))));
	elseif (ew <= 1.5e-144)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.5e+154], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(-1.0 + N[(1.0 - N[(t / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -2.2e-159], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1e-310], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.5e-144], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{+154}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\

\mathbf{elif}\;ew \leq -2.2 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\

\mathbf{elif}\;ew \leq 1.5 \cdot 10^{-144}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if ew < -1.50000000000000013e154

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*62.3%

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)\right)}\right)\right| \]
      2. expm1-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    9. Applied egg-rr62.3%

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    10. Step-by-step derivation
      1. sub-neg62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} + \left(-1\right)\right)}\right)\right| \]
      2. log1p-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(e^{\color{blue}{\log \left(1 + \frac{\tan t}{-ew}\right)}} + \left(-1\right)\right)\right)\right| \]
      3. rem-exp-log62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\color{blue}{\left(1 + \frac{\tan t}{-ew}\right)} + \left(-1\right)\right)\right)\right| \]
      4. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 + \color{blue}{\left(-\frac{\tan t}{ew}\right)}\right) + \left(-1\right)\right)\right)\right| \]
      5. unsub-neg62.3%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + \color{blue}{-1}\right)\right)\right| \]
    11. Simplified62.3%

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

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

    if -1.50000000000000013e154 < ew < -2.2e-159

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 19.4%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod62.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow262.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -2.2e-159 < ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*29.1%

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

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

    if -9.999999999999969e-311 < ew < 1.4999999999999999e-144

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 1.4999999999999999e-144 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification62.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.5 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -2.2 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.5 \cdot 10^{-144}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 73.6% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.00025 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -0.00025) (not (<= t 1.15e-24)))
   (fabs (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))))
   (fabs (- ew (* (sin (atan (* eh (/ (tan t) (- ew))))) (* t eh))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.00025) || !(t <= 1.15e-24)) {
		tmp = fabs(((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))));
	} else {
		tmp = fabs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.00025) || !(t <= 1.15e-24)) {
		tmp = Math.abs(((ew * Math.cos(t)) / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))));
	} else {
		tmp = Math.abs((ew - (Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) * (t * eh))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -0.00025) or not (t <= 1.15e-24):
		tmp = math.fabs(((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) * (eh / ew)))))
	else:
		tmp = math.fabs((ew - (math.sin(math.atan((eh * (math.tan(t) / -ew)))) * (t * eh))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -0.00025) || !(t <= 1.15e-24))
		tmp = abs(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))));
	else
		tmp = abs(Float64(ew - Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * Float64(t * eh))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -0.00025) || ~((t <= 1.15e-24)))
		tmp = abs(((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))));
	else
		tmp = abs((ew - (sin(atan((eh * (tan(t) / -ew)))) * (t * eh))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.00025], N[Not[LessEqual[t, 1.15e-24]], $MachinePrecision]], N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00025 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\
\;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5000000000000001e-4 or 1.1500000000000001e-24 < 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. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.6%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.6%

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

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan99.6%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/99.6%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*99.6%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{-eh} \cdot \sqrt{-eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      8. sqrt-unprod96.2%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      9. sqr-neg96.2%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod52.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt99.6%

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

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
    7. Step-by-step derivation
      1. sin-mult59.9%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \color{blue}{\frac{\cos \left(t - \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)}{2}}\right| \]
      2. associate-*r/59.9%

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \color{blue}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
    9. Step-by-step derivation
      1. +-inverses57.5%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \frac{eh \cdot \color{blue}{0}}{2}\right| \]
      2. mul0-rgt57.5%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \frac{\color{blue}{0}}{2}\right| \]
      3. metadata-eval57.5%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - \color{blue}{0}\right| \]
    10. Simplified57.5%

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

    if -2.5000000000000001e-4 < t < 1.1500000000000001e-24

    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. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub100.0%

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

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

      \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cos-atan100.0%

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

        \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      3. hypot-1-def100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\color{blue}{\mathsf{hypot}\left(1, \left(-eh\right) \cdot \frac{\tan t}{ew}\right)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      4. associate-*r/100.0%

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      6. associate-/l*100.0%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \color{blue}{\tan t \cdot \frac{-eh}{ew}}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      7. add-sqr-sqrt55.3%

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

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

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      10. sqrt-unprod44.7%

        \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right| \]
      11. add-sqr-sqrt100.0%

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

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

      \[\leadsto \left|\color{blue}{ew + -1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    8. Step-by-step derivation
      1. mul-1-neg98.2%

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

        \[\leadsto \left|\color{blue}{ew - eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
      3. associate-*r*98.2%

        \[\leadsto \left|ew - \color{blue}{\left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
      4. mul-1-neg98.2%

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

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

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)\right| \]
      7. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)\right| \]
      8. distribute-rgt-neg-out98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{-\tan t \cdot eh}}{ew}\right)\right| \]
      9. *-commutative98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \left(\frac{-\color{blue}{eh \cdot \tan t}}{ew}\right)\right| \]
      10. distribute-frac-neg98.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      11. distribute-frac-neg298.2%

        \[\leadsto \left|ew - \left(eh \cdot t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      12. associate-/l*98.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.00025 \lor \neg \left(t \leq 1.15 \cdot 10^{-24}\right):\\ \;\;\;\;\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 59.8% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\ \mathbf{elif}\;ew \leq 2.9 \cdot 10^{-145}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -1.35e+154)
   (fabs (* ew (cos (atan (* eh (+ -1.0 (- 1.0 (/ t ew))))))))
   (if (<= ew -1.8e-159)
     (sqrt (pow (* ew (cos t)) 2.0))
     (if (<= ew -1e-310)
       (fabs (* ew (/ 1.0 (hypot 1.0 (* eh (/ (tan t) ew))))))
       (if (<= ew 2.9e-145)
         (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
         (* ew (fabs (cos t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = fabs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -1.8e-159) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = fabs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
	} else if (ew <= 2.9e-145) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(t));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = Math.abs((ew * Math.cos(Math.atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	} else if (ew <= -1.8e-159) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = Math.abs((ew * (1.0 / Math.hypot(1.0, (eh * (Math.tan(t) / ew))))));
	} else if (ew <= 2.9e-145) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -1.35e+154:
		tmp = math.fabs((ew * math.cos(math.atan((eh * (-1.0 + (1.0 - (t / ew))))))))
	elif ew <= -1.8e-159:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -1e-310:
		tmp = math.fabs((ew * (1.0 / math.hypot(1.0, (eh * (math.tan(t) / ew))))))
	elif ew <= 2.9e-145:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -1.35e+154)
		tmp = abs(Float64(ew * cos(atan(Float64(eh * Float64(-1.0 + Float64(1.0 - Float64(t / ew))))))));
	elseif (ew <= -1.8e-159)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(eh * Float64(tan(t) / ew))))));
	elseif (ew <= 2.9e-145)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -1.35e+154)
		tmp = abs((ew * cos(atan((eh * (-1.0 + (1.0 - (t / ew))))))));
	elseif (ew <= -1.8e-159)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = abs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
	elseif (ew <= 2.9e-145)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.35e+154], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[(-1.0 + N[(1.0 - N[(t / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1.8e-159], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1e-310], N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.9e-145], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\

\mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\

\mathbf{elif}\;ew \leq 2.9 \cdot 10^{-145}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if ew < -1.35000000000000003e154

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}\right| \]
      2. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*62.3%

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)\right)}\right)\right| \]
      2. expm1-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    9. Applied egg-rr62.3%

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} - 1\right)}\right)\right| \]
    10. Step-by-step derivation
      1. sub-neg62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\tan t}{-ew}\right)} + \left(-1\right)\right)}\right)\right| \]
      2. log1p-undefine62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(e^{\color{blue}{\log \left(1 + \frac{\tan t}{-ew}\right)}} + \left(-1\right)\right)\right)\right| \]
      3. rem-exp-log62.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\color{blue}{\left(1 + \frac{\tan t}{-ew}\right)} + \left(-1\right)\right)\right)\right| \]
      4. distribute-frac-neg262.3%

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 + \color{blue}{\left(-\frac{\tan t}{ew}\right)}\right) + \left(-1\right)\right)\right)\right| \]
      5. unsub-neg62.3%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(\left(1 - \frac{\tan t}{ew}\right) + \color{blue}{-1}\right)\right)\right| \]
    11. Simplified62.3%

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

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

    if -1.35000000000000003e154 < ew < -1.80000000000000011e-159

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 19.4%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod62.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow262.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -1.80000000000000011e-159 < ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

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

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*29.1%

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot \frac{\tan t}{-ew}\right)}}}\right| \]
      2. hypot-1-def28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{-ew}\right)}}\right| \]
      3. associate-*r/28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh \cdot \tan t}{-ew}}\right)}\right| \]
    9. Applied egg-rr28.8%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \frac{eh \cdot \tan t}{-ew}\right)}}\right| \]
    10. Step-by-step derivation
      1. distribute-frac-neg228.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{-\frac{eh \cdot \tan t}{ew}}\right)}\right| \]
      2. distribute-frac-neg28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh \cdot \tan t}{ew}}\right)}\right| \]
      3. *-commutative28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)}\right| \]
      4. distribute-rgt-neg-out28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)}\right| \]
      5. hypot-undefine28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot \left(-eh\right)}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}}\right| \]
      6. distribute-rgt-neg-out28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\color{blue}{-\tan t \cdot eh}}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      7. *-commutative28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{-\color{blue}{eh \cdot \tan t}}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      8. distribute-frac-neg28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      9. distribute-frac-neg228.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\frac{eh \cdot \tan t}{-ew}} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      10. distribute-rgt-neg-out28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{\color{blue}{-\tan t \cdot eh}}{ew}}}\right| \]
      11. *-commutative28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{-\color{blue}{eh \cdot \tan t}}{ew}}}\right| \]
      12. distribute-frac-neg28.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}}}\right| \]
      13. distribute-frac-neg228.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \color{blue}{\frac{eh \cdot \tan t}{-ew}}}}\right| \]
    11. Simplified28.8%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}}\right| \]

    if -9.999999999999969e-311 < ew < 2.89999999999999984e-145

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 2.89999999999999984e-145 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification62.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \left(-1 + \left(1 - \frac{t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq -1.8 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\ \mathbf{elif}\;ew \leq 2.9 \cdot 10^{-145}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 59.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right|\\ \mathbf{if}\;ew \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq -2.25 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 3.1 \cdot 10^{-143}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* ew (/ 1.0 (hypot 1.0 (* eh (/ (tan t) ew))))))))
   (if (<= ew -1.35e+154)
     t_1
     (if (<= ew -2.25e-159)
       (sqrt (pow (* ew (cos t)) 2.0))
       (if (<= ew -1e-310)
         t_1
         (if (<= ew 3.1e-143)
           (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
           (* ew (fabs (cos t)))))))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = t_1;
	} else if (ew <= -2.25e-159) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = t_1;
	} else if (ew <= 3.1e-143) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(t));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs((ew * (1.0 / Math.hypot(1.0, (eh * (Math.tan(t) / ew))))));
	double tmp;
	if (ew <= -1.35e+154) {
		tmp = t_1;
	} else if (ew <= -2.25e-159) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = t_1;
	} else if (ew <= 3.1e-143) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((ew * (1.0 / math.hypot(1.0, (eh * (math.tan(t) / ew))))))
	tmp = 0
	if ew <= -1.35e+154:
		tmp = t_1
	elif ew <= -2.25e-159:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -1e-310:
		tmp = t_1
	elif ew <= 3.1e-143:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(eh * Float64(tan(t) / ew))))))
	tmp = 0.0
	if (ew <= -1.35e+154)
		tmp = t_1;
	elseif (ew <= -2.25e-159)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = t_1;
	elseif (ew <= 3.1e-143)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((ew * (1.0 / hypot(1.0, (eh * (tan(t) / ew))))));
	tmp = 0.0;
	if (ew <= -1.35e+154)
		tmp = t_1;
	elseif (ew <= -2.25e-159)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = t_1;
	elseif (ew <= 3.1e-143)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.35e+154], t$95$1, If[LessEqual[ew, -2.25e-159], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1e-310], t$95$1, If[LessEqual[ew, 3.1e-143], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;ew \leq -2.25 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq 3.1 \cdot 10^{-143}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.35000000000000003e154 or -2.24999999999999994e-159 < ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
    6. Step-by-step derivation
      1. mul-1-neg46.9%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*46.9%

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

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot \frac{\tan t}{-ew}\right)}}}\right| \]
      2. hypot-1-def46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{-ew}\right)}}\right| \]
      3. associate-*r/46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{eh \cdot \tan t}{-ew}}\right)}\right| \]
    9. Applied egg-rr46.8%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \frac{eh \cdot \tan t}{-ew}\right)}}\right| \]
    10. Step-by-step derivation
      1. distribute-frac-neg246.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{-\frac{eh \cdot \tan t}{ew}}\right)}\right| \]
      2. distribute-frac-neg46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{-eh \cdot \tan t}{ew}}\right)}\right| \]
      3. *-commutative46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{-\color{blue}{\tan t \cdot eh}}{ew}\right)}\right| \]
      4. distribute-rgt-neg-out46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\color{blue}{\tan t \cdot \left(-eh\right)}}{ew}\right)}\right| \]
      5. hypot-undefine46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\sqrt{1 \cdot 1 + \frac{\tan t \cdot \left(-eh\right)}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}}\right| \]
      6. distribute-rgt-neg-out46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{\color{blue}{-\tan t \cdot eh}}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      7. *-commutative46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{-\color{blue}{eh \cdot \tan t}}{ew} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      8. distribute-frac-neg46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      9. distribute-frac-neg246.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \color{blue}{\frac{eh \cdot \tan t}{-ew}} \cdot \frac{\tan t \cdot \left(-eh\right)}{ew}}}\right| \]
      10. distribute-rgt-neg-out46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{\color{blue}{-\tan t \cdot eh}}{ew}}}\right| \]
      11. *-commutative46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{-\color{blue}{eh \cdot \tan t}}{ew}}}\right| \]
      12. distribute-frac-neg46.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}}}\right| \]
      13. distribute-frac-neg246.8%

        \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \color{blue}{\frac{eh \cdot \tan t}{-ew}}}}\right| \]
    11. Simplified46.8%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}}\right| \]

    if -1.35000000000000003e154 < ew < -2.24999999999999994e-159

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 19.4%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod62.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow262.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -9.999999999999969e-311 < ew < 3.10000000000000007e-143

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 3.10000000000000007e-143 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 13: 59.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right|\\ \mathbf{if}\;ew \leq -1.65 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq -2.4 \cdot 10^{-161}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 9.6 \cdot 10^{-146}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* ew (cos (atan (* eh (/ (- t) ew))))))))
   (if (<= ew -1.65e+154)
     t_1
     (if (<= ew -2.4e-161)
       (sqrt (pow (* ew (cos t)) 2.0))
       (if (<= ew -1e-310)
         t_1
         (if (<= ew 9.6e-146)
           (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
           (* ew (fabs (cos t)))))))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * cos(atan((eh * (-t / ew))))));
	double tmp;
	if (ew <= -1.65e+154) {
		tmp = t_1;
	} else if (ew <= -2.4e-161) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = t_1;
	} else if (ew <= 9.6e-146) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(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 = abs((ew * cos(atan((eh * (-t / ew))))))
    if (ew <= (-1.65d+154)) then
        tmp = t_1
    else if (ew <= (-2.4d-161)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= (-1d-310)) then
        tmp = t_1
    else if (ew <= 9.6d-146) then
        tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs((ew * Math.cos(Math.atan((eh * (-t / ew))))));
	double tmp;
	if (ew <= -1.65e+154) {
		tmp = t_1;
	} else if (ew <= -2.4e-161) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= -1e-310) {
		tmp = t_1;
	} else if (ew <= 9.6e-146) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((ew * math.cos(math.atan((eh * (-t / ew))))))
	tmp = 0
	if ew <= -1.65e+154:
		tmp = t_1
	elif ew <= -2.4e-161:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= -1e-310:
		tmp = t_1
	elif ew <= 9.6e-146:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(ew * cos(atan(Float64(eh * Float64(Float64(-t) / ew))))))
	tmp = 0.0
	if (ew <= -1.65e+154)
		tmp = t_1;
	elseif (ew <= -2.4e-161)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = t_1;
	elseif (ew <= 9.6e-146)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((ew * cos(atan((eh * (-t / ew))))));
	tmp = 0.0;
	if (ew <= -1.65e+154)
		tmp = t_1;
	elseif (ew <= -2.4e-161)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= -1e-310)
		tmp = t_1;
	elseif (ew <= 9.6e-146)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[N[ArcTan[N[(eh * N[((-t) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.65e+154], t$95$1, If[LessEqual[ew, -2.4e-161], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, -1e-310], t$95$1, If[LessEqual[ew, 9.6e-146], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right|\\
\mathbf{if}\;ew \leq -1.65 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq -2.4 \cdot 10^{-161}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.65e154 or -2.39999999999999999e-161 < ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.9%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.9%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.9%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}\right| \]
    6. Step-by-step derivation
      1. mul-1-neg46.9%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh \cdot \tan t}{-ew}\right)}\right| \]
      3. associate-/l*46.9%

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

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

      \[\leadsto \left|ew \cdot \cos \tan^{-1} \color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}\right| \]
    9. Step-by-step derivation
      1. mul-1-neg45.8%

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

        \[\leadsto \left|ew \cdot \cos \tan^{-1} \left(-\color{blue}{eh \cdot \frac{t}{ew}}\right)\right| \]
      3. distribute-rgt-neg-in45.8%

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

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

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

    if -1.65e154 < ew < -2.39999999999999999e-161

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 19.4%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod62.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow262.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -9.999999999999969e-311 < ew < 9.6000000000000006e-146

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 9.6000000000000006e-146 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.65 \cdot 10^{+154}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right|\\ \mathbf{elif}\;ew \leq -2.4 \cdot 10^{-161}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right)\right|\\ \mathbf{elif}\;ew \leq 9.6 \cdot 10^{-146}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\ \mathbf{elif}\;ew \leq 3.4 \cdot 10^{-144}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -1e-310)
   (sqrt (pow (* ew (cos t)) 2.0))
   (if (<= ew 3.4e-144)
     (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
     (* ew (fabs (cos t))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1e-310) {
		tmp = sqrt(pow((ew * cos(t)), 2.0));
	} else if (ew <= 3.4e-144) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-1d-310)) then
        tmp = sqrt(((ew * cos(t)) ** 2.0d0))
    else if (ew <= 3.4d-144) then
        tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1e-310) {
		tmp = Math.sqrt(Math.pow((ew * Math.cos(t)), 2.0));
	} else if (ew <= 3.4e-144) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -1e-310:
		tmp = math.sqrt(math.pow((ew * math.cos(t)), 2.0))
	elif ew <= 3.4e-144:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -1e-310)
		tmp = sqrt((Float64(ew * cos(t)) ^ 2.0));
	elseif (ew <= 3.4e-144)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -1e-310)
		tmp = sqrt(((ew * cos(t)) ^ 2.0));
	elseif (ew <= 3.4e-144)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -1e-310], N[Sqrt[N[Power[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 3.4e-144], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{{\left(ew \cdot \cos t\right)}^{2}}\\

\mathbf{elif}\;ew \leq 3.4 \cdot 10^{-144}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 15.5%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt14.0%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      2. sqrt-unprod31.7%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \left(ew \cdot \cos t\right)}} \]
      3. pow231.7%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \cos t\right)}^{2}}} \]
    8. Applied egg-rr31.7%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \cos t\right)}^{2}}} \]

    if -9.999999999999969e-311 < ew < 3.40000000000000017e-144

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 3.40000000000000017e-144 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 41.2% accurate, 4.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1 \cdot 10^{-310}:\\ \;\;\;\;ew \cdot \cos t\\ \mathbf{elif}\;ew \leq 4.7 \cdot 10^{-147}:\\ \;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -1e-310)
   (* ew (cos t))
   (if (<= ew 4.7e-147)
     (+ ew (* eh (* t (sin (atan (/ (* t eh) ew))))))
     (* ew (fabs (cos t))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1e-310) {
		tmp = ew * cos(t);
	} else if (ew <= 4.7e-147) {
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-1d-310)) then
        tmp = ew * cos(t)
    else if (ew <= 4.7d-147) then
        tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))))
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -1e-310) {
		tmp = ew * Math.cos(t);
	} else if (ew <= 4.7e-147) {
		tmp = ew + (eh * (t * Math.sin(Math.atan(((t * eh) / ew)))));
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -1e-310:
		tmp = ew * math.cos(t)
	elif ew <= 4.7e-147:
		tmp = ew + (eh * (t * math.sin(math.atan(((t * eh) / ew)))))
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -1e-310)
		tmp = Float64(ew * cos(t));
	elseif (ew <= 4.7e-147)
		tmp = Float64(ew + Float64(eh * Float64(t * sin(atan(Float64(Float64(t * eh) / ew))))));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -1e-310)
		tmp = ew * cos(t);
	elseif (ew <= 4.7e-147)
		tmp = ew + (eh * (t * sin(atan(((t * eh) / ew)))));
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -1e-310], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 4.7e-147], N[(ew + N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1 \cdot 10^{-310}:\\
\;\;\;\;ew \cdot \cos t\\

\mathbf{elif}\;ew \leq 4.7 \cdot 10^{-147}:\\
\;\;\;\;ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -9.999999999999969e-311

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 15.5%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]

    if -9.999999999999969e-311 < ew < 4.69999999999999989e-147

    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. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.7%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{eh \cdot \left(-\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      4. cancel-sign-sub99.7%

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

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

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

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

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

      \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot t}{ew}\right)}\right) \]
    8. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto ew + eh \cdot \left(t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{t \cdot eh}}{ew}\right)\right) \]
    9. Simplified44.7%

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

    if 4.69999999999999989e-147 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 64.1%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt63.8%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod81.3%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr81.3%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square81.3%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified81.3%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 38.2% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.5 \cdot 10^{-302}:\\ \;\;\;\;ew \cdot \cos t\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \left|\cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -2.5e-302) (* ew (cos t)) (* ew (fabs (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2.5e-302) {
		tmp = ew * cos(t);
	} else {
		tmp = ew * fabs(cos(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) :: tmp
    if (ew <= (-2.5d-302)) then
        tmp = ew * cos(t)
    else
        tmp = ew * abs(cos(t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -2.5e-302) {
		tmp = ew * Math.cos(t);
	} else {
		tmp = ew * Math.abs(Math.cos(t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -2.5e-302:
		tmp = ew * math.cos(t)
	else:
		tmp = ew * math.fabs(math.cos(t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -2.5e-302)
		tmp = Float64(ew * cos(t));
	else
		tmp = Float64(ew * abs(cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -2.5e-302)
		tmp = ew * cos(t);
	else
		tmp = ew * abs(cos(t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -2.5e-302], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], N[(ew * N[Abs[N[Cos[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.5 \cdot 10^{-302}:\\
\;\;\;\;ew \cdot \cos t\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \left|\cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.50000000000000017e-302

    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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 15.6%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]

    if -2.50000000000000017e-302 < 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. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. associate-*l*99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
      3. distribute-rgt-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
    6. Taylor expanded in ew around inf 49.9%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt49.4%

        \[\leadsto ew \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\cos t}\right)} \]
      2. sqrt-unprod62.7%

        \[\leadsto ew \cdot \color{blue}{\sqrt{\cos t \cdot \cos t}} \]
      3. pow262.7%

        \[\leadsto ew \cdot \sqrt{\color{blue}{{\cos t}^{2}}} \]
    8. Applied egg-rr62.7%

      \[\leadsto ew \cdot \color{blue}{\sqrt{{\cos t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow262.7%

        \[\leadsto ew \cdot \sqrt{\color{blue}{\cos t \cdot \cos t}} \]
      2. rem-sqrt-square62.7%

        \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
    10. Simplified62.7%

      \[\leadsto ew \cdot \color{blue}{\left|\cos t\right|} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 32.1% accurate, 8.9× speedup?

\[\begin{array}{l} \\ ew \cdot \cos t \end{array} \]
(FPCore (eh ew t) :precision binary64 (* ew (cos t)))
double code(double eh, double ew, double t) {
	return ew * cos(t);
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew * cos(t)
end function
public static double code(double eh, double ew, double t) {
	return ew * Math.cos(t);
}
def code(eh, ew, t):
	return ew * math.cos(t)
function code(eh, ew, t)
	return Float64(ew * cos(t))
end
function tmp = code(eh, ew, t)
	tmp = ew * cos(t);
end
code[eh_, ew_, t_] := N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
ew \cdot \cos t
\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. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. associate-*l*99.8%

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
    3. distribute-rgt-neg-in99.8%

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

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

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

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

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(ew, \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}\right)}^{3}} \]
  6. Taylor expanded in ew around inf 33.5%

    \[\leadsto \color{blue}{ew \cdot \cos t} \]
  7. Add Preprocessing

Alternative 18: 22.5% accurate, 921.0× speedup?

\[\begin{array}{l} \\ ew \end{array} \]
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
	return ew;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew
end function
public static double code(double eh, double ew, double t) {
	return ew;
}
def code(eh, ew, t):
	return ew
function code(eh, ew, t)
	return ew
end
function tmp = code(eh, ew, t)
	tmp = ew;
end
code[eh_, ew_, t_] := ew
\begin{array}{l}

\\
ew
\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. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. associate-*l*99.8%

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right)\right| \]
    3. distribute-rgt-neg-in99.8%

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

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

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

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

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

    \[\leadsto \color{blue}{ew} \]
  7. Add Preprocessing

Reproduce

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