Example 2 from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{-ew} \cdot \tan t\right)\\ \left|\cos t \cdot \left(ew \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 (- (* (cos t) (* ew (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(((cos(t) * (ew * 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(((cos(t) * (ew * 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(((Math.cos(t) * (ew * 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(((math.cos(t) * (ew * 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(cos(t) * Float64(ew * 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(((cos(t) * (ew * cos(t_1))) - (eh * (sin(t) * sin(t_1)))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / (-ew)), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[(ew * 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}{-ew} \cdot \tan t\right)\\
\left|\cos t \cdot \left(ew \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. associate-*l*99.8%

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\left|\cos t \cdot \left(ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh}{-ew} \cdot \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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.1× speedup?

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

\\
\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{-ew} \cdot \tan t\right)\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

Alternative 4: 87.1% accurate, 1.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin t + \frac{ew}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\right)}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.69999999999999997e82 or 1.35e98 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999997e82 < ew < 1.35e98

    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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.7 \cdot 10^{+82} \lor \neg \left(ew \leq 1.35 \cdot 10^{+98}\right):\\ \;\;\;\;\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{-ew} \cdot \tan t\right)\right) + eh \cdot 0\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t + \frac{ew}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\right)}\right|\\ \end{array} \]

Alternative 5: 98.4% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{\color{blue}{eh \cdot \tan t}}{-ew}}} - eh \cdot 0\right| \]
    9. frac-times55.3%

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

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

      \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \color{blue}{\frac{eh \cdot \tan t}{ew} \cdot \frac{eh \cdot \tan t}{ew}}}} - eh \cdot 0\right| \]
    12. *-commutative63.3%

      \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \frac{\color{blue}{\tan t \cdot eh}}{ew} \cdot \frac{eh \cdot \tan t}{ew}}} - eh \cdot 0\right| \]
    13. associate-*r/63.3%

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

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

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

Alternative 6: 87.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.65 \cdot 10^{+82} \lor \neg \left(ew \leq 1.6 \cdot 10^{+100}\right):\\
\;\;\;\;\left|eh \cdot 0 + \frac{\cos t \cdot ew}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin t + \frac{ew}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\right)}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.6499999999999999e82 or 1.5999999999999999e100 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \frac{eh \cdot \tan t}{-ew} \cdot \frac{\color{blue}{eh \cdot \tan t}}{-ew}}} - eh \cdot 0\right| \]
      9. frac-times83.4%

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

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

        \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \color{blue}{\frac{eh \cdot \tan t}{ew} \cdot \frac{eh \cdot \tan t}{ew}}}} - eh \cdot 0\right| \]
      12. *-commutative94.4%

        \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{1 \cdot 1 + \frac{\color{blue}{\tan t \cdot eh}}{ew} \cdot \frac{eh \cdot \tan t}{ew}}} - eh \cdot 0\right| \]
      13. associate-*r/94.4%

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

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

    if -1.6499999999999999e82 < ew < 1.5999999999999999e100

    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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.65 \cdot 10^{+82} \lor \neg \left(ew \leq 1.6 \cdot 10^{+100}\right):\\ \;\;\;\;\left|eh \cdot 0 + \frac{\cos t \cdot ew}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t + \frac{ew}{\mathsf{hypot}\left(1, \frac{eh}{\frac{ew}{\tan t}}\right)}\right|\\ \end{array} \]

Alternative 7: 42.4% accurate, 2.2× speedup?

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

\\
\left|eh \cdot 0 + ew \cdot \cos \tan^{-1} \left(\frac{eh}{ew} \cdot \left(-\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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 54.8% accurate, 2.2× speedup?

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

\\
\left|t \cdot eh + ew \cdot \cos \tan^{-1} \left(\frac{eh}{ew} \cdot \left(-\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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 78.2% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.4% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 41.2% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 42.0% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\frac{ew}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}} - eh \cdot 0\right| \]
  17. Final simplification43.4%

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

Reproduce

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