Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.8s
Alternatives: 11
Speedup: N/A×

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 11 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.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh \cdot \tan t}{-ew}\\
\left|\mathsf{fma}\left(\sin \tan^{-1} t\_1 \cdot \left(-eh\right), \sin t, \frac{ew \cdot \cos t}{\sqrt{{t\_1}^{2} + 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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

Alternative 2: 91.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;ew \leq 1.02 \cdot 10^{+42}:\\
\;\;\;\;\left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \cdot \frac{\sin t}{ew}, eh \cdot \left(-ew\right), t\_1\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(t\_2, eh \cdot \sin t, t\_1\right)\right|}{\sqrt{{t\_2}^{2} + 1}}\\


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

    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. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(\mathsf{neg}\left(ew\right)\right) \cdot \mathsf{fma}\left(eh, \frac{\sin t \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{eh \cdot t}{ew}}\right)\right)}{ew}, \mathsf{neg}\left(\cos t\right)\right)\right| \]
      2. *-lowering-*.f6494.4

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

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

    if 1.8000000000000001e-268 < ew < 1.01999999999999996e42

    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. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.01999999999999996e42 < ew

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|\mathsf{fma}\left(eh \cdot \frac{\tan t}{ew}, eh \cdot \sin t, \color{blue}{ew \cdot \cos t}\right)\right|}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}} \]
      10. cos-lowering-cos.f6499.8

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

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

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

Alternative 3: 91.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;ew \leq 8 \cdot 10^{+41}:\\
\;\;\;\;\left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \cdot \frac{\sin t}{ew}, eh \cdot \left(-ew\right), t\_1\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(eh, \sin t \cdot t\_2, t\_1\right)\right|}{\sqrt{{t\_2}^{2} + 1}}\\


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

    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. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(\mathsf{neg}\left(ew\right)\right) \cdot \mathsf{fma}\left(eh, \frac{\sin t \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{eh \cdot t}{ew}}\right)\right)}{ew}, \mathsf{neg}\left(\cos t\right)\right)\right| \]
      2. *-lowering-*.f6494.4

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

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

    if 2.5e-268 < ew < 8.00000000000000005e41

    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. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000005e41 < ew

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.8% accurate, 1.5× speedup?

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

\\
\left|ew \cdot \mathsf{fma}\left(eh, \frac{1}{\frac{ew}{\sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \cdot \sin t}}, -\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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.8% accurate, 1.6× speedup?

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

\\
\left|ew \cdot \mathsf{fma}\left(eh, \sin t \cdot \frac{\sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)}{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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.6% accurate, 1.9× speedup?

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

\\
\left|ew \cdot \mathsf{fma}\left(eh, \frac{1}{\frac{ew}{\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right)}}, -\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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(\mathsf{neg}\left(ew\right)\right) \cdot \mathsf{fma}\left(eh, \frac{1}{\frac{ew}{\sin t \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{eh}{ew} \cdot t}\right)\right)}}, \mathsf{neg}\left(\cos t\right)\right)\right| \]
    3. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

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

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

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

Alternative 7: 90.6% accurate, 1.9× speedup?

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

\\
\left|ew \cdot \mathsf{fma}\left(eh, \frac{\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right)}{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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(\mathsf{neg}\left(ew\right)\right) \cdot \mathsf{fma}\left(eh, \frac{\sin t \cdot \sin \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\frac{eh \cdot t}{ew}}\right)\right)}{ew}, \mathsf{neg}\left(\cos t\right)\right)\right| \]
    2. *-lowering-*.f6492.4

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

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

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

Alternative 8: 73.8% accurate, 6.1× speedup?

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

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

\mathbf{elif}\;ew \leq 0.0065:\\
\;\;\;\;\frac{-1}{\frac{-1}{\left|eh \cdot \sin t\right|}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.3999999999999999e-47 or 0.0064999999999999997 < 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. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      2. cos-lowering-cos.f6483.9

        \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
    7. Simplified83.9%

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

    if -2.3999999999999999e-47 < ew < 0.0064999999999999997

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
    5. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. sin-lowering-sin.f6471.3

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Simplified71.3%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.4 \cdot 10^{-47}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;ew \leq 0.0065:\\ \;\;\;\;\frac{-1}{\frac{-1}{\left|eh \cdot \sin t\right|}}\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.0% accurate, 8.0× speedup?

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

\\
\left|ew \cdot \cos t\right|
\end{array}
Derivation
  1. Initial program 99.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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    2. cos-lowering-cos.f6461.6

      \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
  7. Simplified61.6%

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

Alternative 10: 42.6% accurate, 287.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{ew}\right| \]
  6. Step-by-step derivation
    1. Simplified42.4%

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

    Alternative 11: 22.9% accurate, 862.0× speedup?

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

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. /-lowering-/.f6442.3

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Simplified42.3%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \frac{1}{\left|\color{blue}{{ew}^{-1}}\right|} \]
      2. sqr-powN/A

        \[\leadsto \frac{1}{\left|\color{blue}{{ew}^{\left(\frac{-1}{2}\right)} \cdot {ew}^{\left(\frac{-1}{2}\right)}}\right|} \]
      3. fabs-sqrN/A

        \[\leadsto \frac{1}{\color{blue}{{ew}^{\left(\frac{-1}{2}\right)} \cdot {ew}^{\left(\frac{-1}{2}\right)}}} \]
      4. sqr-powN/A

        \[\leadsto \frac{1}{\color{blue}{{ew}^{-1}}} \]
      5. inv-powN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{ew}}} \]
      6. clear-numN/A

        \[\leadsto \color{blue}{\frac{ew}{1}} \]
      7. /-rgt-identity25.8

        \[\leadsto \color{blue}{ew} \]
    8. Applied egg-rr25.8%

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

    Reproduce

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