Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.4s
Alternatives: 13
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{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. Taylor expanded in t around 0 98.9%

    \[\leadsto \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} \color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}\right| \]
  3. Step-by-step derivation
    1. associate-*r/59.5%

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

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

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

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

    \[\leadsto \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} \color{blue}{\left(\frac{\left(-t\right) \cdot eh}{ew}\right)}\right| \]
  5. Final simplification98.9%

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

Alternative 5: 85.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;eh \leq 42000000000:\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\sqrt[3]{{\left(\tan t \cdot eh\right)}^{3}}}{ew}\right)\right|\\

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


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

    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. distribute-lft-neg-out99.8%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{-eh \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. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

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

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

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

    if -1.28000000000000006e50 < eh < 4.2e10

    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. Applied egg-rr87.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
    3. Step-by-step derivation
      1. +-inverses87.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
      3. associate-/l*87.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}{\frac{0}{\frac{2}{eh}}}\right| \]
      4. div087.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}{0}\right| \]
    4. Simplified87.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}{0}\right| \]
    5. Step-by-step derivation
      1. add-cbrt-cube87.8%

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

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

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

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

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

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

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

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

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

    if 4.2e10 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Taylor expanded in eh around 0 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(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.28 \cdot 10^{+50}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right)\right|\\ \mathbf{elif}\;eh \leq 42000000000:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\sqrt[3]{{\left(\tan t \cdot eh\right)}^{3}}}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\ \end{array} \]

Alternative 6: 85.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.75 \cdot 10^{+50} \lor \neg \left(eh \leq 126000000000\right):\\
\;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.75e50 or 1.26e11 < eh

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Taylor expanded in eh around 0 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(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.75e50 < eh < 1.26e11

    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. Applied egg-rr87.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
    3. Step-by-step derivation
      1. +-inverses87.8%

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

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
      3. associate-/l*87.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}{\frac{0}{\frac{2}{eh}}}\right| \]
      4. div087.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}{0}\right| \]
    4. Simplified87.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}{0}\right| \]
    5. Step-by-step derivation
      1. add-cbrt-cube87.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -3.75 \cdot 10^{+50} \lor \neg \left(eh \leq 126000000000\right):\\ \;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)} - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\sqrt[3]{{\left(\tan t \cdot eh\right)}^{3}}}{ew}\right)\right|\\ \end{array} \]

Alternative 7: 62.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \left|\left(ew \cdot \cos t\right) \cdot {\left(\sqrt[3]{\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)}\right)}^{3}\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs (* (* ew (cos t)) (pow (cbrt (cos (atan (* (tan t) (/ eh ew))))) 3.0))))
double code(double eh, double ew, double t) {
	return fabs(((ew * cos(t)) * pow(cbrt(cos(atan((tan(t) * (eh / ew))))), 3.0)));
}
public static double code(double eh, double ew, double t) {
	return Math.abs(((ew * Math.cos(t)) * Math.pow(Math.cbrt(Math.cos(Math.atan((Math.tan(t) * (eh / ew))))), 3.0)));
}
function code(eh, ew, t)
	return abs(Float64(Float64(ew * cos(t)) * (cbrt(cos(atan(Float64(tan(t) * Float64(eh / ew))))) ^ 3.0)))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Cos[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\left(ew \cdot \cos t\right) \cdot {\left(\sqrt[3]{\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)}\right)}^{3}\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. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Step-by-step derivation
    1. add-cube-cbrt68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 62.0% accurate, 1.3× speedup?

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

\\
\left|\left(ew \cdot \cos t\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\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. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Step-by-step derivation
    1. expm1-log1p-u68.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.0% accurate, 1.8× speedup?

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

\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot 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. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Step-by-step derivation
    1. expm1-log1p-u61.7%

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{e^{\mathsf{log1p}\left(\color{blue}{\tan t \cdot \left(-eh\right)}\right)} - 1}{ew}\right) - 0\right| \]
    4. add-sqr-sqrt28.6%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{e^{\mathsf{log1p}\left(\tan t \cdot \color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}\right)} - 1}{ew}\right) - 0\right| \]
    6. sqr-neg56.5%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{e^{\mathsf{log1p}\left(\tan t \cdot \color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)}\right)} - 1}{ew}\right) - 0\right| \]
    8. add-sqr-sqrt63.3%

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

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

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

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

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

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

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

Alternative 10: 52.5% accurate, 2.2× speedup?

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

\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{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. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Taylor expanded in t around 0 59.5%

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

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

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

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

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

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

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

Alternative 11: 61.6% accurate, 2.2× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Step-by-step derivation
    1. expm1-log1p-u68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 61.7% accurate, 2.2× speedup?

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Step-by-step derivation
    1. expm1-log1p-u68.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\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)}}} - 0\right| \]
    3. un-div-inv68.5%

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

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

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

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

Alternative 13: 42.1% accurate, 9.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Applied egg-rr68.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}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right| \]
  3. Step-by-step derivation
    1. +-inverses68.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \frac{\color{blue}{0 \cdot eh}}{2}\right| \]
    3. associate-/l*68.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}{\frac{0}{\frac{2}{eh}}}\right| \]
    4. div068.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}{0}\right| \]
  4. Simplified68.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}{0}\right| \]
  5. Taylor expanded in t around 0 47.1%

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

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

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

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

    \[\leadsto \left|\color{blue}{ew} - 0\right| \]
  9. Final simplification47.3%

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

Reproduce

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