Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 22.3s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{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(eh * Float64(-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{eh \cdot \left(-\tan t\right)}{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}
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. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 2: 99.7% accurate, 1.1× speedup?

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\sqrt[3]{{\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)}^{3}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  5. Step-by-step derivation
    1. rem-cbrt-cube99.8%

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

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

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

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

Alternative 3: 94.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;eh \leq -2.7 \cdot 10^{-140} \lor \neg \left(eh \leq 1.95 \cdot 10^{-138}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) + \frac{t\_1}{eh}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -2.7e-140 or 1.95e-138 < 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. Step-by-step derivation
      1. add-sqr-sqrt30.5%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.2%

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

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

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

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

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

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

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

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

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

    if -2.7e-140 < eh < 1.95e-138

    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. Step-by-step derivation
      1. add-sqr-sqrt21.9%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.2%

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 1.5× speedup?

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\sqrt[3]{{\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)}^{3}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  5. Step-by-step derivation
    1. rem-cbrt-cube99.8%

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

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

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

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

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

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

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

Alternative 5: 77.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -8.8 \cdot 10^{-110}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;ew \leq 8.6 \cdot 10^{-186}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-t\_1\right)\right|\\

\mathbf{elif}\;ew \leq 5.8 \cdot 10^{+64}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} t\_1}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -8.7999999999999997e-110 or 5.79999999999999986e64 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt24.6%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.2%

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

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

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

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

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

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

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

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

    if -8.7999999999999997e-110 < ew < 8.5999999999999998e-186

    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. fabs-sub99.7%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt41.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{-\cos t} \cdot \sqrt{-\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| \]
      2. sqrt-unprod99.0%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5999999999999998e-186 < ew < 5.79999999999999986e64

    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. Add Preprocessing
    3. Applied egg-rr81.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -8.8 \cdot 10^{-110}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;ew \leq 8.6 \cdot 10^{-186}:\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\tan t \cdot \frac{eh}{ew}\right)\right|\\ \mathbf{elif}\;ew \leq 5.8 \cdot 10^{+64}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -3.5 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -3.49999999999999974e-110 or 1.01999999999999997e-10 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt23.3%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.3%

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

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

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

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

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

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

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

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

    if -3.49999999999999974e-110 < ew < 4.4000000000000002e-166

    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. fabs-sub99.7%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt39.8%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4000000000000002e-166 < ew < 1.01999999999999997e-10

    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. Add Preprocessing
    3. Applied egg-rr79.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -3.5 \cdot 10^{-110}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;ew \leq 4.4 \cdot 10^{-166}:\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\tan t \cdot \frac{eh}{ew}\right)\right|\\ \mathbf{elif}\;ew \leq 1.02 \cdot 10^{-10}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -7.5 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;ew \leq 1.35 \cdot 10^{-7}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -7.50000000000000038e-115 or 1.35000000000000004e-7 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt23.3%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.3%

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

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

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

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

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

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

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

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

    if -7.50000000000000038e-115 < ew < 4.59999999999999997e-166

    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. fabs-sub99.7%

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

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

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

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

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

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

      \[\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 ew around 0 78.2%

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999997e-166 < ew < 1.35000000000000004e-7

    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. Add Preprocessing
    3. Applied egg-rr79.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -7.5 \cdot 10^{-115}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;ew \leq 4.6 \cdot 10^{-166}:\\ \;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(-\tan t \cdot \frac{eh}{ew}\right)\right)\right|\\ \mathbf{elif}\;ew \leq 1.35 \cdot 10^{-7}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)}{ew}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.4% accurate, 2.2× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.00309999999999999989 or 3.60000000000000023e-4 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt55.9%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.3%

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

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

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

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

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

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

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

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

    if -0.00309999999999999989 < t < 3.60000000000000023e-4

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -1.25 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -1.25000000000000004e-118 or 2.1000000000000001e-43 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt25.0%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.3%

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

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

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

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

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

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

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

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

    if -1.25000000000000004e-118 < ew < 2.49999999999999989e-234

    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. Add Preprocessing
    3. Applied egg-rr53.5%

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

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

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

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

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

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

    if 2.49999999999999989e-234 < ew < 2.1000000000000001e-43

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Add Preprocessing
    3. Applied egg-rr79.8%

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

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

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

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

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

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

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

Alternative 10: 65.4% accurate, 2.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -4.999999999999985e-310 or 3.8000000000000001e-44 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt29.3%

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{-\cos t} \cdot \sqrt{-\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| \]
      2. sqrt-unprod99.4%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.4%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < ew < 3.8000000000000001e-44

    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. Add Preprocessing
    3. Applied egg-rr74.4%

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

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

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

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

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

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

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

Alternative 11: 65.4% accurate, 2.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -4.999999999999985e-310 or 1.7499999999999999e-44 < 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. 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. Step-by-step derivation
      1. add-sqr-sqrt29.3%

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{-\cos t} \cdot \sqrt{-\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| \]
      2. sqrt-unprod99.4%

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.4%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < ew < 1.7499999999999999e-44

    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. Add Preprocessing
    3. Applied egg-rr74.4%

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

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

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

Alternative 12: 63.5% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 1.5 \cdot 10^{+169}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 1.5e169

    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. Step-by-step derivation
      1. add-sqr-sqrt28.7%

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
      5. add-sqr-sqrt99.1%

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

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

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

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

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

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

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

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

    if 1.5e169 < 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. Add Preprocessing
    3. Taylor expanded in t around 0 60.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\frac{eh}{ew} \cdot \left(-\tan t\right)\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. distribute-lft-neg-in60.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 62.6% accurate, 4.5× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. fabs-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. Step-by-step derivation
    1. add-sqr-sqrt27.9%

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
    5. add-sqr-sqrt99.2%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
  8. Add Preprocessing

Alternative 14: 43.5% accurate, 9.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. fabs-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. Step-by-step derivation
    1. add-sqr-sqrt27.9%

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \color{blue}{\left(\sqrt{\cos t} \cdot \sqrt{\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| \]
    5. add-sqr-sqrt99.2%

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  8. Add Preprocessing

Alternative 15: 20.3% accurate, 102.3× speedup?

\[\begin{array}{l} \\ ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right) \end{array} \]
(FPCore (eh ew t) :precision binary64 (+ ew (* -0.5 (* ew (* t t)))))
double code(double eh, double ew, double t) {
	return ew + (-0.5 * (ew * (t * t)));
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew + ((-0.5d0) * (ew * (t * t)))
end function
public static double code(double eh, double ew, double t) {
	return ew + (-0.5 * (ew * (t * t)));
}
def code(eh, ew, t):
	return ew + (-0.5 * (ew * (t * t)))
function code(eh, ew, t)
	return Float64(ew + Float64(-0.5 * Float64(ew * Float64(t * t))))
end
function tmp = code(eh, ew, t)
	tmp = ew + (-0.5 * (ew * (t * t)));
end
code[eh_, ew_, t_] := N[(ew + N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
ew + -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Applied egg-rr52.3%

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

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

    \[\leadsto ew + \color{blue}{-0.5 \cdot \left(ew \cdot {t}^{2}\right)} \]
  6. Step-by-step derivation
    1. unpow219.8%

      \[\leadsto ew + -0.5 \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right) \]
  7. Applied egg-rr19.8%

    \[\leadsto ew + -0.5 \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right) \]
  8. Add Preprocessing

Reproduce

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