Example 2 from Robby

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\cos t\_1 \cdot \left(ew \cdot \cos t\right) - \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 (- (* (cos t_1) (* ew (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(((cos(t_1) * (ew * cos(t))) - ((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(((cos(t_1) * (ew * cos(t))) - ((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(((Math.cos(t_1) * (ew * Math.cos(t))) - ((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(((math.cos(t_1) * (ew * math.cos(t))) - ((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(cos(t_1) * Float64(ew * cos(t))) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs(((cos(t_1) * (ew * cos(t))) - ((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[Cos[t$95$1], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $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|\cos t\_1 \cdot \left(ew \cdot \cos t\right) - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

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

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

Alternative 2: 97.9% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. 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. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. 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. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -6.8 \cdot 10^{-107} \lor \neg \left(ew \leq 4.9 \cdot 10^{-185}\right):\\ \;\;\;\;\left|ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, 1, eh \cdot \left(\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t\right)\right)\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -6.8e-107) (not (<= ew 4.9e-185)))
   (fabs
    (*
     ew
     (+
      (cos t)
      (* eh (/ (* (sin t) (sin (atan (* (tan t) (/ (- eh) ew))))) ew)))))
   (fabs
    (fma
     ew
     1.0
     (*
      eh
      (* (sin (atan (* eh (/ (tan t) (- ew))))) (log1p (expm1 (sin t)))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -6.8e-107) || !(ew <= 4.9e-185)) {
		tmp = fabs((ew * (cos(t) + (eh * ((sin(t) * sin(atan((tan(t) * (-eh / ew))))) / ew)))));
	} else {
		tmp = fabs(fma(ew, 1.0, (eh * (sin(atan((eh * (tan(t) / -ew)))) * log1p(expm1(sin(t)))))));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -6.8e-107) || !(ew <= 4.9e-185))
		tmp = abs(Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(Float64(-eh) / ew))))) / ew)))));
	else
		tmp = abs(fma(ew, 1.0, Float64(eh * Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) * log1p(expm1(sin(t)))))));
	end
	return tmp
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -6.8e-107], N[Not[LessEqual[ew, 4.9e-185]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * 1.0 + N[(eh * N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Log[1 + N[(Exp[N[Sin[t], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -6.8 \cdot 10^{-107} \lor \neg \left(ew \leq 4.9 \cdot 10^{-185}\right):\\
\;\;\;\;\left|ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)}{ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -6.79999999999999989e-107 or 4.9000000000000003e-185 < 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. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\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-/l*97.1%

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

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

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

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

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

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

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

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

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

    if -6.79999999999999989e-107 < ew < 4.9000000000000003e-185

    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. associate-*r/99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -6.8 \cdot 10^{-107} \lor \neg \left(ew \leq 4.9 \cdot 10^{-185}\right):\\ \;\;\;\;\left|ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, 1, eh \cdot \left(\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin t\right)\right)\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 91.3% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -7.0000000000000005e209

    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 91.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. *-commutative91.4%

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

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

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

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

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

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

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

    if -7.0000000000000005e209 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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-/l*93.2%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.1% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;ew \leq -9.5 \cdot 10^{-108}:\\
\;\;\;\;ew \cdot \left(\left(-\cos t\right) - t\_1\right)\\

\mathbf{elif}\;ew \leq 10^{-189}:\\
\;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin t\_2\right)\right|\\

\mathbf{elif}\;ew \leq 8.5 \cdot 10^{+66}:\\
\;\;\;\;ew \cdot \left(\cos t + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -8.5999999999999997e170 or 8.5000000000000004e66 < 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. Add Preprocessing
    3. Taylor expanded in ew around inf 85.9%

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

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

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

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

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

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

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

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

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

    if -8.5999999999999997e170 < ew < -9.5000000000000005e-108

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{0 - \mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} \]
    4. Step-by-step derivation
      1. neg-sub076.6%

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

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

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

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

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

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

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

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

        \[\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/74.1%

        \[\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) \]
    8. Simplified74.1%

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

    if -9.5000000000000005e-108 < ew < 1.00000000000000007e-189

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-189 < ew < 8.5000000000000004e66

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\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) \]
    6. Simplified74.5%

      \[\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 4 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -8.6 \cdot 10^{+170}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right) \cdot \left(ew \cdot \cos t\right)\right|\\ \mathbf{elif}\;ew \leq -9.5 \cdot 10^{-108}:\\ \;\;\;\;ew \cdot \left(\left(-\cos t\right) - eh \cdot \frac{\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}{ew}\right)\\ \mathbf{elif}\;ew \leq 10^{-189}:\\ \;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\ \mathbf{elif}\;ew \leq 8.5 \cdot 10^{+66}:\\ \;\;\;\;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|\cos \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right) \cdot \left(ew \cdot \cos t\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.1% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;t \leq -2350000:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{+147}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.0000000000000001e173 or 0.095000000000000001 < t < 4.80000000000000004e147

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000001e173 < t < -2.35e6 or 4.80000000000000004e147 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.35e6 < t < 0.095000000000000001

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0 96.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*96.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-neg96.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-*l/96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 76.1% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\\ \mathbf{if}\;ew \leq -1.35 \cdot 10^{-21}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\ \mathbf{elif}\;ew \leq 7.8 \cdot 10^{-190}:\\ \;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin t\_1\right)\right|\\ \mathbf{elif}\;ew \leq 8 \cdot 10^{+66}:\\ \;\;\;\;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|\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 (* (tan t) (/ (- eh) ew)))))
   (if (<= ew -1.35e-21)
     (fabs (fma ew (log1p (+ (exp (cos t)) -1.0)) 0.0))
     (if (<= ew 7.8e-190)
       (fabs (* (sin t) (* eh (sin t_1))))
       (if (<= ew 8e+66)
         (*
          ew
          (+
           (cos t)
           (* eh (/ (* (sin t) (sin (atan (* eh (/ (tan t) ew))))) ew))))
         (fabs (* (cos t_1) (* ew (cos t)))))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((tan(t) * (-eh / ew)));
	double tmp;
	if (ew <= -1.35e-21) {
		tmp = fabs(fma(ew, log1p((exp(cos(t)) + -1.0)), 0.0));
	} else if (ew <= 7.8e-190) {
		tmp = fabs((sin(t) * (eh * sin(t_1))));
	} else if (ew <= 8e+66) {
		tmp = ew * (cos(t) + (eh * ((sin(t) * sin(atan((eh * (tan(t) / ew))))) / ew)));
	} else {
		tmp = fabs((cos(t_1) * (ew * cos(t))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = atan(Float64(tan(t) * Float64(Float64(-eh) / ew)))
	tmp = 0.0
	if (ew <= -1.35e-21)
		tmp = abs(fma(ew, log1p(Float64(exp(cos(t)) + -1.0)), 0.0));
	elseif (ew <= 7.8e-190)
		tmp = abs(Float64(sin(t) * Float64(eh * sin(t_1))));
	elseif (ew <= 8e+66)
		tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / ew))))) / ew))));
	else
		tmp = abs(Float64(cos(t_1) * Float64(ew * cos(t))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[((-eh) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.35e-21], N[Abs[N[(ew * N[Log[1 + N[(N[Exp[N[Cos[t], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] + 0.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 7.8e-190], N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 8e+66], 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], N[Abs[N[(N[Cos[t$95$1], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\\
\mathbf{if}\;ew \leq -1.35 \cdot 10^{-21}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\

\mathbf{elif}\;ew \leq 7.8 \cdot 10^{-190}:\\
\;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin t\_1\right)\right|\\

\mathbf{elif}\;ew \leq 8 \cdot 10^{+66}:\\
\;\;\;\;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|\cos t\_1 \cdot \left(ew \cdot \cos t\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.3500000000000001e-21

    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. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right)\right| \]
    9. Step-by-step derivation
      1. +-inverses79.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \frac{eh \cdot \color{blue}{0}}{2}\right)\right| \]
      2. mul0-rgt79.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \frac{\color{blue}{0}}{2}\right)\right| \]
      3. metadata-eval79.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{0}\right)\right| \]
    10. Simplified79.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{0}\right)\right| \]

    if -1.3500000000000001e-21 < ew < 7.7999999999999999e-190

    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 78.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. *-commutative78.1%

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

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

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

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

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

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

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

    if 7.7999999999999999e-190 < ew < 7.99999999999999956e66

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\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) \]
    6. Simplified74.5%

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

    if 7.99999999999999956e66 < 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. Add Preprocessing
    3. Taylor expanded in ew around inf 83.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{-21}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\ \mathbf{elif}\;ew \leq 7.8 \cdot 10^{-190}:\\ \;\;\;\;\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right)\right)\right|\\ \mathbf{elif}\;ew \leq 8 \cdot 10^{+66}:\\ \;\;\;\;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|\cos \tan^{-1} \left(\tan t \cdot \frac{-eh}{ew}\right) \cdot \left(ew \cdot \cos t\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.0% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;t \leq -2600000:\\
\;\;\;\;eh \cdot \left(\sin t \cdot t\_2\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.00000000000000006e83 or 0.025000000000000001 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000006e83 < t < -2.6e6

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)}\right)}^{3}} \]
    4. Taylor expanded in 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.6e6 < t < 0.025000000000000001

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0 96.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*96.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-neg96.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-*l/96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 72.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\ t_2 := \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2350000:\\ \;\;\;\;eh \cdot \left(\sin t \cdot t\_2\right)\\ \mathbf{elif}\;t \leq 0.0065:\\ \;\;\;\;\left|ew + \left(t \cdot eh\right) \cdot t\_2\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (fma ew (log1p (+ (exp (cos t)) -1.0)) 0.0)))
        (t_2 (sin (atan (/ (* eh (tan t)) ew)))))
   (if (<= t -4.2e+83)
     t_1
     (if (<= t -2350000.0)
       (* eh (* (sin t) t_2))
       (if (<= t 0.0065) (fabs (+ ew (* (* t eh) t_2))) t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(fma(ew, log1p((exp(cos(t)) + -1.0)), 0.0));
	double t_2 = sin(atan(((eh * tan(t)) / ew)));
	double tmp;
	if (t <= -4.2e+83) {
		tmp = t_1;
	} else if (t <= -2350000.0) {
		tmp = eh * (sin(t) * t_2);
	} else if (t <= 0.0065) {
		tmp = fabs((ew + ((t * eh) * t_2)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = abs(fma(ew, log1p(Float64(exp(cos(t)) + -1.0)), 0.0))
	t_2 = sin(atan(Float64(Float64(eh * tan(t)) / ew)))
	tmp = 0.0
	if (t <= -4.2e+83)
		tmp = t_1;
	elseif (t <= -2350000.0)
		tmp = Float64(eh * Float64(sin(t) * t_2));
	elseif (t <= 0.0065)
		tmp = abs(Float64(ew + Float64(Float64(t * eh) * t_2)));
	else
		tmp = t_1;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Log[1 + N[(N[Exp[N[Cos[t], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] + 0.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.2e+83], t$95$1, If[LessEqual[t, -2350000.0], N[(eh * N[(N[Sin[t], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0065], N[Abs[N[(ew + N[(N[(t * eh), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\
t_2 := \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -2350000:\\
\;\;\;\;eh \cdot \left(\sin t \cdot t\_2\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.20000000000000005e83 or 0.0064999999999999997 < t

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{\frac{eh \cdot \left(\cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) - \cos \left(t + \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)\right)}{2}}\right)\right| \]
    9. Step-by-step derivation
      1. +-inverses52.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \frac{eh \cdot \color{blue}{0}}{2}\right)\right| \]
      2. mul0-rgt52.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \frac{\color{blue}{0}}{2}\right)\right| \]
      3. metadata-eval52.5%

        \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{0}\right)\right| \]
    10. Simplified52.5%

      \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} - 1\right), \color{blue}{0}\right)\right| \]

    if -4.20000000000000005e83 < t < -2.35e6

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)}\right)}^{3}} \]
    4. Taylor expanded in 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.35e6 < t < 0.0064999999999999997

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0 96.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*96.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-neg96.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-*l/96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+83}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\ \mathbf{elif}\;t \leq -2350000:\\ \;\;\;\;eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\\ \mathbf{elif}\;t \leq 0.0065:\\ \;\;\;\;\left|ew + \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(e^{\cos t} + -1\right), 0\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 62.1% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;t \leq -5400000:\\
\;\;\;\;eh \cdot \left(\sin t \cdot t\_1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.9e183 or 0.23999999999999999 < t

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*35.5%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-135.5%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt35.5%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-135.5%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified35.5%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]

    if -1.9e183 < t < -5.4e6

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

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

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

    if -5.4e6 < t < 0.23999999999999999

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0 96.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*96.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-neg96.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-*l/96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.49999999999999994e194 or 0.95999999999999996 < t

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*35.5%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-135.5%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt35.5%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-135.5%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified35.5%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]

    if -2.49999999999999994e194 < t < -2.35e6

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

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

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

    if -2.35e6 < t < 0.95999999999999996

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    7. Taylor expanded in t around 0 96.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*96.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-neg96.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-*l/96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 54.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.38 \cdot 10^{-64}:\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;ew \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.37999999999999998e-64

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-163.3%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in63.3%

        \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]
    8. Simplified63.3%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]

    if -1.37999999999999998e-64 < ew < -3.999999999999988e-310

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{0 - \mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} \]
    4. Step-by-step derivation
      1. neg-sub071.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < ew < 1.15e-21

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e-21 < 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. Add Preprocessing
    3. Applied egg-rr70.6%

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*57.9%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-157.9%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt57.9%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-157.9%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified57.9%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification53.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.38 \cdot 10^{-64}:\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{elif}\;ew \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(t \cdot eh\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{elif}\;ew \leq 1.15 \cdot 10^{-21}:\\ \;\;\;\;ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(t \cdot eh\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.0% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.2 \cdot 10^{-64}:\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;ew \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -1.19999999999999999e-64

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-163.3%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in63.3%

        \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]
    8. Simplified63.3%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]

    if -1.19999999999999999e-64 < ew < -3.999999999999988e-310

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{0 - \mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} \]
    4. Step-by-step derivation
      1. neg-sub071.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < ew < 1.85000000000000004e-194

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot t\right)} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt2.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot t} \]
    13. Applied egg-rr49.0%

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

    if 1.85000000000000004e-194 < 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. Add Preprocessing
    3. Applied egg-rr71.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*52.7%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-152.7%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt52.7%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-152.7%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified52.7%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification52.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.2 \cdot 10^{-64}:\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{elif}\;ew \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(t \cdot eh\right) \cdot \left(-\sin \tan^{-1} \left(\frac{t \cdot eh}{ew}\right)\right)\\ \mathbf{elif}\;ew \leq 1.85 \cdot 10^{-194}:\\ \;\;\;\;t \cdot \left(eh \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.6% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1:\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

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

\mathbf{else}:\\
\;\;\;\;ew \cdot \cos t\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-129.4%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in29.4%

        \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]
    8. Simplified29.4%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]

    if -1.1000000000000001 < t < 0.849999999999999978

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-*l/97.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.849999999999999978 < t

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*34.6%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-134.6%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt34.6%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-134.6%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified34.6%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.4%

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

