Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 17.8s
Alternatives: 8
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 8 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. 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. Final simplification99.8%

    \[\leadsto \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| \]

Alternative 2: 99.7% accurate, 1.1× speedup?

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

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

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

      \[\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-/l*99.8%

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - 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}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - 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}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]

Alternative 3: 83.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;eh \leq 5.5 \cdot 10^{-130}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


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

    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.9%

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

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

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

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

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

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

        \[\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-/l*99.9%

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

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    8. Taylor expanded in t around 0 98.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| \]
    9. Taylor expanded in t around 0 98.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| \]
    10. Step-by-step derivation
      1. mul-1-neg98.1%

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

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

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

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

    if -1.70000000000000011e116 < eh < 5.50000000000000007e-130

    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-cube-cbrt98.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)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
      2. pow398.3%

        \[\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}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    5. Applied egg-rr98.3%

      \[\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}} - 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. sin-mult85.8%

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

        \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    7. Applied egg-rr85.5%

      \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    8. Step-by-step derivation
      1. +-inverses85.5%

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

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

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

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

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

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

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

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

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

    if 5.50000000000000007e-130 < 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. expm1-log1p-u75.4%

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

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

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

        \[\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-/l*99.8%

        \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - 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}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    8. Taylor expanded in t around 0 90.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| \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.3%

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

Alternative 4: 98.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} + eh \cdot \sin t\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+ (/ (* ew (cos t)) (hypot 1.0 (* (tan t) (/ eh ew)))) (* eh (sin t)))))
double code(double eh, double ew, double t) {
	return fabs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) + (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) * (eh / ew)))) + (eh * Math.sin(t))));
}
def code(eh, ew, t):
	return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) * (eh / ew)))) + (eh * math.sin(t))))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))) + Float64(eh * sin(t))))
end
function tmp = code(eh, ew, t)
	tmp = abs((((ew * cos(t)) / hypot(1.0, (tan(t) * (eh / ew)))) + (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[(eh / ew), $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, \tan t \cdot \frac{eh}{ew}\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.0%

      \[\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/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 \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. *-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 \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-sqrt34.9%

      \[\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-unprod67.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{\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-neg67.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{\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-unprod40.1%

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

      \[\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-def79.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/79.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. *-commutative79.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-rr79.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. Taylor expanded in eh around -inf 98.8%

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

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

      \[\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 \left(-eh\right)}\right| \]
  8. Simplified98.8%

    \[\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 \left(-eh\right)}\right| \]
  9. Step-by-step derivation
    1. expm1-log1p-u72.3%

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

      \[\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| \]
  10. Applied egg-rr56.8%

    \[\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)} - \sin t \cdot \left(-eh\right)\right| \]
  11. Step-by-step derivation
    1. expm1-def73.6%

      \[\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)} - \sin t \cdot \left(-eh\right)\right| \]
    2. expm1-log1p98.8%

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

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

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

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

Alternative 5: 83.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.7 \cdot 10^{+116} \lor \neg \left(eh \leq 9.2 \cdot 10^{-131}\right):\\
\;\;\;\;\left|ew - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.70000000000000011e116 or 9.20000000000000087e-131 < 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. expm1-log1p-u78.8%

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

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

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

        \[\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-/l*99.8%

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

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

      \[\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| \]
    10. Step-by-step derivation
      1. mul-1-neg93.3%

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

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

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

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

    if -1.70000000000000011e116 < eh < 9.20000000000000087e-131

    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-cube-cbrt98.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)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
      2. pow398.3%

        \[\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}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    5. Applied egg-rr98.3%

      \[\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}} - 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. sin-mult85.8%

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

        \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    7. Applied egg-rr85.5%

      \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    8. Step-by-step derivation
      1. +-inverses85.5%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.0% accurate, 2.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7e12 or 1.05e-10 < 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. add-cube-cbrt98.8%

        \[\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)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
      2. pow398.8%

        \[\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}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    5. Applied egg-rr98.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}} - 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. sin-mult57.5%

        \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - 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/57.5%

        \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    7. Applied egg-rr56.0%

      \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
    8. Step-by-step derivation
      1. +-inverses56.0%

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

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

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

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

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

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

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

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

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

    if -7e12 < t < 1.05e-10

    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. expm1-log1p-u72.0%

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

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

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

        \[\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/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.5% 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. add-cube-cbrt98.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)} \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)}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
    2. pow398.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)}\right)}^{3}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
  5. Applied egg-rr98.7%

    \[\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}} - 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. sin-mult66.2%

      \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - 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/66.2%

      \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
  7. Applied egg-rr64.1%

    \[\leadsto \left|{\left(\sqrt[3]{ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right)}^{3} - \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| \]
  8. Step-by-step derivation
    1. +-inverses64.1%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 43.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. expm1-log1p-u72.3%

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

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

      \[\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-/l*99.8%

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - 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}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right| \]
  8. Taylor expanded in t around 0 78.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| \]
  9. Taylor expanded in t around 0 58.2%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  13. Final simplification45.7%

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

Reproduce

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