Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 16.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

Alternative 3: 87.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{\tan t}}{ew}\\ t_2 := \cos t \cdot eh\\ t_3 := \sin t \cdot ew\\ t_4 := \left|\sin \tan^{-1} \left(\frac{t\_2}{t\_3}\right) \cdot t\_2\right|\\ \mathbf{if}\;eh \leq -4.8 \cdot 10^{+129}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;eh \leq 1.25 \cdot 10^{+29}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1, t\_2, t\_3\right)}{\cosh \sinh^{-1} t\_1}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ (/ eh (tan t)) ew))
        (t_2 (* (cos t) eh))
        (t_3 (* (sin t) ew))
        (t_4 (fabs (* (sin (atan (/ t_2 t_3))) t_2))))
   (if (<= eh -4.8e+129)
     t_4
     (if (<= eh 1.25e+29)
       (fabs (/ (fma t_1 t_2 t_3) (cosh (asinh t_1))))
       t_4))))
double code(double eh, double ew, double t) {
	double t_1 = (eh / tan(t)) / ew;
	double t_2 = cos(t) * eh;
	double t_3 = sin(t) * ew;
	double t_4 = fabs((sin(atan((t_2 / t_3))) * t_2));
	double tmp;
	if (eh <= -4.8e+129) {
		tmp = t_4;
	} else if (eh <= 1.25e+29) {
		tmp = fabs((fma(t_1, t_2, t_3) / cosh(asinh(t_1))));
	} else {
		tmp = t_4;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(Float64(eh / tan(t)) / ew)
	t_2 = Float64(cos(t) * eh)
	t_3 = Float64(sin(t) * ew)
	t_4 = abs(Float64(sin(atan(Float64(t_2 / t_3))) * t_2))
	tmp = 0.0
	if (eh <= -4.8e+129)
		tmp = t_4;
	elseif (eh <= 1.25e+29)
		tmp = abs(Float64(fma(t_1, t_2, t_3) / cosh(asinh(t_1))));
	else
		tmp = t_4;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[Sin[N[ArcTan[N[(t$95$2 / t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -4.8e+129], t$95$4, If[LessEqual[eh, 1.25e+29], N[Abs[N[(N[(t$95$1 * t$95$2 + t$95$3), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 1.25 \cdot 10^{+29}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1, t\_2, t\_3\right)}{\cosh \sinh^{-1} t\_1}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.7999999999999997e129 or 1.25e29 < eh

    1. Initial program 99.7%

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      3. lower-sin.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

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

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
      6. times-fracN/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      10. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      3. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      4. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      5. lower-sin.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      6. lower-atan.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      7. lower-/.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      8. lower-*.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right| \]
      10. lower-*.f64N/A

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

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

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

    if -4.7999999999999997e129 < eh < 1.25e29

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      6. lift-atan.f64N/A

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

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

        \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. lift-*.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      10. lift-cos.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      11. lift-atan.f64N/A

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

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
    4. Applied rewrites92.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -4.8 \cdot 10^{+129}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{elif}\;eh \leq 1.25 \cdot 10^{+29}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{\tan t}}{ew}\\ t_2 := \cos t \cdot eh\\ t_3 := \sin t \cdot ew\\ t_4 := \left|\sin \tan^{-1} \left(\frac{t\_2}{t\_3}\right) \cdot t\_2\right|\\ \mathbf{if}\;eh \leq -1.1 \cdot 10^{+60}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;eh \leq 1.3 \cdot 10^{+30}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1, t\_2, t\_3\right)}{\sqrt{{t\_1}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ (/ eh (tan t)) ew))
        (t_2 (* (cos t) eh))
        (t_3 (* (sin t) ew))
        (t_4 (fabs (* (sin (atan (/ t_2 t_3))) t_2))))
   (if (<= eh -1.1e+60)
     t_4
     (if (<= eh 1.3e+30)
       (fabs (/ (fma t_1 t_2 t_3) (sqrt (+ (pow t_1 2.0) 1.0))))
       t_4))))
double code(double eh, double ew, double t) {
	double t_1 = (eh / tan(t)) / ew;
	double t_2 = cos(t) * eh;
	double t_3 = sin(t) * ew;
	double t_4 = fabs((sin(atan((t_2 / t_3))) * t_2));
	double tmp;
	if (eh <= -1.1e+60) {
		tmp = t_4;
	} else if (eh <= 1.3e+30) {
		tmp = fabs((fma(t_1, t_2, t_3) / sqrt((pow(t_1, 2.0) + 1.0))));
	} else {
		tmp = t_4;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(Float64(eh / tan(t)) / ew)
	t_2 = Float64(cos(t) * eh)
	t_3 = Float64(sin(t) * ew)
	t_4 = abs(Float64(sin(atan(Float64(t_2 / t_3))) * t_2))
	tmp = 0.0
	if (eh <= -1.1e+60)
		tmp = t_4;
	elseif (eh <= 1.3e+30)
		tmp = abs(Float64(fma(t_1, t_2, t_3) / sqrt(Float64((t_1 ^ 2.0) + 1.0))));
	else
		tmp = t_4;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[Sin[N[ArcTan[N[(t$95$2 / t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.1e+60], t$95$4, If[LessEqual[eh, 1.3e+30], N[Abs[N[(N[(t$95$1 * t$95$2 + t$95$3), $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 1.3 \cdot 10^{+30}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1, t\_2, t\_3\right)}{\sqrt{{t\_1}^{2} + 1}}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.09999999999999998e60 or 1.29999999999999994e30 < eh

    1. Initial program 99.7%

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      3. lower-sin.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

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

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
      6. times-fracN/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      10. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      3. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      4. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      5. lower-sin.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      6. lower-atan.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      7. lower-/.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      8. lower-*.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right| \]
      10. lower-*.f64N/A

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

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

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

    if -1.09999999999999998e60 < eh < 1.29999999999999994e30

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      6. lift-atan.f64N/A

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

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

        \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. lift-*.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      10. lift-cos.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      11. lift-atan.f64N/A

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

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
    4. Applied rewrites94.4%

      \[\leadsto \left|\color{blue}{\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}\right| \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\color{blue}{\sqrt{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \sqrt{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}}\right| \]
      2. sqrt-prodN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\color{blue}{\sqrt{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}}\right| \]
      3. lower-sqrt.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\color{blue}{\sqrt{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}}\right| \]
      4. lift-cosh.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\color{blue}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}\right| \]
      5. lift-asinh.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\cosh \color{blue}{\sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)} \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}\right| \]
      6. cosh-asinhN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\color{blue}{\sqrt{\frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew} + 1}} \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}\right| \]
      7. +-commutativeN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\sqrt{\color{blue}{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}} \cdot \cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}\right| \]
      8. lift-cosh.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}} \cdot \color{blue}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}}\right| \]
      9. lift-asinh.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}} \cdot \cosh \color{blue}{\sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}}}\right| \]
      10. cosh-asinhN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}} \cdot \color{blue}{\sqrt{\frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew} + 1}}}}\right| \]
      11. +-commutativeN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\sqrt{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}} \cdot \sqrt{\color{blue}{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}}\right| \]
      12. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\color{blue}{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right| \]
      13. lower-+.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{\color{blue}{1 + \frac{\frac{eh}{\tan t}}{ew} \cdot \frac{\frac{eh}{\tan t}}{ew}}}}\right| \]
    6. Applied rewrites88.9%

      \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}}}}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.1 \cdot 10^{+60}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{elif}\;eh \leq 1.3 \cdot 10^{+30}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\sqrt{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot eh\\ t_2 := \sin t \cdot ew\\ t_3 := \left|\sin \tan^{-1} \left(\frac{t\_1}{t\_2}\right) \cdot t\_1\right|\\ \mathbf{if}\;eh \leq -2 \cdot 10^{+66}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;eh \leq 6.7 \cdot 10^{+28}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, t\_1, t\_2\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (cos t) eh))
        (t_2 (* (sin t) ew))
        (t_3 (fabs (* (sin (atan (/ t_1 t_2))) t_1))))
   (if (<= eh -2e+66)
     t_3
     (if (<= eh 6.7e+28)
       (fabs
        (/ (fma (/ (/ eh (tan t)) ew) t_1 t_2) (cosh (asinh (/ eh (* ew t))))))
       t_3))))