Alternative 16: 48.9% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00074 \lor \neg \left(t \leq 11500000000000\right):\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

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


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-125.8%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in25.8%

        \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]
    8. Simplified25.8%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]

    if -7.3999999999999999e-4 < t < 1.15e13

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 48.9% accurate, 8.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.000195:\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{elif}\;t \leq 0.009:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= t -0.000195)
   (* ew (- (cos t)))
   (if (<= t 0.009) (fabs ew) (* ew (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (t <= -0.000195) {
		tmp = ew * -cos(t);
	} else if (t <= 0.009) {
		tmp = fabs(ew);
	} else {
		tmp = 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 (t <= (-0.000195d0)) then
        tmp = ew * -cos(t)
    else if (t <= 0.009d0) then
        tmp = abs(ew)
    else
        tmp = ew * cos(t)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (t <= -0.000195) {
		tmp = ew * -Math.cos(t);
	} else if (t <= 0.009) {
		tmp = Math.abs(ew);
	} else {
		tmp = ew * Math.cos(t);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if t <= -0.000195:
		tmp = ew * -math.cos(t)
	elif t <= 0.009:
		tmp = math.fabs(ew)
	else:
		tmp = ew * math.cos(t)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (t <= -0.000195)
		tmp = Float64(ew * Float64(-cos(t)));
	elseif (t <= 0.009)
		tmp = abs(ew);
	else
		tmp = Float64(ew * cos(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (t <= -0.000195)
		tmp = ew * -cos(t);
	elseif (t <= 0.009)
		tmp = abs(ew);
	else
		tmp = ew * cos(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[t, -0.000195], N[(ew * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], If[LessEqual[t, 0.009], N[Abs[ew], $MachinePrecision], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.000195:\\
\;\;\;\;ew \cdot \left(-\cos t\right)\\

\mathbf{elif}\;t \leq 0.009:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;ew \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.94999999999999996e-4

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
    7. Step-by-step derivation
      1. neg-mul-129.4%

        \[\leadsto \color{blue}{-ew \cdot \cos t} \]
      2. distribute-lft-neg-in29.4%

        \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]
    8. Simplified29.4%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \cos t} \]

    if -1.94999999999999996e-4 < t < 0.00899999999999999932

    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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.00899999999999999932 < t

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*34.6%

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right)} \]
      2. neg-mul-134.6%

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \left({\left(\sqrt[3]{-1}\right)}^{3} \cdot \cos t\right) \]
      3. rem-cube-cbrt34.6%

        \[\leadsto \left(-ew\right) \cdot \left(\color{blue}{-1} \cdot \cos t\right) \]
      4. neg-mul-134.6%

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\left(-\cos t\right)} \]
    6. Simplified34.6%

      \[\leadsto \color{blue}{\left(-ew\right) \cdot \left(-\cos t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.000195:\\ \;\;\;\;ew \cdot \left(-\cos t\right)\\ \mathbf{elif}\;t \leq 0.009:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 42.4% accurate, 9.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 42.4% accurate, 131.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -4 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \end{array} \]
(FPCore (eh ew t) :precision binary64 (if (<= ew -4e-310) (- ew) ew))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -4e-310) {
		tmp = -ew;
	} else {
		tmp = 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 <= (-4d-310)) then
        tmp = -ew
    else
        tmp = ew
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -4e-310) {
		tmp = -ew;
	} else {
		tmp = ew;
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -4e-310:
		tmp = -ew
	else:
		tmp = ew
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -4e-310)
		tmp = Float64(-ew);
	else
		tmp = ew;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -4e-310)
		tmp = -ew;
	else
		tmp = ew;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -4e-310], (-ew), ew]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4 \cdot 10^{-310}:\\
