Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 21.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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, 0.9× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. fabs-sub99.8%

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, -\cos t \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)}\right| \]
  3. Simplified99.8%

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

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

Alternative 2: 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}
Derivation
  1. Initial program 99.8%

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

Alternative 3: 99.7% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt98.6%

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.6%

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

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

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

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

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

Alternative 4: 97.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -3.8 \cdot 10^{-60} \lor \neg \left(ew \leq 1.2 \cdot 10^{-119}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.79999999999999994e-60 or 1.20000000000000004e-119 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.3%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.4%

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999994e-60 < ew < 1.20000000000000004e-119

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt99.1%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow399.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -3.8 \cdot 10^{-60} \lor \neg \left(ew \leq 1.2 \cdot 10^{-119}\right):\\ \;\;\;\;\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\ \mathbf{if}\;ew \leq -5.5 \cdot 10^{-46} \lor \neg \left(ew \leq 1.4 \cdot 10^{-9}\right):\\ \;\;\;\;\left|ew \cdot \left(\cos t - eh \cdot \frac{t\_1}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - t\_1\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))
   (if (or (<= ew -5.5e-46) (not (<= ew 1.4e-9)))
     (fabs (* ew (- (cos t) (* eh (/ t_1 ew)))))
     (fabs (* eh (- (* ew (/ (cos t) eh)) t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew))));
	double tmp;
	if ((ew <= -5.5e-46) || !(ew <= 1.4e-9)) {
		tmp = fabs((ew * (cos(t) - (eh * (t_1 / ew)))));
	} else {
		tmp = fabs((eh * ((ew * (cos(t) / eh)) - t_1)));
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew))))
    if ((ew <= (-5.5d-46)) .or. (.not. (ew <= 1.4d-9))) then
        tmp = abs((ew * (cos(t) - (eh * (t_1 / ew)))))
    else
        tmp = abs((eh * ((ew * (cos(t) / eh)) - t_1)))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / -ew))));
	double tmp;
	if ((ew <= -5.5e-46) || !(ew <= 1.4e-9)) {
		tmp = Math.abs((ew * (Math.cos(t) - (eh * (t_1 / ew)))));
	} else {
		tmp = Math.abs((eh * ((ew * (Math.cos(t) / eh)) - t_1)));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / -ew))))
	tmp = 0
	if (ew <= -5.5e-46) or not (ew <= 1.4e-9):
		tmp = math.fabs((ew * (math.cos(t) - (eh * (t_1 / ew)))))
	else:
		tmp = math.fabs((eh * ((ew * (math.cos(t) / eh)) - t_1)))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))
	tmp = 0.0
	if ((ew <= -5.5e-46) || !(ew <= 1.4e-9))
		tmp = abs(Float64(ew * Float64(cos(t) - Float64(eh * Float64(t_1 / ew)))));
	else
		tmp = abs(Float64(eh * Float64(Float64(ew * Float64(cos(t) / eh)) - t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * sin(atan((eh * (tan(t) / -ew))));
	tmp = 0.0;
	if ((ew <= -5.5e-46) || ~((ew <= 1.4e-9)))
		tmp = abs((ew * (cos(t) - (eh * (t_1 / ew)))));
	else
		tmp = abs((eh * ((ew * (cos(t) / eh)) - t_1)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[ew, -5.5e-46], N[Not[LessEqual[ew, 1.4e-9]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(eh * N[(t$95$1 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[(ew * N[(N[Cos[t], $MachinePrecision] / eh), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\mathbf{if}\;ew \leq -5.5 \cdot 10^{-46} \lor \neg \left(ew \leq 1.4 \cdot 10^{-9}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t - eh \cdot \frac{t\_1}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -5.49999999999999983e-46 or 1.39999999999999992e-9 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.3%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.4%

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999983e-46 < ew < 1.39999999999999992e-9

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.9%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -5.5 \cdot 10^{-46} \lor \neg \left(ew \leq 1.4 \cdot 10^{-9}\right):\\ \;\;\;\;\left|ew \cdot \left(\cos t - eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 93.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.8 \cdot 10^{-92} \lor \neg \left(eh \leq 4.5 \cdot 10^{-38}\right):\\
\;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.80000000000000008e-92 or 4.50000000000000009e-38 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt99.1%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow399.1%

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

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

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

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

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

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

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

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

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

    if -1.80000000000000008e-92 < eh < 4.50000000000000009e-38

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt97.9%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow397.9%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.8 \cdot 10^{-92} \lor \neg \left(eh \leq 4.5 \cdot 10^{-38}\right):\\ \;\;\;\;\left|eh \cdot \left(ew \cdot \frac{\cos t}{eh} - \sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.2% accurate, 1.5× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt98.6%

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.6%

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

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

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

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

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

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

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

Alternative 8: 75.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2.8 \cdot 10^{+26} \lor \neg \left(eh \leq 7.5 \cdot 10^{+62}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -2.8e26 or 7.49999999999999998e62 < eh

    1. Initial program 99.8%

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

      \[\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| \]
    4. Step-by-step derivation
      1. associate-*r*74.6%

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

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

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

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

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

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

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

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

    if -2.8e26 < eh < 7.49999999999999998e62

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.1%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.1%

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

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

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

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

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

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

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

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

Alternative 9: 73.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;t \leq -14000:\\
\;\;\;\;\left|t\_1\right|\\

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

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


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

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.6%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.7%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt97.2%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

    if -14000 < t < 3.44999999999999994e-13

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.3%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.3%

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

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

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

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

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

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

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

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

    if 3.44999999999999994e-13 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.7% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-5}:\\
\;\;\;\;\left|t\_1\right|\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.8000000000000001e-5

    1. Initial program 99.6%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.6%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.7%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt97.2%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

    if -4.8000000000000001e-5 < t < 3.44999999999999994e-13

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.3%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.3%

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

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

      \[\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| \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

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

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

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

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

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

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

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

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

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

    if 3.44999999999999994e-13 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.2% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-6} \lor \neg \left(t \leq 2800000000\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.50000000000000011e-6 or 2.8e9 < t

    1. Initial program 99.6%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.7%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.8%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt97.4%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

    if -4.50000000000000011e-6 < t < 2.8e9

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.4%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.3%

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

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

      \[\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| \]
    6. Step-by-step derivation
      1. mul-1-neg97.0%

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

        \[\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*97.0%

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

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

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

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

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

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

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

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

Alternative 12: 64.3% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.25 \cdot 10^{-76} \lor \neg \left(ew \leq -8 \cdot 10^{-298}\right):\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -1.25e-76) (not (<= ew -8e-298)))
   (fabs (* ew (cos t)))
   (* (* eh (sin t)) (- (sin (atan (* (tan t) (/ eh ew))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -1.25e-76) || !(ew <= -8e-298)) {
		tmp = fabs((ew * cos(t)));
	} else {
		tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / ew))));
	}
	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.25d-76)) .or. (.not. (ew <= (-8d-298)))) then
        tmp = abs((ew * cos(t)))
    else
        tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / ew))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -1.25e-76) || !(ew <= -8e-298)) {
		tmp = Math.abs((ew * Math.cos(t)));
	} else {
		tmp = (eh * Math.sin(t)) * -Math.sin(Math.atan((Math.tan(t) * (eh / ew))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (ew <= -1.25e-76) or not (ew <= -8e-298):
		tmp = math.fabs((ew * math.cos(t)))
	else:
		tmp = (eh * math.sin(t)) * -math.sin(math.atan((math.tan(t) * (eh / ew))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -1.25e-76) || !(ew <= -8e-298))
		tmp = abs(Float64(ew * cos(t)));
	else
		tmp = Float64(Float64(eh * sin(t)) * Float64(-sin(atan(Float64(tan(t) * Float64(eh / ew))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((ew <= -1.25e-76) || ~((ew <= -8e-298)))
		tmp = abs((ew * cos(t)));
	else
		tmp = (eh * sin(t)) * -sin(atan((tan(t) * (eh / ew))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -1.25e-76], N[Not[LessEqual[ew, -8e-298]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.25 \cdot 10^{-76} \lor \neg \left(ew \leq -8 \cdot 10^{-298}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.2499999999999999e-76 or -7.9999999999999993e-298 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.5%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.5%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt97.5%

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

    if -1.2499999999999999e-76 < ew < -7.9999999999999993e-298

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.25 \cdot 10^{-76} \lor \neg \left(ew \leq -8 \cdot 10^{-298}\right):\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.6% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \left|ew \cdot \cos t\right| \end{array} \]
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
double code(double eh, double ew, double t) {
	return fabs((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 = abs((ew * cos(t)))
end function
public static double code(double eh, double ew, double t) {
	return Math.abs((ew * Math.cos(t)));
}
def code(eh, ew, t):
	return math.fabs((ew * math.cos(t)))
function code(eh, ew, t)
	return abs(Float64(ew * cos(t)))
end
function tmp = code(eh, ew, t)
	tmp = abs((ew * cos(t)));
end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|ew \cdot \cos t\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt98.6%

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.6%

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

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

    \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  6. Step-by-step derivation
    1. rem-cube-cbrt97.9%

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
  9. Add Preprocessing

Alternative 14: 48.7% accurate, 8.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-5} \lor \neg \left(t \leq 11500000000\right):\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -4.5e-5) (not (<= t 11500000000.0)))
   (* ew (- (cos t)))
   (fabs ew)))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -4.5e-5) || !(t <= 11500000000.0)) {
		tmp = ew * -cos(t);
	} else {
		tmp = fabs(ew);
	}
	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 ((t <= (-4.5d-5)) .or. (.not. (t <= 11500000000.0d0))) then
        tmp = ew * -cos(t)
    else
        tmp = abs(ew)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -4.5e-5) || !(t <= 11500000000.0)) {
		tmp = ew * -Math.cos(t);
	} else {
		tmp = Math.abs(ew);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -4.5e-5) or not (t <= 11500000000.0):
		tmp = ew * -math.cos(t)
	else:
		tmp = math.fabs(ew)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -4.5e-5) || !(t <= 11500000000.0))
		tmp = Float64(ew * Float64(-cos(t)));
	else
		tmp = abs(ew);
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -4.5e-5) || ~((t <= 11500000000.0)))
		tmp = ew * -cos(t);
	else
		tmp = abs(ew);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -4.5e-5], N[Not[LessEqual[t, 11500000000.0]], $MachinePrecision]], N[(ew * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-5} \lor \neg \left(t \leq 11500000000\right):\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.50000000000000028e-5 or 1.15e10 < t

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    5. Step-by-step derivation
      1. neg-mul-128.4%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in28.4%

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

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

    if -4.50000000000000028e-5 < t < 1.15e10

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.4%

        \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.3%

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

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

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. Step-by-step derivation
      1. rem-cube-cbrt98.5%

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

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

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

      \[\leadsto \left|\color{blue}{ew}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-5} \lor \neg \left(t \leq 11500000000\right):\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 41.5% accurate, 9.1× speedup?

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

\\
\left|ew\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt98.6%

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt[3]{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right) \cdot \sqrt[3]{\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. pow398.6%

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

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

    \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  6. Step-by-step derivation
    1. rem-cube-cbrt97.9%

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

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  9. Add Preprocessing

Alternative 16: 21.9% accurate, 460.5× 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 Float64(-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. Add Preprocessing
  3. Applied egg-rr49.8%

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

    \[\leadsto \color{blue}{-1 \cdot ew} \]
  5. Step-by-step derivation
    1. neg-mul-118.3%

      \[\leadsto \color{blue}{-ew} \]
  6. Simplified18.3%

    \[\leadsto \color{blue}{-ew} \]
  7. Add Preprocessing

Reproduce

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