Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 23.0s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.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.8%

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.5% accurate, 1.5× speedup?

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

\mathbf{elif}\;eh \leq 2.7 \cdot 10^{+182}:\\
\;\;\;\;\left|ew \cdot \left(\cos t + \frac{t\_1}{ew}\right)\right|\\

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


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

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

      \[\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. associate-*r*82.2%

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

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

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

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

      \[\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| \]

    if -6e192 < eh < 2.7000000000000003e182

    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. *-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt54.2%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 98.2%

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

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

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

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

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

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

    if 2.7000000000000003e182 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      \[\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| \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.5%

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

Alternative 4: 77.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -8.2 \cdot 10^{-77}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 8 \cdot 10^{-97}:\\ \;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right)\right|\\ \mathbf{elif}\;ew \leq 2.1 \cdot 10^{+138}:\\ \;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{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 -8.2e-77)
     t_1
     (if (<= ew 8e-97)
       (fabs (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) (- ew)))))))
       (if (<= ew 2.1e+138)
         (*
          ew
          (+
           (cos t)
           (* eh (/ (* (sin t) (sin (atan (* eh (/ (tan t) ew))))) ew))))
         t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((ew * cos(t)));
	double tmp;
	if (ew <= -8.2e-77) {
		tmp = t_1;
	} else if (ew <= 8e-97) {
		tmp = fabs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))));
	} else if (ew <= 2.1e+138) {
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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 <= (-8.2d-77)) then
        tmp = t_1
    else if (ew <= 8d-97) then
        tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))))
    else if (ew <= 2.1d+138) then
        tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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 <= -8.2e-77) {
		tmp = t_1;
	} else if (ew <= 8e-97) {
		tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew))))));
	} else if (ew <= 2.1e+138) {
		tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / 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 <= -8.2e-77:
		tmp = t_1
	elif ew <= 8e-97:
		tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / -ew))))))
	elif ew <= 2.1e+138:
		tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / 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 <= -8.2e-77)
		tmp = t_1;
	elseif (ew <= 8e-97)
		tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))))));
	elseif (ew <= 2.1e+138)
		tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / 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 <= -8.2e-77)
		tmp = t_1;
	elseif (ew <= 8e-97)
		tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / -ew))))));
	elseif (ew <= 2.1e+138)
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / 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, -8.2e-77], t$95$1, If[LessEqual[ew, 8e-97], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.1e+138], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $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 -8.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -8.19999999999999925e-77 or 2.10000000000000007e138 < 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. *-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt59.3%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.7%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 86.7%

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

    if -8.19999999999999925e-77 < ew < 8.00000000000000029e-97

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      \[\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| \]

    if 8.00000000000000029e-97 < ew < 2.10000000000000007e138

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)} - \color{blue}{\sqrt[3]{{\sin t}^{3} \cdot {eh}^{3}}} \cdot \left(-\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right) \]
    10. Taylor expanded in ew around inf 76.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)} \]
    11. Step-by-step derivation
      1. associate-/l*76.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. associate-*r/76.7%

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

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

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

Alternative 5: 74.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
t_2 := \left|t\_1 \cdot \left(eh \cdot \sin t\right)\right|\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+240}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -0.0016:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

\mathbf{elif}\;t \leq 0.01:\\
\;\;\;\;\left|ew + t\_1 \cdot \left(eh \cdot t\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.2e240 or 0.0100000000000000002 < t

    1. Initial program 99.4%

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

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

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

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

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

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

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

      \[\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 59.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| \]
    6. Step-by-step derivation
      1. associate-*r*59.4%

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

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

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

        \[\leadsto \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}\right| \]
    7. Simplified59.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| \]

    if -6.2e240 < t < -0.00160000000000000008

    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. *-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.2%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.2%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.2%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt52.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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, eh \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| \]
    7. Taylor expanded in ew around inf 69.6%

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

    if -0.00160000000000000008 < t < 0.0100000000000000002

    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. Step-by-step derivation
      1. fabs-sub100.0%

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt52.8%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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-rr100.0%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in t around 0 98.4%

      \[\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| \]
    8. Step-by-step derivation
      1. associate-*r*98.4%

        \[\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| \]
      2. mul-1-neg98.4%

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

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

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

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

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

Alternative 6: 73.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+251}:\\
\;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\