\;\;\;\;-ew\\

\mathbf{else}:\\
\;\;\;\;ew\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -3.999999999999988e-310

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{0 - \mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} \]
    4. Step-by-step derivation
      1. neg-sub074.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot ew} \]
    7. Step-by-step derivation
      1. neg-mul-140.9%

        \[\leadsto \color{blue}{-ew} \]
    8. Simplified40.9%

      \[\leadsto \color{blue}{-ew} \]

    if -3.999999999999988e-310 < 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. Add Preprocessing
    3. Applied egg-rr26.1%

      \[\leadsto \color{blue}{0 - \mathsf{fma}\left(eh \cdot \sin t, \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} \]
    4. Step-by-step derivation
      1. neg-sub026.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot ew} \]
    7. Step-by-step derivation
      1. neg-mul-11.5%

        \[\leadsto \color{blue}{-ew} \]
    8. Simplified1.5%

      \[\leadsto \color{blue}{-ew} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \color{blue}{\sqrt{-ew} \cdot \sqrt{-ew}} \]
      2. sqrt-unprod25.0%

        \[\leadsto \color{blue}{\sqrt{\left(-ew\right) \cdot \left(-ew\right)}} \]
      3. sqr-neg25.0%

        \[\leadsto \sqrt{\color{blue}{ew \cdot ew}} \]
      4. sqrt-unprod38.6%

        \[\leadsto \color{blue}{\sqrt{ew} \cdot \sqrt{ew}} \]
      5. add-sqr-sqrt38.8%

        \[\leadsto \color{blue}{ew} \]
      6. *-un-lft-identity38.8%

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

      \[\leadsto \color{blue}{1 \cdot ew} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -4 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 21.7% accurate, 460.5× 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 Float64(-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.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot ew} \]
  7. Step-by-step derivation
    1. neg-mul-120.7%

      \[\leadsto \color{blue}{-ew} \]
  8. Simplified20.7%

    \[\leadsto \color{blue}{-ew} \]
  9. Add Preprocessing

Reproduce

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