Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 13.5s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -5.4999999999999997e-51

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -5.4999999999999997e-51 < ew < 8.00000000000000033e-215

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000033e-215 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\tan t}{ew}\\
t_2 := t\_1 \cdot eh\\
t_3 := \sin t \cdot eh\\
t_4 := eh \cdot t\_1\\
\mathbf{if}\;ew \leq -5.5 \cdot 10^{-51}:\\
\;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, \left(t\_4 \cdot eh\right) \cdot \left(-\sin t\right)\right) \cdot \cos \tan^{-1} t\_4\right|\\

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

\mathbf{else}:\\
\;\;\;\;\left|\frac{t\_3 \cdot t\_2 + \cos t \cdot ew}{{\cos \tan^{-1} t\_2}^{-1}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -5.4999999999999997e-51

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -5.4999999999999997e-51 < ew < 8.00000000000000033e-215

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000033e-215 < ew

    1. Initial program 99.8%

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

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

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

Alternative 5: 99.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \frac{\tan t}{ew}\\ t_2 := \sin t \cdot eh\\ \mathbf{if}\;ew \leq -5.5 \cdot 10^{-51} \lor \neg \left(ew \leq 8 \cdot 10^{-215}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, \left(t\_1 \cdot eh\right) \cdot \left(-\sin t\right)\right) \cdot \cos \tan^{-1} t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_2 \cdot \sin \tan^{-1} \left(\frac{\frac{t\_2}{ew}}{\cos t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (/ (tan t) ew))) (t_2 (* (sin t) eh)))
   (if (or (<= ew -5.5e-51) (not (<= ew 8e-215)))
     (fabs
      (* (fma (- ew) (cos t) (* (* t_1 eh) (- (sin t)))) (cos (atan t_1))))
     (fabs (* t_2 (sin (atan (/ (/ t_2 ew) (cos t)))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * (tan(t) / ew);
	double t_2 = sin(t) * eh;
	double tmp;
	if ((ew <= -5.5e-51) || !(ew <= 8e-215)) {
		tmp = fabs((fma(-ew, cos(t), ((t_1 * eh) * -sin(t))) * cos(atan(t_1))));
	} else {
		tmp = fabs((t_2 * sin(atan(((t_2 / ew) / cos(t))))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(eh * Float64(tan(t) / ew))
	t_2 = Float64(sin(t) * eh)
	tmp = 0.0
	if ((ew <= -5.5e-51) || !(ew <= 8e-215))
		tmp = abs(Float64(fma(Float64(-ew), cos(t), Float64(Float64(t_1 * eh) * Float64(-sin(t)))) * cos(atan(t_1))));
	else
		tmp = abs(Float64(t_2 * sin(atan(Float64(Float64(t_2 / ew) / cos(t))))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[Or[LessEqual[ew, -5.5e-51], N[Not[LessEqual[ew, 8e-215]], $MachinePrecision]], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision] + N[(N[(t$95$1 * eh), $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(t$95$2 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \frac{\tan t}{ew}\\
t_2 := \sin t \cdot eh\\
\mathbf{if}\;ew \leq -5.5 \cdot 10^{-51} \lor \neg \left(ew \leq 8 \cdot 10^{-215}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, \left(t\_1 \cdot eh\right) \cdot \left(-\sin t\right)\right) \cdot \cos \tan^{-1} t\_1\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -5.4999999999999997e-51 or 8.00000000000000033e-215 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -5.4999999999999997e-51 < ew < 8.00000000000000033e-215

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -5.5 \cdot 10^{-51} \lor \neg \left(ew \leq 8 \cdot 10^{-215}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(-ew, \cos t, \left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \left(-\sin t\right)\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 61.9% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\left|\frac{\frac{1}{ew}}{\cos \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\mathsf{fma}\left(-0.5, t \cdot t, 1\right)}\right) \cdot \cos t}\right|} \]
    2. Step-by-step derivation
      1. Applied rewrites67.2%

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

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

      Alternative 8: 72.0% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \cos t \cdot ew\\ \mathbf{if}\;ew \leq -1.65 \cdot 10^{-50}:\\ \;\;\;\;\left|t\_2 \cdot \cos \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right)\right|\\ \mathbf{elif}\;ew \leq 1.52 \cdot 10^{-161}:\\ \;\;\;\;\left|t\_1 \cdot \sin \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{\sin t}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{t\_2 + t\_1 \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}{\frac{-1}{{\left({\left(\frac{t}{ew} \cdot eh\right)}^{2} + 1\right)}^{-0.5}}}\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (sin t) eh)) (t_2 (* (cos t) ew)))
         (if (<= ew -1.65e-50)
           (fabs (* t_2 (cos (atan (/ (/ t_1 ew) (cos t))))))
           (if (<= ew 1.52e-161)
             (fabs (* t_1 (sin (atan (* (/ eh (cos t)) (/ (sin t) ew))))))
             (fabs
              (/
               (+ t_2 (* t_1 (* (/ (tan t) ew) eh)))
               (/ -1.0 (pow (+ (pow (* (/ t ew) eh) 2.0) 1.0) -0.5))))))))
      double code(double eh, double ew, double t) {
      	double t_1 = sin(t) * eh;
      	double t_2 = cos(t) * ew;
      	double tmp;
      	if (ew <= -1.65e-50) {
      		tmp = fabs((t_2 * cos(atan(((t_1 / ew) / cos(t))))));
      	} else if (ew <= 1.52e-161) {
      		tmp = fabs((t_1 * sin(atan(((eh / cos(t)) * (sin(t) / ew))))));
      	} else {
      		tmp = fabs(((t_2 + (t_1 * ((tan(t) / ew) * eh))) / (-1.0 / pow((pow(((t / ew) * eh), 2.0) + 1.0), -0.5))));
      	}
      	return tmp;
      }
      
      real(8) function code(eh, ew, t)
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = sin(t) * eh
          t_2 = cos(t) * ew
          if (ew <= (-1.65d-50)) then
              tmp = abs((t_2 * cos(atan(((t_1 / ew) / cos(t))))))
          else if (ew <= 1.52d-161) then
              tmp = abs((t_1 * sin(atan(((eh / cos(t)) * (sin(t) / ew))))))
          else
              tmp = abs(((t_2 + (t_1 * ((tan(t) / ew) * eh))) / ((-1.0d0) / (((((t / ew) * eh) ** 2.0d0) + 1.0d0) ** (-0.5d0)))))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.sin(t) * eh;
      	double t_2 = Math.cos(t) * ew;
      	double tmp;
      	if (ew <= -1.65e-50) {
      		tmp = Math.abs((t_2 * Math.cos(Math.atan(((t_1 / ew) / Math.cos(t))))));
      	} else if (ew <= 1.52e-161) {
      		tmp = Math.abs((t_1 * Math.sin(Math.atan(((eh / Math.cos(t)) * (Math.sin(t) / ew))))));
      	} else {
      		tmp = Math.abs(((t_2 + (t_1 * ((Math.tan(t) / ew) * eh))) / (-1.0 / Math.pow((Math.pow(((t / ew) * eh), 2.0) + 1.0), -0.5))));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.sin(t) * eh
      	t_2 = math.cos(t) * ew
      	tmp = 0
      	if ew <= -1.65e-50:
      		tmp = math.fabs((t_2 * math.cos(math.atan(((t_1 / ew) / math.cos(t))))))
      	elif ew <= 1.52e-161:
      		tmp = math.fabs((t_1 * math.sin(math.atan(((eh / math.cos(t)) * (math.sin(t) / ew))))))
      	else:
      		tmp = math.fabs(((t_2 + (t_1 * ((math.tan(t) / ew) * eh))) / (-1.0 / math.pow((math.pow(((t / ew) * eh), 2.0) + 1.0), -0.5))))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(sin(t) * eh)
      	t_2 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (ew <= -1.65e-50)
      		tmp = abs(Float64(t_2 * cos(atan(Float64(Float64(t_1 / ew) / cos(t))))));
      	elseif (ew <= 1.52e-161)
      		tmp = abs(Float64(t_1 * sin(atan(Float64(Float64(eh / cos(t)) * Float64(sin(t) / ew))))));
      	else
      		tmp = abs(Float64(Float64(t_2 + Float64(t_1 * Float64(Float64(tan(t) / ew) * eh))) / Float64(-1.0 / (Float64((Float64(Float64(t / ew) * eh) ^ 2.0) + 1.0) ^ -0.5))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = sin(t) * eh;
      	t_2 = cos(t) * ew;
      	tmp = 0.0;
      	if (ew <= -1.65e-50)
      		tmp = abs((t_2 * cos(atan(((t_1 / ew) / cos(t))))));
      	elseif (ew <= 1.52e-161)
      		tmp = abs((t_1 * sin(atan(((eh / cos(t)) * (sin(t) / ew))))));
      	else
      		tmp = abs(((t_2 + (t_1 * ((tan(t) / ew) * eh))) / (-1.0 / (((((t / ew) * eh) ^ 2.0) + 1.0) ^ -0.5))));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[ew, -1.65e-50], N[Abs[N[(t$95$2 * N[Cos[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.52e-161], N[Abs[N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$2 + N[(t$95$1 * N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Power[N[(N[Power[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin t \cdot eh\\
      t_2 := \cos t \cdot ew\\
      \mathbf{if}\;ew \leq -1.65 \cdot 10^{-50}:\\
      \;\;\;\;\left|t\_2 \cdot \cos \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right)\right|\\
      
      \mathbf{elif}\;ew \leq 1.52 \cdot 10^{-161}:\\
      \;\;\;\;\left|t\_1 \cdot \sin \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{\sin t}{ew}\right)\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\frac{t\_2 + t\_1 \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}{\frac{-1}{{\left({\left(\frac{t}{ew} \cdot eh\right)}^{2} + 1\right)}^{-0.5}}}\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if ew < -1.6499999999999999e-50

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.6499999999999999e-50 < ew < 1.52000000000000002e-161

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.52000000000000002e-161 < ew

        1. Initial program 99.8%

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

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

          \[\leadsto \left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)}}\right| \]
        5. Step-by-step derivation
          1. lower-/.f6477.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 74.4% accurate, 1.6× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.6499999999999999e-50 < ew < 1.69999999999999991e-161

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 10: 74.4% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right)\\ \mathbf{if}\;ew \leq -1.65 \cdot 10^{-50} \lor \neg \left(ew \leq 1.7 \cdot 10^{-161}\right):\\ \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos t\_2\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t\_1 \cdot \sin t\_2\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (sin t) eh)) (t_2 (atan (/ (/ t_1 ew) (cos t)))))
         (if (or (<= ew -1.65e-50) (not (<= ew 1.7e-161)))
           (fabs (* (* (cos t) ew) (cos t_2)))
           (fabs (* t_1 (sin t_2))))))
      double code(double eh, double ew, double t) {
      	double t_1 = sin(t) * eh;
      	double t_2 = atan(((t_1 / ew) / cos(t)));
      	double tmp;
      	if ((ew <= -1.65e-50) || !(ew <= 1.7e-161)) {
      		tmp = fabs(((cos(t) * ew) * cos(t_2)));
      	} else {
      		tmp = fabs((t_1 * sin(t_2)));
      	}
      	return tmp;
      }
      
      real(8) function code(eh, ew, t)
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = sin(t) * eh
          t_2 = atan(((t_1 / ew) / cos(t)))
          if ((ew <= (-1.65d-50)) .or. (.not. (ew <= 1.7d-161))) then
              tmp = abs(((cos(t) * ew) * cos(t_2)))
          else
              tmp = abs((t_1 * sin(t_2)))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.sin(t) * eh;
      	double t_2 = Math.atan(((t_1 / ew) / Math.cos(t)));
      	double tmp;
      	if ((ew <= -1.65e-50) || !(ew <= 1.7e-161)) {
      		tmp = Math.abs(((Math.cos(t) * ew) * Math.cos(t_2)));
      	} else {
      		tmp = Math.abs((t_1 * Math.sin(t_2)));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.sin(t) * eh
      	t_2 = math.atan(((t_1 / ew) / math.cos(t)))
      	tmp = 0
      	if (ew <= -1.65e-50) or not (ew <= 1.7e-161):
      		tmp = math.fabs(((math.cos(t) * ew) * math.cos(t_2)))
      	else:
      		tmp = math.fabs((t_1 * math.sin(t_2)))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(sin(t) * eh)
      	t_2 = atan(Float64(Float64(t_1 / ew) / cos(t)))
      	tmp = 0.0
      	if ((ew <= -1.65e-50) || !(ew <= 1.7e-161))
      		tmp = abs(Float64(Float64(cos(t) * ew) * cos(t_2)));
      	else
      		tmp = abs(Float64(t_1 * sin(t_2)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = sin(t) * eh;
      	t_2 = atan(((t_1 / ew) / cos(t)));
      	tmp = 0.0;
      	if ((ew <= -1.65e-50) || ~((ew <= 1.7e-161)))
      		tmp = abs(((cos(t) * ew) * cos(t_2)));
      	else
      		tmp = abs((t_1 * sin(t_2)));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[ew, -1.65e-50], N[Not[LessEqual[ew, 1.7e-161]], $MachinePrecision]], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin t \cdot eh\\
      t_2 := \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right)\\
      \mathbf{if}\;ew \leq -1.65 \cdot 10^{-50} \lor \neg \left(ew \leq 1.7 \cdot 10^{-161}\right):\\
      \;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos t\_2\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|t\_1 \cdot \sin t\_2\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -1.6499999999999999e-50 or 1.69999999999999991e-161 < ew

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.6499999999999999e-50 < ew < 1.69999999999999991e-161

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 62.2% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 62.2% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 51.3% accurate, 2.3× speedup?

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

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

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

        \[\leadsto \left|\frac{\left(\sin t \cdot \left(-eh\right)\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot eh\right)}}\right| \]
      5. Step-by-step derivation
        1. lower-/.f6462.7

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

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

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

          \[\leadsto \left|\frac{\color{blue}{\left(\mathsf{neg}\left(\frac{{eh}^{2} \cdot {t}^{2}}{ew}\right)\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)}}\right| \]
        2. distribute-neg-frac2N/A

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

          \[\leadsto \left|\frac{\color{blue}{\frac{{eh}^{2} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)}} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)}}\right| \]
        4. unpow2N/A

          \[\leadsto \left|\frac{\frac{\color{blue}{\left(eh \cdot eh\right)} \cdot {t}^{2}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)}}\right| \]
        5. unpow2N/A

          \[\leadsto \left|\frac{\frac{\left(eh \cdot eh\right) \cdot \color{blue}{\left(t \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)}}\right| \]
        6. unswap-sqrN/A

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

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

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

          \[\leadsto \left|\frac{\frac{\left(eh \cdot t\right) \cdot \color{blue}{\left(eh \cdot t\right)}}{\mathsf{neg}\left(ew\right)} - \cos t \cdot ew}{\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)}}\right| \]
        10. lower-neg.f6460.6

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

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

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

      Alternative 14: 42.6% accurate, 61.6× speedup?

      \[\begin{array}{l} \\ \left|\frac{ew}{1}\right| \end{array} \]
      (FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
      double code(double eh, double ew, double t) {
      	return fabs((ew / 1.0));
      }
      
      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 / 1.0d0))
      end function
      
      public static double code(double eh, double ew, double t) {
      	return Math.abs((ew / 1.0));
      }
      
      def code(eh, ew, t):
      	return math.fabs((ew / 1.0))
      
      function code(eh, ew, t)
      	return abs(Float64(ew / 1.0))
      end
      
      function tmp = code(eh, ew, t)
      	tmp = abs((ew / 1.0));
      end
      
      code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left|\frac{ew}{1}\right|
      \end{array}
      
      Derivation
      1. Initial program 99.8%

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

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

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

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

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

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

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

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

            \[\leadsto \left|\frac{ew}{1}\right| \]
          3. Step-by-step derivation
            1. Applied rewrites49.0%

              \[\leadsto \left|\frac{ew}{1}\right| \]
            2. Add Preprocessing

            Reproduce

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