Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.5s
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} \\ \left|\log \left(e^{\frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \tan t\right)}}\right) \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (log (exp (/ 1.0 (hypot 1.0 (* (/ eh ew) (tan t)))))) (* ew (cos t)))
   (* (* eh (sin t)) (sin (atan (/ (* eh (- (tan t))) ew)))))))
double code(double eh, double ew, double t) {
	return fabs(((log(exp((1.0 / hypot(1.0, ((eh / ew) * tan(t)))))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs(((Math.log(Math.exp((1.0 / Math.hypot(1.0, ((eh / ew) * Math.tan(t)))))) * (ew * Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * -Math.tan(t)) / ew))))));
}
def code(eh, ew, t):
	return math.fabs(((math.log(math.exp((1.0 / math.hypot(1.0, ((eh / ew) * math.tan(t)))))) * (ew * math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((eh * -math.tan(t)) / ew))))))
function code(eh, ew, t)
	return abs(Float64(Float64(log(exp(Float64(1.0 / hypot(1.0, Float64(Float64(eh / ew) * tan(t)))))) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * Float64(-tan(t))) / ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs(((log(exp((1.0 / hypot(1.0, ((eh / ew) * tan(t)))))) * (ew * cos(t))) - ((eh * sin(t)) * sin(atan(((eh * -tan(t)) / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Log[N[Exp[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * (-N[Tan[t], $MachinePrecision])), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\log \left(e^{\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| \]
    2. associate-/l*99.8%

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\log \left(e^{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot \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. Step-by-step derivation
    1. cos-atan99.8%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \log \left(e^{\frac{1}{\color{blue}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \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. Applied egg-rr99.8%

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \log \left(e^{\color{blue}{\frac{1}{\mathsf{hypot}\left(1, \frac{eh}{ew} \cdot \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. Final simplification99.8%

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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. Final simplification99.8%

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

Alternative 3: 98.9% accurate, 1.3× speedup?

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 1.5× speedup?

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.7%

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

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

Alternative 5: 98.0% accurate, 1.5× speedup?

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.7%

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot 1 - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\log \left(e^{\left(-eh\right) \cdot \tan t}\right)}}{ew}\right)\right| \]
    2. *-un-lft-identity88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.5 \cdot 10^{+96} \lor \neg \left(ew \leq 4.4 \cdot 10^{+77}\right):\\
\;\;\;\;\left|ew \cdot \cos t - \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) \cdot \left(t \cdot eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.5e96 or 4.4000000000000001e77 < ew

    1. Initial program 99.7%

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
      2. hypot-1-def39.3%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.9%

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

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

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

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

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

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

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

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

    if -1.5e96 < ew < 4.4000000000000001e77

    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 88.1%

      \[\leadsto \left|\color{blue}{ew} \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| \]
    3. Step-by-step derivation
      1. sin-atan53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.14 \cdot 10^{+95} \lor \neg \left(ew \leq 4.05 \cdot 10^{+77}\right):\\
\;\;\;\;\left|ew \cdot \cos t - \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) \cdot \left(t \cdot eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.14e95 or 4.04999999999999976e77 < ew

    1. Initial program 99.7%

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
      2. hypot-1-def39.3%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.9%

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

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

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

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

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

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

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

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

    if -1.14e95 < ew < 4.04999999999999976e77

    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 88.1%

      \[\leadsto \left|\color{blue}{ew} \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| \]
    3. Step-by-step derivation
      1. sin-atan53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \left|ew \cdot \cos t - \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)) (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew)))))))
double code(double eh, double ew, double t) {
	return fabs(((ew * cos(t)) - ((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)) - ((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)) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * -eh) / ew))))));
}
def code(eh, ew, t):
	return math.fabs(((ew * math.cos(t)) - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew))))))
function code(eh, ew, t)
	return abs(Float64(Float64(ew * cos(t)) - 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)) - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Cos[t], $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|ew \cdot \cos t - \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. Step-by-step derivation
    1. cos-atan31.7%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.7%

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

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

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

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

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

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

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

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

Alternative 9: 97.8% accurate, 1.8× speedup?

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 83.4% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\\
\mathbf{if}\;ew \leq -3.6 \cdot 10^{+95} \lor \neg \left(ew \leq 7.2 \cdot 10^{+76}\right):\\
\;\;\;\;\left|ew \cdot \cos t - t_1 \cdot \left(t \cdot eh\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot t_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.59999999999999978e95 or 7.2000000000000006e76 < ew

    1. Initial program 99.7%

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

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
      2. hypot-1-def39.3%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.9%

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

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

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

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

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

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

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

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

    if -3.59999999999999978e95 < ew < 7.2000000000000006e76

    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. cos-atan27.3%

        \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
      2. hypot-1-def27.3%

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.5%

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

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

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

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

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

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

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

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

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

Alternative 11: 78.3% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \left|ew - \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 (* (* eh (sin t)) (sin (atan (/ (* t (- eh)) ew)))))))
double code(double eh, double ew, double t) {
	return fabs((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 - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))))
end function
public static double code(double eh, double ew, double t) {
	return Math.abs((ew - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * -eh) / ew))))));
}
def code(eh, ew, t):
	return math.fabs((ew - ((eh * math.sin(t)) * math.sin(math.atan(((t * -eh) / ew))))))
function code(eh, ew, t)
	return abs(Float64(ew - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * Float64(-eh)) / ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((ew - ((eh * sin(t)) * sin(atan(((t * -eh) / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(ew - 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|ew - \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. Step-by-step derivation
    1. cos-atan31.7%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

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

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \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 eh around 0 98.7%

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

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

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

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

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

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

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

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

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

Alternative 12: 34.6% accurate, 2.9× speedup?

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

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

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

    \[\leadsto \left|\color{blue}{ew} \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| \]
  3. Step-by-step derivation
    1. sin-atan55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
    2. hypot-1-def31.7%

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\color{blue}{eh}}{ew} \cdot \tan t\right)} - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\right| \]
  11. Applied egg-rr31.7%

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

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

Alternative 13: 34.5% accurate, 2.9× speedup?

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

\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) - \frac{t \cdot t}{\frac{ew}{eh \cdot eh}}\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 77.7%

    \[\leadsto \left|\color{blue}{ew} \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| \]
  3. Step-by-step derivation
    1. sin-atan55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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