Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.2s
Alternatives: 17
Speedup: 0.9×

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 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.6% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 87.2% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -7.99999999999999992e-95 or 0.0105000000000000007 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999992e-95 < eh < 0.0105000000000000007

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 45.5% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.15 \cdot 10^{+223} \lor \neg \left(eh \leq 3.4 \cdot 10^{+180}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.15000000000000002e223 or 3.39999999999999985e180 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000002e223 < eh < 3.39999999999999985e180

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.15 \cdot 10^{+223} \lor \neg \left(eh \leq 3.4 \cdot 10^{+180}\right):\\ \;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 59.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;ew \leq -6.6 \cdot 10^{-40}:\\
\;\;\;\;ew \cdot \left(-t\_1\right)\\

\mathbf{elif}\;ew \leq 3.4 \cdot 10^{-52}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -6.59999999999999986e-40

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999986e-40 < ew < 3.40000000000000017e-52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.40000000000000017e-52 < 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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -6.6 \cdot 10^{-40}:\\ \;\;\;\;ew \cdot \left(-\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\\ \mathbf{elif}\;ew \leq 3.4 \cdot 10^{-52}:\\ \;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 43.7% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\\
\mathbf{if}\;ew \leq -3.6 \cdot 10^{-203}:\\
\;\;\;\;ew \cdot \left(-t\_1\right)\\

\mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\
\;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -3.59999999999999979e-203

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.59999999999999979e-203 < ew < -2.50000000000000017e-302

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000017e-302 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -3.6 \cdot 10^{-203}:\\ \;\;\;\;ew \cdot \left(-\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\\ \mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\ \;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 79.2% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 43.5% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\
\;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -4.0000000000000001e-203

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e-203 < ew < -2.50000000000000017e-302

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000017e-302 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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}}}}\right| \]
      4. hypot-1-def37.2%

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

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

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{-eh}{ew}\right)}}\right| \]
    10. Step-by-step derivation
      1. distribute-frac-neg37.2%

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

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

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

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

        \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right| \]
    11. Simplified37.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -4 \cdot 10^{-203}:\\ \;\;\;\;ew \cdot \left(-\cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\\ \mathbf{elif}\;ew \leq -2.5 \cdot 10^{-302}:\\ \;\;\;\;\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \left(eh \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 41.8% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}}\right| \]
  12. Add Preprocessing

Alternative 14: 40.9% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 40.1% accurate, 4.4× speedup?

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

\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, 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. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{\frac{t \cdot eh}{-ew}}\right)}\right| \]
  12. Applied egg-rr37.6%

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot eh}{-ew}\right)}}\right| \]
  13. Step-by-step derivation
    1. hypot-undefine37.6%

      \[\leadsto \left|ew \cdot \frac{1}{\color{blue}{\sqrt{1 \cdot 1 + \frac{t \cdot eh}{-ew} \cdot \frac{t \cdot eh}{-ew}}}}\right| \]
    2. metadata-eval37.6%

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{\color{blue}{1} + \frac{t \cdot eh}{-ew} \cdot \frac{t \cdot eh}{-ew}}}\right| \]
    3. distribute-frac-neg237.6%

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

      \[\leadsto \left|ew \cdot \frac{1}{\sqrt{1 + \left(-\color{blue}{t \cdot \frac{eh}{ew}}\right) \cdot \frac{t \cdot eh}{-ew}}}\right| \]
    5. distribute-frac-neg237.6%

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

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

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

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

    \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}}\right| \]
  15. Add Preprocessing

Alternative 16: 21.7% accurate, 4.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{ew \cdot \cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)} \cdot \sqrt{ew \cdot \cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)}} \]
    4. rem-square-sqrt18.4%

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

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

Alternative 17: 21.4% accurate, 8.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{ew \cdot \cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)} \cdot \sqrt{ew \cdot \cos \tan^{-1} \left(t \cdot \frac{eh}{ew}\right)}} \]
    4. rem-square-sqrt18.4%

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

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

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

      \[\leadsto ew \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{t \cdot eh}{ew} \cdot \frac{t \cdot eh}{ew}}}} \]
    3. hypot-1-def18.1%

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

      \[\leadsto ew \cdot \frac{1}{\mathsf{hypot}\left(1, \color{blue}{t \cdot \frac{eh}{ew}}\right)} \]
  16. Applied egg-rr18.1%

    \[\leadsto ew \cdot \color{blue}{\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}} \]
  17. Add Preprocessing

Reproduce

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