Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 21.5s
Alternatives: 9
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

      \[\leadsto \color{blue}{\left|-\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)\right|} \]
    2. sub0-neg99.8%

      \[\leadsto \left|\color{blue}{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)}\right| \]
    3. sub-neg99.8%

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} - 1\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
  6. Step-by-step derivation
    1. expm1-def74.3%

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

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

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

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

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

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

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

Alternative 2: 85.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.7 \cdot 10^{-138}:\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|\\

\mathbf{elif}\;eh \leq 1.35 \cdot 10^{+46}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -4.7000000000000001e-138

    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-neg99.8%

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.8%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.8%

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

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

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

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

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

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

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

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

    if -4.7000000000000001e-138 < eh < 1.3500000000000001e46

    1. Initial program 99.7%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.7%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}} - 0\right| \]
    11. Step-by-step derivation
      1. pow-base-184.5%

        \[\leadsto \left|\left(\cos t \cdot ew\right) \cdot \color{blue}{1} - 0\right| \]
      2. *-rgt-identity84.5%

        \[\leadsto \left|\color{blue}{\cos t \cdot ew} - 0\right| \]
      3. *-commutative84.5%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
    12. Simplified84.5%

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

    if 1.3500000000000001e46 < eh

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.9%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -4.7 \cdot 10^{-138}:\\ \;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|\\ \mathbf{elif}\;eh \leq 1.35 \cdot 10^{+46}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right|\\ \end{array} \]

Alternative 3: 85.3% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;eh \leq 1.35 \cdot 10^{+46}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -3.0499999999999999e-139

    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-neg99.8%

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.8%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right) - \frac{\left(eh \cdot \sin t\right) \cdot \left(\tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)}{\sqrt{1 + \frac{-eh}{\frac{ew}{\tan t}} \cdot \frac{-eh}{\frac{ew}{\tan t}}}}\right| \]
      10. add-sqr-sqrt66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0499999999999999e-139 < eh < 1.3500000000000001e46

    1. Initial program 99.7%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.7%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}} - 0\right| \]
    11. Step-by-step derivation
      1. pow-base-184.5%

        \[\leadsto \left|\left(\cos t \cdot ew\right) \cdot \color{blue}{1} - 0\right| \]
      2. *-rgt-identity84.5%

        \[\leadsto \left|\color{blue}{\cos t \cdot ew} - 0\right| \]
      3. *-commutative84.5%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
    12. Simplified84.5%

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

    if 1.3500000000000001e46 < eh

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.9%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -3.05 \cdot 10^{-139}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right) - eh \cdot \sin t\right|\\ \mathbf{elif}\;eh \leq 1.35 \cdot 10^{+46}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right|\\ \end{array} \]

Alternative 4: 89.6% accurate, 1.8× speedup?

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

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

      \[\leadsto \color{blue}{\left|-\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)\right|} \]
    2. sub0-neg99.8%

      \[\leadsto \left|\color{blue}{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)}\right| \]
    3. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right) - \frac{\left(eh \cdot \sin t\right) \cdot \left(\tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)}{\sqrt{1 + \frac{-eh}{\frac{ew}{\tan t}} \cdot \frac{-eh}{\frac{ew}{\tan t}}}}\right| \]
    10. add-sqr-sqrt75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.4% accurate, 1.8× speedup?

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

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

      \[\leadsto \color{blue}{\left|-\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)\right|} \]
    2. sub0-neg99.8%

      \[\leadsto \left|\color{blue}{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)}\right| \]
    3. sub-neg99.8%

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} - 1\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
  6. Step-by-step derivation
    1. expm1-def74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right) - \frac{\left(eh \cdot \sin t\right) \cdot \left(\tan t \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}\right)}{\sqrt{1 + \frac{-eh}{\frac{ew}{\tan t}} \cdot \frac{-eh}{\frac{ew}{\tan t}}}}\right| \]
    10. add-sqr-sqrt75.4%

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

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

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

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

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

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

      \[\leadsto \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)} - \color{blue}{\left(-\sin t \cdot eh\right)}\right| \]
    2. distribute-rgt-neg-in98.5%

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

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

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

