Example 2 from Robby

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\ \left|\cos t\_1 \cdot \left(ew \cdot \cos t\right) - eh \cdot \left(\sin t \cdot \sin t\_1\right)\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(eh * Float64(tan(t) / Float64(-ew))))
	return abs(Float64(Float64(cos(t_1) * Float64(ew * cos(t))) - Float64(eh * Float64(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[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

Alternative 3: 98.2% 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(\left(-eh\right) \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(Float64(-eh) * Float64(tan(t) / 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(\left(-eh\right) \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. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(ew, \mathsf{log1p}\left(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| \]
  9. Add Preprocessing

Alternative 4: 91.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\\ \mathbf{if}\;eh \leq -2.1 \cdot 10^{+138}:\\ \;\;\;\;\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 (* (- eh) (/ (tan t) ew))))))
   (if (<= eh -2.1e+138)
     (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((-eh * (tan(t) / ew))));
	double tmp;
	if (eh <= -2.1e+138) {
		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((-eh * (tan(t) / ew))))
    if (eh <= (-2.1d+138)) 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((-eh * (Math.tan(t) / ew))));
	double tmp;
	if (eh <= -2.1e+138) {
		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((-eh * (math.tan(t) / ew))))
	tmp = 0
	if eh <= -2.1e+138:
		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(Float64(-eh) * Float64(tan(t) / ew))))
	tmp = 0.0
	if (eh <= -2.1e+138)
		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((-eh * (tan(t) / ew))));
	tmp = 0.0;
	if (eh <= -2.1e+138)
		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[((-eh) * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.1e+138], 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(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\\
\mathbf{if}\;eh \leq -2.1 \cdot 10^{+138}:\\
\;\;\;\;\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 < -2.10000000000000007e138

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\frac{\sqrt[3]{{\cos t}^{2}}}{1} \cdot \frac{\sqrt[3]{\cos t}}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right| \]
    9. Step-by-step derivation
      1. /-rgt-identity98.4%

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

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

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

      \[\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| \]
    12. Step-by-step derivation
      1. associate-/l*91.7%

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

        \[\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-*r/91.7%

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

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

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

      \[\leadsto \left|\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)}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.6%

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

Alternative 5: 76.8% accurate, 1.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if ew < -2.80000000000000008e34

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000008e34 < ew < -1.45e-200

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e-200 < ew < 2.69999999999999994e-73

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

      \[\leadsto \left|\color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)}\right| \]
    6. Step-by-step derivation
      1. *-commutative79.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*79.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. *-commutative79.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-neg79.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. distribute-frac-neg279.4%

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

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

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

    if 2.69999999999999994e-73 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 71.3% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;eh \leq 2.6 \cdot 10^{+98}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


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

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

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

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

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

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

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

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

    if -3.4e14 < eh < 2.6e98

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e98 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.8% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.2e14 or 3.99999999999999999e98 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e14 < eh < 3.99999999999999999e98

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 74.8% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.4e14 or 1.65000000000000014e98 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in ew around 0 74.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. *-commutative74.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*74.5%

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

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

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

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

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

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

    if -3.4e14 < eh < 1.65000000000000014e98

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 72.9% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;t \leq -3.3 \cdot 10^{+19}:\\
\;\;\;\;eh \cdot \left(-\sin t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.45e128 or 4400 < 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. *-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e128 < t < -3.3e19

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg57.4%

        \[\leadsto \color{blue}{-eh \cdot \sin t} \]
      2. distribute-rgt-neg-in57.4%

        \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]
    10. Simplified57.4%

      \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]

    if -3.3e19 < t < 4400

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 63.5% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;eh \leq 5.8 \cdot 10^{+99}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999e91 < eh < 5.8000000000000004e99

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000004e99 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg52.1%

        \[\leadsto \color{blue}{-eh \cdot \sin t} \]
      2. distribute-rgt-neg-in52.1%

        \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]
    10. Simplified52.1%

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

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