double code(double eh, double ew, double t) {
	double t_1 = cos(t) * eh;
	double t_2 = sin(t) * ew;
	double t_3 = fabs((sin(atan((t_1 / t_2))) * t_1));
	double tmp;
	if (eh <= -2e+66) {
		tmp = t_3;
	} else if (eh <= 6.7e+28) {
		tmp = fabs((fma(((eh / tan(t)) / ew), t_1, t_2) / cosh(asinh((eh / (ew * t))))));
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(cos(t) * eh)
	t_2 = Float64(sin(t) * ew)
	t_3 = abs(Float64(sin(atan(Float64(t_1 / t_2))) * t_1))
	tmp = 0.0
	if (eh <= -2e+66)
		tmp = t_3;
	elseif (eh <= 6.7e+28)
		tmp = abs(Float64(fma(Float64(Float64(eh / tan(t)) / ew), t_1, t_2) / cosh(asinh(Float64(eh / Float64(ew * t))))));
	else
		tmp = t_3;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[Sin[N[ArcTan[N[(t$95$1 / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2e+66], t$95$3, If[LessEqual[eh, 6.7e+28], N[Abs[N[(N[(N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * t$95$1 + t$95$2), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 6.7 \cdot 10^{+28}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, t\_1, t\_2\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.99999999999999989e66 or 6.7e28 < eh

    1. Initial program 99.7%

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      3. lower-sin.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

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

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
      6. times-fracN/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      10. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      3. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      4. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      5. lower-sin.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      6. lower-atan.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      7. lower-/.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      8. lower-*.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right| \]
      10. lower-*.f64N/A

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

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

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

    if -1.99999999999999989e66 < eh < 6.7e28

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      6. lift-atan.f64N/A

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

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

        \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. lift-*.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      10. lift-cos.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      11. lift-atan.f64N/A

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

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
    4. Applied rewrites94.4%

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

      \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}}\right| \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}}\right| \]
      2. lower-*.f6477.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2 \cdot 10^{+66}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{elif}\;eh \leq 6.7 \cdot 10^{+28}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{\tan t}}{ew}, \cos t \cdot eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.1% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;eh \leq 6.7 \cdot 10^{+28}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_1, t\_2\right)}{1}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.99999999999999989e66 or 6.7e28 < eh

    1. Initial program 99.7%

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      3. lower-sin.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

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

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
      6. times-fracN/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      10. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      3. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(eh \cdot \cos t\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      4. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right| \]
      5. lower-sin.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      6. lower-atan.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      7. lower-/.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
      8. lower-*.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right| \]
      10. lower-*.f64N/A

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

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

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

    if -1.99999999999999989e66 < eh < 6.7e28

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      6. lift-atan.f64N/A

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

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

        \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. lift-*.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      10. lift-cos.f64N/A

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
      11. lift-atan.f64N/A

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

        \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
    4. Applied rewrites94.4%

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

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

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

        \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
      3. Step-by-step derivation
        1. associate-/r*N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
        2. lower-/.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
        3. lower-/.f6466.1

          \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\color{blue}{\frac{eh}{ew}}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
      4. Applied rewrites66.1%

        \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
    7. Recombined 2 regimes into one program.
    8. Final simplification75.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2 \cdot 10^{+66}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{elif}\;eh \leq 6.7 \cdot 10^{+28}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t \cdot eh}{\sin t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \]
    9. Add Preprocessing

    Alternative 7: 59.0% accurate, 2.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot ew\\ t_2 := \cos t \cdot eh\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{-137}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-77}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{t} \cdot \frac{\cos t}{ew}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (sin t) ew)) (t_2 (* (cos t) eh)))
       (if (<= t -4.2e-137)
         (fabs (/ (fma (/ (/ eh ew) t) t_2 t_1) 1.0))
         (if (<= t 1.45e-77)
           (fabs (* (sin (atan (* (/ eh t) (/ (cos t) ew)))) eh))
           (fabs (/ (fma (/ eh (* ew t)) t_2 t_1) 1.0))))))
    double code(double eh, double ew, double t) {
    	double t_1 = sin(t) * ew;
    	double t_2 = cos(t) * eh;
    	double tmp;
    	if (t <= -4.2e-137) {
    		tmp = fabs((fma(((eh / ew) / t), t_2, t_1) / 1.0));
    	} else if (t <= 1.45e-77) {
    		tmp = fabs((sin(atan(((eh / t) * (cos(t) / ew)))) * eh));
    	} else {
    		tmp = fabs((fma((eh / (ew * t)), t_2, t_1) / 1.0));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(sin(t) * ew)
    	t_2 = Float64(cos(t) * eh)
    	tmp = 0.0
    	if (t <= -4.2e-137)
    		tmp = abs(Float64(fma(Float64(Float64(eh / ew) / t), t_2, t_1) / 1.0));
    	elseif (t <= 1.45e-77)
    		tmp = abs(Float64(sin(atan(Float64(Float64(eh / t) * Float64(cos(t) / ew)))) * eh));
    	else
    		tmp = abs(Float64(fma(Float64(eh / Float64(ew * t)), t_2, t_1) / 1.0));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, -4.2e-137], N[Abs[N[(N[(N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.45e-77], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(eh / t), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \sin t \cdot ew\\
    t_2 := \cos t \cdot eh\\
    \mathbf{if}\;t \leq -4.2 \cdot 10^{-137}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\
    
    \mathbf{elif}\;t \leq 1.45 \cdot 10^{-77}:\\
    \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{t} \cdot \frac{\cos t}{ew}\right) \cdot eh\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if t < -4.19999999999999983e-137

      1. Initial program 99.7%

        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        6. lift-atan.f64N/A

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

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

          \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        9. lift-*.f64N/A

          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
        10. lift-cos.f64N/A

          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
        11. lift-atan.f64N/A

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

          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
      4. Applied rewrites69.5%

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

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

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

          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
        3. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
          2. lower-/.f64N/A

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

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

          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]

        if -4.19999999999999983e-137 < t < 1.4499999999999999e-77

        1. Initial program 100.0%

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

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

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

            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
          3. lower-sin.f64N/A

            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
          4. lower-atan.f64N/A

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

            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
          6. times-fracN/A

            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
          7. lower-*.f64N/A

            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
          8. lower-/.f64N/A

            \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
          9. lower-cos.f64N/A

            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
          10. lower-/.f64N/A

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

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

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

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

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

          if 1.4499999999999999e-77 < t

          1. Initial program 99.6%

            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            6. lift-atan.f64N/A

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

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

              \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            9. lift-*.f64N/A

              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
            10. lift-cos.f64N/A

              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
            11. lift-atan.f64N/A

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

              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
          4. Applied rewrites75.5%

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

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

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

              \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
            3. Step-by-step derivation
              1. associate-/r*N/A

                \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
              2. lower-/.f64N/A

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

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

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

                \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{eh}{\color{blue}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
            6. Recombined 3 regimes into one program.
            7. Final simplification60.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-137}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-77}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{t} \cdot \frac{\cos t}{ew}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|\\ \end{array} \]
            8. Add Preprocessing

            Alternative 8: 59.0% accurate, 2.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot ew\\ t_2 := \cos t \cdot eh\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{-137}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-77}:\\ \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (let* ((t_1 (* (sin t) ew)) (t_2 (* (cos t) eh)))
               (if (<= t -4.2e-137)
                 (fabs (/ (fma (/ (/ eh ew) t) t_2 t_1) 1.0))
                 (if (<= t 1.45e-77)
                   (fabs (* (tanh (asinh (/ (/ eh (tan t)) ew))) eh))
                   (fabs (/ (fma (/ eh (* ew t)) t_2 t_1) 1.0))))))
            double code(double eh, double ew, double t) {
            	double t_1 = sin(t) * ew;
            	double t_2 = cos(t) * eh;
            	double tmp;
            	if (t <= -4.2e-137) {
            		tmp = fabs((fma(((eh / ew) / t), t_2, t_1) / 1.0));
            	} else if (t <= 1.45e-77) {
            		tmp = fabs((tanh(asinh(((eh / tan(t)) / ew))) * eh));
            	} else {
            		tmp = fabs((fma((eh / (ew * t)), t_2, t_1) / 1.0));
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	t_1 = Float64(sin(t) * ew)
            	t_2 = Float64(cos(t) * eh)
            	tmp = 0.0
            	if (t <= -4.2e-137)
            		tmp = abs(Float64(fma(Float64(Float64(eh / ew) / t), t_2, t_1) / 1.0));
            	elseif (t <= 1.45e-77)
            		tmp = abs(Float64(tanh(asinh(Float64(Float64(eh / tan(t)) / ew))) * eh));
            	else
            		tmp = abs(Float64(fma(Float64(eh / Float64(ew * t)), t_2, t_1) / 1.0));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, -4.2e-137], N[Abs[N[(N[(N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.45e-77], N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \sin t \cdot ew\\
            t_2 := \cos t \cdot eh\\
            \mathbf{if}\;t \leq -4.2 \cdot 10^{-137}:\\
            \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\
            
            \mathbf{elif}\;t \leq 1.45 \cdot 10^{-77}:\\
            \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if t < -4.19999999999999983e-137

              1. Initial program 99.7%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-+.f64N/A

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

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

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

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

                  \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                6. lift-atan.f64N/A

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

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

                  \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                9. lift-*.f64N/A

                  \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                10. lift-cos.f64N/A

                  \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                11. lift-atan.f64N/A

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

                  \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
              4. Applied rewrites69.5%

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

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

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

                  \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                3. Step-by-step derivation
                  1. associate-/r*N/A

                    \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                  2. lower-/.f64N/A

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

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

                  \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]

                if -4.19999999999999983e-137 < t < 1.4499999999999999e-77

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                  3. lower-sin.f64N/A

                    \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                  4. lower-atan.f64N/A

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

                    \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                  6. times-fracN/A

                    \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                  7. lower-*.f64N/A

                    \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                  8. lower-/.f64N/A

                    \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                  9. lower-cos.f64N/A

                    \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                  10. lower-/.f64N/A

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

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

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

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

                  if 1.4499999999999999e-77 < t

                  1. Initial program 99.6%

                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-+.f64N/A

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

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

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

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

                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    6. lift-atan.f64N/A

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

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

                      \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    9. lift-*.f64N/A

                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                    10. lift-cos.f64N/A

                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                    11. lift-atan.f64N/A

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

                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
                  4. Applied rewrites75.5%

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

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

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

                      \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                    3. Step-by-step derivation
                      1. associate-/r*N/A

                        \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                      2. lower-/.f64N/A

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

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

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

                        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{eh}{\color{blue}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                    6. Recombined 3 regimes into one program.
                    7. Add Preprocessing

                    Alternative 9: 55.4% accurate, 3.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot ew\\ t_2 := \cos t \cdot eh\\ \mathbf{if}\;t \leq -2.5 \cdot 10^{-137}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\ \mathbf{elif}\;t \leq 1.38 \cdot 10^{-77}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333 \cdot \frac{eh}{ew}, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\ \end{array} \end{array} \]
                    (FPCore (eh ew t)
                     :precision binary64
                     (let* ((t_1 (* (sin t) ew)) (t_2 (* (cos t) eh)))
                       (if (<= t -2.5e-137)
                         (fabs (/ (fma (/ (/ eh ew) t) t_2 t_1) 1.0))
                         (if (<= t 1.38e-77)
                           (fabs
                            (*
                             (sin
                              (atan
                               (/ (fma (* t t) (* -0.3333333333333333 (/ eh ew)) (/ eh ew)) t)))
                             eh))
                           (fabs (/ (fma (/ eh (* ew t)) t_2 t_1) 1.0))))))
                    double code(double eh, double ew, double t) {
                    	double t_1 = sin(t) * ew;
                    	double t_2 = cos(t) * eh;
                    	double tmp;
                    	if (t <= -2.5e-137) {
                    		tmp = fabs((fma(((eh / ew) / t), t_2, t_1) / 1.0));
                    	} else if (t <= 1.38e-77) {
                    		tmp = fabs((sin(atan((fma((t * t), (-0.3333333333333333 * (eh / ew)), (eh / ew)) / t))) * eh));
                    	} else {
                    		tmp = fabs((fma((eh / (ew * t)), t_2, t_1) / 1.0));
                    	}
                    	return tmp;
                    }
                    
                    function code(eh, ew, t)
                    	t_1 = Float64(sin(t) * ew)
                    	t_2 = Float64(cos(t) * eh)
                    	tmp = 0.0
                    	if (t <= -2.5e-137)
                    		tmp = abs(Float64(fma(Float64(Float64(eh / ew) / t), t_2, t_1) / 1.0));
                    	elseif (t <= 1.38e-77)
                    		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(-0.3333333333333333 * Float64(eh / ew)), Float64(eh / ew)) / t))) * eh));
                    	else
                    		tmp = abs(Float64(fma(Float64(eh / Float64(ew * t)), t_2, t_1) / 1.0));
                    	end
                    	return tmp
                    end
                    
                    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, -2.5e-137], N[Abs[N[(N[(N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.38e-77], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(-0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \sin t \cdot ew\\
                    t_2 := \cos t \cdot eh\\
                    \mathbf{if}\;t \leq -2.5 \cdot 10^{-137}:\\
                    \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, t\_2, t\_1\right)}{1}\right|\\
                    
                    \mathbf{elif}\;t \leq 1.38 \cdot 10^{-77}:\\
                    \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333 \cdot \frac{eh}{ew}, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, t\_2, t\_1\right)}{1}\right|\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if t < -2.5e-137

                      1. Initial program 99.7%

                        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-+.f64N/A

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

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

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

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

                          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                        6. lift-atan.f64N/A

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

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

                          \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                        9. lift-*.f64N/A

                          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                        10. lift-cos.f64N/A

                          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                        11. lift-atan.f64N/A

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

                          \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
                      4. Applied rewrites69.5%

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

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

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

                          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                        3. Step-by-step derivation
                          1. associate-/r*N/A

                            \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                          2. lower-/.f64N/A

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

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

                          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]

                        if -2.5e-137 < t < 1.3799999999999999e-77

                        1. Initial program 100.0%

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

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

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

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                          3. lower-sin.f64N/A

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                          4. lower-atan.f64N/A

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

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                          6. times-fracN/A

                            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                          7. lower-*.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                          8. lower-/.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          9. lower-cos.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          10. lower-/.f64N/A

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

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

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

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

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

                          if 1.3799999999999999e-77 < t

                          1. Initial program 99.6%

                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-+.f64N/A

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

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

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

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

                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            6. lift-atan.f64N/A

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

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

                              \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            9. lift-*.f64N/A

                              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                            10. lift-cos.f64N/A

                              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                            11. lift-atan.f64N/A

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

                              \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}}\right| \]
                          4. Applied rewrites75.5%

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

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

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

                              \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                            3. Step-by-step derivation
                              1. associate-/r*N/A

                                \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                              2. lower-/.f64N/A

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

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

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

                                \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{eh}{\color{blue}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                            6. Recombined 3 regimes into one program.
                            7. Final simplification57.6%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-137}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|\\ \mathbf{elif}\;t \leq 1.38 \cdot 10^{-77}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333 \cdot \frac{eh}{ew}, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|\\ \end{array} \]
                            8. Add Preprocessing

                            Alternative 10: 43.0% accurate, 3.5× speedup?

                            \[\begin{array}{l} \\ \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \end{array} \]
                            (FPCore (eh ew t)
                             :precision binary64
                             (fabs (/ (fma (/ (/ eh ew) t) (* (cos t) eh) (* (sin t) ew)) 1.0)))
                            double code(double eh, double ew, double t) {
                            	return fabs((fma(((eh / ew) / t), (cos(t) * eh), (sin(t) * ew)) / 1.0));
                            }
                            
                            function code(eh, ew, t)
                            	return abs(Float64(fma(Float64(Float64(eh / ew) / t), Float64(cos(t) * eh), Float64(sin(t) * ew)) / 1.0))
                            end
                            
                            code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew}}{t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.7%

                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-+.f64N/A

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

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

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

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

                                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                              6. lift-atan.f64N/A

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

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

                                \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                              9. lift-*.f64N/A

                                \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                              10. lift-cos.f64N/A

                                \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                              11. lift-atan.f64N/A

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

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

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

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

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

                                \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                              3. Step-by-step derivation
                                1. associate-/r*N/A

                                  \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                                2. lower-/.f64N/A

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

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

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

                              Alternative 11: 42.9% accurate, 3.5× speedup?

                              \[\begin{array}{l} \\ \left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \end{array} \]
                              (FPCore (eh ew t)
                               :precision binary64
                               (fabs (/ (fma (/ eh (* ew t)) (* (cos t) eh) (* (sin t) ew)) 1.0)))
                              double code(double eh, double ew, double t) {
                              	return fabs((fma((eh / (ew * t)), (cos(t) * eh), (sin(t) * ew)) / 1.0));
                              }
                              
                              function code(eh, ew, t)
                              	return abs(Float64(fma(Float64(eh / Float64(ew * t)), Float64(cos(t) * eh), Float64(sin(t) * ew)) / 1.0))
                              end
                              
                              code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right|
                              \end{array}
                              
                              Derivation
                              1. Initial program 99.7%

                                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-+.f64N/A

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

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

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

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

                                  \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                6. lift-atan.f64N/A

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

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

                                  \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                9. lift-*.f64N/A

                                  \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                10. lift-cos.f64N/A

                                  \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                11. lift-atan.f64N/A

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

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

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

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

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

                                  \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{eh}{ew \cdot t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                                3. Step-by-step derivation
                                  1. associate-/r*N/A

                                    \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                                  2. lower-/.f64N/A

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

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

                                  \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{ew}}{t}}, \cos t \cdot eh, \sin t \cdot ew\right)}{1}\right| \]
                                5. Step-by-step derivation
                                  1. Applied rewrites44.9%

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

                                  Alternative 12: 41.9% accurate, 8.1× speedup?

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

                                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                    6. lift-atan.f64N/A

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

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

                                      \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                    9. lift-*.f64N/A

                                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                    10. lift-cos.f64N/A

                                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                    11. lift-atan.f64N/A

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

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

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

                                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                  6. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                    2. lower-sin.f6443.9

                                      \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                                  7. Applied rewrites43.9%

                                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                  8. Final simplification43.9%

                                    \[\leadsto \left|\sin t \cdot ew\right| \]
                                  9. Add Preprocessing

                                  Alternative 13: 19.0% accurate, 108.8× speedup?

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

                                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)} \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                    6. lift-atan.f64N/A

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

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

                                      \[\leadsto \left|\color{blue}{\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                    9. lift-*.f64N/A

                                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                    10. lift-cos.f64N/A

                                      \[\leadsto \left|\frac{\frac{\frac{eh}{ew}}{\tan t} \cdot \left(eh \cdot \cos t\right)}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}} + \left(ew \cdot \sin t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                                    11. lift-atan.f64N/A

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

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

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

                                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                  6. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                    2. lower-sin.f6443.9

                                      \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                                  7. Applied rewrites43.9%

                                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                  8. Taylor expanded in t around 0

                                    \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
                                  9. Step-by-step derivation
                                    1. Applied rewrites17.8%

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

                                    Reproduce

                                    ?
                                    herbie shell --seed 2024298 
                                    (FPCore (eh ew t)
                                      :name "Example from Robby"
                                      :precision binary64
                                      (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))