Alternative 6: 85.2% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -8.2 \cdot 10^{-138} \lor \neg \left(eh \leq 5.2 \cdot 10^{+46}\right):\\ \;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{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 -8.2e-138) (not (<= eh 5.2e+46)))
   (fabs (- ew (* eh (* (sin t) (sin (atan (- (/ (* t eh) ew))))))))
   (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((eh <= -8.2e-138) || !(eh <= 5.2e+46)) {
		tmp = fabs((ew - (eh * (sin(t) * sin(atan(-((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 <= (-8.2d-138)) .or. (.not. (eh <= 5.2d+46))) then
        tmp = abs((ew - (eh * (sin(t) * sin(atan(-((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 <= -8.2e-138) || !(eh <= 5.2e+46)) {
		tmp = Math.abs((ew - (eh * (Math.sin(t) * Math.sin(Math.atan(-((t * eh) / ew)))))));
	} else {
		tmp = Math.abs((ew * Math.cos(t)));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (eh <= -8.2e-138) or not (eh <= 5.2e+46):
		tmp = math.fabs((ew - (eh * (math.sin(t) * math.sin(math.atan(-((t * eh) / ew)))))))
	else:
		tmp = math.fabs((ew * math.cos(t)))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((eh <= -8.2e-138) || !(eh <= 5.2e+46))
		tmp = abs(Float64(ew - Float64(eh * Float64(sin(t) * sin(atan(Float64(-Float64(Float64(t * eh) / ew))))))));
	else
		tmp = abs(Float64(ew * cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((eh <= -8.2e-138) || ~((eh <= 5.2e+46)))
		tmp = abs((ew - (eh * (sin(t) * sin(atan(-((t * eh) / ew)))))));
	else
		tmp = abs((ew * cos(t)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -8.2e-138], N[Not[LessEqual[eh, 5.2e+46]], $MachinePrecision]], N[Abs[N[(ew - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[(-N[(N[(t * eh), $MachinePrecision] / ew), $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 -8.2 \cdot 10^{-138} \lor \neg \left(eh \leq 5.2 \cdot 10^{+46}\right):\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{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 < -8.19999999999999998e-138 or 5.20000000000000027e46 < 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. Step-by-step derivation
      1. fabs-neg99.8%

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.8%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.19999999999999998e-138 < eh < 5.20000000000000027e46

    1. Initial program 99.7%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.7%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}} - 0\right| \]
    11. Step-by-step derivation
      1. pow-base-184.5%

        \[\leadsto \left|\left(\cos t \cdot ew\right) \cdot \color{blue}{1} - 0\right| \]
      2. *-rgt-identity84.5%

        \[\leadsto \left|\color{blue}{\cos t \cdot ew} - 0\right| \]
      3. *-commutative84.5%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
    12. Simplified84.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -8.2 \cdot 10^{-138} \lor \neg \left(eh \leq 5.2 \cdot 10^{+46}\right):\\ \;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]

Alternative 7: 74.4% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5000000000000002e-6 or 2.9e-4 < t

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg99.6%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}} - 0\right| \]
    11. Step-by-step derivation
      1. pow-base-147.2%

        \[\leadsto \left|\left(\cos t \cdot ew\right) \cdot \color{blue}{1} - 0\right| \]
      2. *-rgt-identity47.2%

        \[\leadsto \left|\color{blue}{\cos t \cdot ew} - 0\right| \]
      3. *-commutative47.2%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
    12. Simplified47.2%

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

    if -2.5000000000000002e-6 < t < 2.9e-4

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left|-\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)\right|} \]
      2. sub0-neg100.0%

        \[\leadsto \left|\color{blue}{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)}\right| \]
      3. sub-neg100.0%

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    7. Step-by-step derivation
      1. expm1-log1p-u90.5%

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

        \[\leadsto \left|ew - \color{blue}{\left(e^{\mathsf{log1p}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right)} - 1\right)}\right| \]
    8. Applied egg-rr77.0%

      \[\leadsto \left|ew - \color{blue}{\left(e^{\mathsf{log1p}\left(\sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right) \cdot \left(eh \cdot \sin t\right)\right)} - 1\right)}\right| \]
    9. Step-by-step derivation
      1. expm1-def88.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|-\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)\right|} \]
    2. sub0-neg99.8%

      \[\leadsto \left|\color{blue}{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)}\right| \]
    3. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}} - 0\right| \]
  11. Step-by-step derivation
    1. pow-base-159.8%

      \[\leadsto \left|\left(\cos t \cdot ew\right) \cdot \color{blue}{1} - 0\right| \]
    2. *-rgt-identity59.8%

      \[\leadsto \left|\color{blue}{\cos t \cdot ew} - 0\right| \]
    3. *-commutative59.8%

      \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
  12. Simplified59.8%

    \[\leadsto \left|\color{blue}{ew \cdot \cos t} - 0\right| \]
  13. Final simplification59.8%

    \[\leadsto \left|ew \cdot \cos t\right| \]

Alternative 9: 42.1% 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. Step-by-step derivation
    1. fabs-neg99.8%

      \[\leadsto \color{blue}{\left|-\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)\right|} \]
    2. sub0-neg99.8%

      \[\leadsto \left|\color{blue}{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)}\right| \]
    3. sub-neg99.8%

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

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

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

    \[\leadsto \color{blue}{\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|} \]
  4. Step-by-step derivation
    1. add-cbrt-cube63.9%

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

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

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

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

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

      \[\leadsto \left|ew - \color{blue}{\left(e^{\mathsf{log1p}\left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right)} - 1\right)}\right| \]
  8. Applied egg-rr51.2%

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

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

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  12. Final simplification42.0%

    \[\leadsto \left|ew\right| \]

Reproduce

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