\mathbf{elif}\;t \leq -0.0016 \lor \neg \left(t \leq 0.00125\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.0000000000000001e251

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e251 < t < -0.00160000000000000008 or 0.00125000000000000003 < t

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.1%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.1%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.1%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt55.7%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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, eh \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| \]
    7. Taylor expanded in ew around inf 56.2%

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

    if -0.00160000000000000008 < t < 0.00125000000000000003

    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. Step-by-step derivation
      1. fabs-sub100.0%

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def100.0%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt52.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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-rr100.0%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in t around 0 98.9%

      \[\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| \]
    8. Step-by-step derivation
      1. associate-*r*98.9%

        \[\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| \]
      2. mul-1-neg98.9%

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

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

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

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

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

Alternative 7: 68.5% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -8 \cdot 10^{-81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq -7.8 \cdot 10^{-294}:\\ \;\;\;\;eh \cdot \left(\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(-\sin t\right)\right)\\ \mathbf{elif}\;ew \leq 5.2 \cdot 10^{-95}:\\ \;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* ew (cos t)))))
   (if (<= ew -8e-81)
     t_1
     (if (<= ew -7.8e-294)
       (* eh (* (sin (atan (* eh (/ (tan t) ew)))) (- (sin t))))
       (if (<= ew 5.2e-95)
         (* eh (* (sin t) (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 <= -8e-81) {
		tmp = t_1;
	} else if (ew <= -7.8e-294) {
		tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t));
	} else if (ew <= 5.2e-95) {
		tmp = eh * (sin(t) * 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 <= (-8d-81)) then
        tmp = t_1
    else if (ew <= (-7.8d-294)) then
        tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t))
    else if (ew <= 5.2d-95) then
        tmp = eh * (sin(t) * 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 <= -8e-81) {
		tmp = t_1;
	} else if (ew <= -7.8e-294) {
		tmp = eh * (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * -Math.sin(t));
	} else if (ew <= 5.2e-95) {
		tmp = eh * (Math.sin(t) * 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 <= -8e-81:
		tmp = t_1
	elif ew <= -7.8e-294:
		tmp = eh * (math.sin(math.atan((eh * (math.tan(t) / ew)))) * -math.sin(t))
	elif ew <= 5.2e-95:
		tmp = eh * (math.sin(t) * 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 <= -8e-81)
		tmp = t_1;
	elseif (ew <= -7.8e-294)
		tmp = Float64(eh * Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(-sin(t))));
	elseif (ew <= 5.2e-95)
		tmp = Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * 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 <= -8e-81)
		tmp = t_1;
	elseif (ew <= -7.8e-294)
		tmp = eh * (sin(atan((eh * (tan(t) / ew)))) * -sin(t));
	elseif (ew <= 5.2e-95)
		tmp = eh * (sin(t) * 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, -8e-81], t$95$1, If[LessEqual[ew, -7.8e-294], N[(eh * N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[ew, 5.2e-95], N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $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 -8 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -7.9999999999999997e-81 or 5.20000000000000001e-95 < ew

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt56.3%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 79.5%

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

    if -7.9999999999999997e-81 < ew < -7.8000000000000005e-294

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8000000000000005e-294 < ew < 5.20000000000000001e-95

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.0% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6 \cdot 10^{+176} \lor \neg \left(eh \leq 1.5 \cdot 10^{+200}\right):\\
\;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -6e176 or 1.49999999999999995e200 < eh

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

    if -6e176 < eh < 1.49999999999999995e200

    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. *-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt52.3%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 69.8%

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

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

Alternative 9: 65.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{-306} \lor \neg \left(ew \leq 6.5 \cdot 10^{-89}\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 -2.2e-306) (not (<= ew 6.5e-89)))
   (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 <= -2.2e-306) || !(ew <= 6.5e-89)) {
		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 <= (-2.2d-306)) .or. (.not. (ew <= 6.5d-89))) 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 <= -2.2e-306) || !(ew <= 6.5e-89)) {
		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 <= -2.2e-306) or not (ew <= 6.5e-89):
		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 <= -2.2e-306) || !(ew <= 6.5e-89))
		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 <= -2.2e-306) || ~((ew <= 6.5e-89)))
		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, -2.2e-306], N[Not[LessEqual[ew, 6.5e-89]], $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 -2.2 \cdot 10^{-306} \lor \neg \left(ew \leq 6.5 \cdot 10^{-89}\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 < -2.20000000000000016e-306 or 6.50000000000000034e-89 < ew

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt53.4%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 69.3%

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

    if -2.20000000000000016e-306 < ew < 6.50000000000000034e-89

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{-306} \lor \neg \left(ew \leq 6.5 \cdot 10^{-89}\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 10: 61.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 1.65 \cdot 10^{+245}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;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 (<= eh 1.65e+245)
   (fabs (* ew (cos t)))
   (* eh (* t (sin (atan (/ (* eh (tan t)) ew)))))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 1.65e+245) {
		tmp = fabs((ew * cos(t)));
	} else {
		tmp = 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 (eh <= 1.65d+245) then
        tmp = abs((ew * cos(t)))
    else
        tmp = 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 (eh <= 1.65e+245) {
		tmp = Math.abs((ew * Math.cos(t)));
	} else {
		tmp = eh * (t * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if eh <= 1.65e+245:
		tmp = math.fabs((ew * math.cos(t)))
	else:
		tmp = eh * (t * math.sin(math.atan(((eh * math.tan(t)) / ew))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= 1.65e+245)
		tmp = abs(Float64(ew * cos(t)));
	else
		tmp = 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 (eh <= 1.65e+245)
		tmp = abs((ew * cos(t)));
	else
		tmp = eh * (t * sin(atan(((eh * tan(t)) / ew))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[eh, 1.65e+245], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;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 eh < 1.65000000000000005e245

    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.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. *-commutative99.8%

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt56.1%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in ew around inf 61.7%

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

    if 1.65000000000000005e245 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{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. Add Preprocessing

Alternative 11: 61.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.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.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. *-commutative99.8%

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
    8. cos-atan99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
    10. hypot-1-def99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
    11. add-sqr-sqrt53.7%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

    \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
  7. Taylor expanded in ew around inf 59.3%

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

Alternative 12: 47.9% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.003 \lor \neg \left(t \leq 3.8 \cdot 10^{+33}\right):\\
\;\;\;\;ew \cdot \cos t\\

\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0030000000000000001 or 3.80000000000000002e33 < t

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\sqrt[3]{ew \cdot \cos t}\right)}}^{3} \]
    7. Step-by-step derivation
      1. rem-cube-cbrt32.0%

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      2. *-commutative32.0%

        \[\leadsto \color{blue}{\cos t \cdot ew} \]
    8. Applied egg-rr32.0%

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

    if -0.0030000000000000001 < t < 3.80000000000000002e33

    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. Step-by-step derivation
      1. fabs-sub100.0%

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

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

        \[\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*100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
      8. cos-atan99.9%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.9%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
      10. hypot-1-def99.9%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
      11. add-sqr-sqrt53.4%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.9%

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
    7. Taylor expanded in t around 0 62.1%

      \[\leadsto \left|\color{blue}{ew}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.4%

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

Alternative 13: 41.8% 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.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.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. *-commutative99.8%

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \cos \tan^{-1} \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| \]
    8. cos-atan99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\cos t \cdot \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)}}}\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. un-div-inv99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{\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| \]
    10. hypot-1-def99.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\color{blue}{\mathsf{hypot}\left(1, \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| \]
    11. add-sqr-sqrt53.7%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-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.5%

    \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, eh \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| \]
  7. Taylor expanded in t around 0 38.4%

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

Alternative 14: 22.0% accurate, 921.0× speedup?

\[\begin{array}{l} \\ ew \end{array} \]
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
	return ew;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew
end function
public static double code(double eh, double ew, double t) {
	return ew;
}
def code(eh, ew, t):
	return ew
function code(eh, ew, t)
	return ew
end
function tmp = code(eh, ew, t)
	tmp = ew;
end
code[eh_, ew_, t_] := ew
\begin{array}{l}

\\
ew
\end{array}
Derivation
  1. Initial program 99.7%

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

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

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

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

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

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

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

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

    \[\leadsto {\color{blue}{\left(\sqrt[3]{ew}\right)}}^{3} \]
  7. Step-by-step derivation
    1. rem-cube-cbrt19.9%

      \[\leadsto \color{blue}{ew} \]
    2. *-un-lft-identity19.9%

      \[\leadsto \color{blue}{1 \cdot ew} \]
  8. Applied egg-rr19.9%

    \[\leadsto \color{blue}{1 \cdot ew} \]
  9. Final simplification19.9%

    \[\leadsto ew \]
  10. Add Preprocessing

Reproduce

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