Alternative 11: 63.6% accurate, 4.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3.9 \cdot 10^{+103} \lor \neg \left(eh \leq 2.6 \cdot 10^{+99}\right):\\
\;\;\;\;eh \cdot \left(-\sin t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -3.8999999999999998e103 or 2.6e99 < eh

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg50.0%

        \[\leadsto \color{blue}{-eh \cdot \sin t} \]
      2. distribute-rgt-neg-in50.0%

        \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]
    10. Simplified50.0%

      \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]

    if -3.8999999999999998e103 < eh < 2.6e99

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -3.9 \cdot 10^{+103} \lor \neg \left(eh \leq 2.6 \cdot 10^{+99}\right):\\ \;\;\;\;eh \cdot \left(-\sin t\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.4% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \left(-\sin t\right)\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 0.000112:\\ \;\;\;\;\left|ew\right|\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+193}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \sin t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (- (sin t)))))
   (if (<= t -3.1e-28)
     t_1
     (if (<= t 0.000112) (fabs ew) (if (<= t 6.2e+193) t_1 (* eh (sin t)))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * -sin(t);
	double tmp;
	if (t <= -3.1e-28) {
		tmp = t_1;
	} else if (t <= 0.000112) {
		tmp = fabs(ew);
	} else if (t <= 6.2e+193) {
		tmp = t_1;
	} else {
		tmp = eh * sin(t);
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = eh * -sin(t)
    if (t <= (-3.1d-28)) then
        tmp = t_1
    else if (t <= 0.000112d0) then
        tmp = abs(ew)
    else if (t <= 6.2d+193) then
        tmp = t_1
    else
        tmp = eh * sin(t)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = eh * -Math.sin(t);
	double tmp;
	if (t <= -3.1e-28) {
		tmp = t_1;
	} else if (t <= 0.000112) {
		tmp = Math.abs(ew);
	} else if (t <= 6.2e+193) {
		tmp = t_1;
	} else {
		tmp = eh * Math.sin(t);
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = eh * -math.sin(t)
	tmp = 0
	if t <= -3.1e-28:
		tmp = t_1
	elif t <= 0.000112:
		tmp = math.fabs(ew)
	elif t <= 6.2e+193:
		tmp = t_1
	else:
		tmp = eh * math.sin(t)
	return tmp
function code(eh, ew, t)
	t_1 = Float64(eh * Float64(-sin(t)))
	tmp = 0.0
	if (t <= -3.1e-28)
		tmp = t_1;
	elseif (t <= 0.000112)
		tmp = abs(ew);
	elseif (t <= 6.2e+193)
		tmp = t_1;
	else
		tmp = Float64(eh * sin(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = eh * -sin(t);
	tmp = 0.0;
	if (t <= -3.1e-28)
		tmp = t_1;
	elseif (t <= 0.000112)
		tmp = abs(ew);
	elseif (t <= 6.2e+193)
		tmp = t_1;
	else
		tmp = eh * sin(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * (-N[Sin[t], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t, -3.1e-28], t$95$1, If[LessEqual[t, 0.000112], N[Abs[ew], $MachinePrecision], If[LessEqual[t, 6.2e+193], t$95$1, N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \left(-\sin t\right)\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \sin t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.09999999999999992e-28 or 1.11999999999999998e-4 < t < 6.19999999999999972e193

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg38.3%

        \[\leadsto \color{blue}{-eh \cdot \sin t} \]
      2. distribute-rgt-neg-in38.3%

        \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]
    10. Simplified38.3%

      \[\leadsto \color{blue}{eh \cdot \left(-\sin t\right)} \]

    if -3.09999999999999992e-28 < t < 1.11999999999999998e-4

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.19999999999999972e193 < t

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \sin t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 49.2% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+48} \lor \neg \left(t \leq 1.2 \cdot 10^{-5}\right):\\
\;\;\;\;eh \cdot \sin t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.79999999999999992e48 or 1.2e-5 < 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. Step-by-step derivation
      1. sub-neg99.7%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sin t \cdot \color{blue}{\frac{eh \cdot \frac{\tan t}{ew}}{\sqrt{1 + \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot \frac{\tan t}{ew}\right)}}}, eh, ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right) \]
      2. *-commutative39.0%

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \sin t} \]

    if -1.79999999999999992e48 < t < 1.2e-5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+48} \lor \neg \left(t \leq 1.2 \cdot 10^{-5}\right):\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 50.0% accurate, 8.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+35}:\\
\;\;\;\;ew \cdot \cos t\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{-5}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \sin t\\


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    8. Step-by-step derivation
      1. add-sqr-sqrt29.0%

        \[\leadsto \left|\color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}}\right| \]
      2. fabs-sqr29.0%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \cos t} \cdot \sqrt{ew \cdot \cos t}} \]
      3. add-sqr-sqrt29.9%

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      4. *-commutative29.9%

        \[\leadsto \color{blue}{\cos t \cdot ew} \]
    9. Applied egg-rr29.9%

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

    if -1.20000000000000007e35 < t < 1.3499999999999999e-5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3499999999999999e-5 < 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. Step-by-step derivation
      1. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \sin t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+35}:\\ \;\;\;\;ew \cdot \cos t\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-5}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \sin t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 43.2% 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. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 43.2% accurate, 131.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \end{array} \]
(FPCore (eh ew t) :precision binary64 (if (<= ew -5e-310) (- ew) ew))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -5e-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 <= (-5d-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 <= -5e-310) {
		tmp = -ew;
	} else {
		tmp = ew;
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -5e-310:
		tmp = -ew
	else:
		tmp = ew
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -5e-310)
		tmp = Float64(-ew);
	else
		tmp = ew;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -5e-310)
		tmp = -ew;
	else
		tmp = ew;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -5e-310], (-ew), ew]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-ew\\

\mathbf{else}:\\
\;\;\;\;ew\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -4.999999999999985e-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. Step-by-step derivation
      1. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot ew} \]
    9. Step-by-step derivation
      1. neg-mul-140.3%

        \[\leadsto \color{blue}{-ew} \]
    10. Simplified40.3%

      \[\leadsto \color{blue}{-ew} \]

    if -4.999999999999985e-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. Step-by-step derivation
      1. fabs-sub99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew}\right| \]
    8. Step-by-step derivation
      1. add-sqr-sqrt40.2%

        \[\leadsto \color{blue}{\sqrt{\left|ew\right|} \cdot \sqrt{\left|ew\right|}} \]
      2. sqrt-unprod26.5%

        \[\leadsto \color{blue}{\sqrt{\left|ew\right| \cdot \left|ew\right|}} \]
      3. sqr-abs26.5%

        \[\leadsto \sqrt{\color{blue}{ew \cdot ew}} \]
      4. sqrt-unprod40.2%

        \[\leadsto \color{blue}{\sqrt{ew} \cdot \sqrt{ew}} \]
      5. add-sqr-sqrt40.5%

        \[\leadsto \color{blue}{ew} \]
      6. *-un-lft-identity40.5%

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

      \[\leadsto \color{blue}{1 \cdot ew} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 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. Step-by-step derivation
    1. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot ew} \]
  9. Step-by-step derivation
    1. neg-mul-121.2%

      \[\leadsto \color{blue}{-ew} \]
  10. Simplified21.2%

    \[\leadsto \color{blue}{-ew} \]
  11. Add Preprocessing

Reproduce

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