Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.3s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := \frac{1}{eh \cdot \sqrt{\mathsf{fma}\left(eh, \frac{eh}{ew \cdot \left(ew \cdot \left(t \cdot t\right)\right)}, 1\right)}}\\
t_3 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_4 := \left|t\_1 \cdot \sin t\_3 + \left(ew \cdot \sin t\right) \cdot \cos t\_3\right|\\
t_5 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
t_6 := \cos t \cdot t\_5\\
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{-165}:\\
\;\;\;\;\left|eh \cdot \mathsf{fma}\left(\sin t \cdot t\_2, ew, t\_6\right)\right|\\

\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+239}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{1 + \frac{eh \cdot eh}{\left(t \cdot ew\right) \cdot \left(t \cdot ew\right)}}}, ew, t\_1 \cdot t\_5\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \mathsf{fma}\left(\sin t, ew \cdot t\_2, t\_6\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 4.99999999999999981e-165

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e-165 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 5.00000000000000007e239

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000007e239 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))))

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_3 := \left|t\_1 \cdot \sin t\_2 + \left(ew \cdot \sin t\right) \cdot \cos t\_2\right|\\
t_4 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
t_5 := \left|eh \cdot \mathsf{fma}\left(\sin t \cdot \frac{1}{eh \cdot \sqrt{\mathsf{fma}\left(eh, \frac{eh}{ew \cdot \left(ew \cdot \left(t \cdot t\right)\right)}, 1\right)}}, ew, \cos t \cdot t\_4\right)\right|\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+239}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{1 + \frac{eh \cdot eh}{\left(t \cdot ew\right) \cdot \left(t \cdot ew\right)}}}, ew, t\_1 \cdot t\_4\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 4.99999999999999981e-165 or 5.00000000000000007e239 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))))

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e-165 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 5.00000000000000007e239

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

Alternative 5: 93.3% accurate, 1.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(eh, \cos t \cdot \frac{t\_3}{ew}, t\_2\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -3.3e8

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e8 < ew < 2e21

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e21 < ew

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 93.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;ew \leq 1.9 \cdot 10^{+22}:\\
\;\;\;\;\left|eh \cdot \mathsf{fma}\left(\sin t \cdot \frac{1}{eh \cdot t\_1}, ew, t\_3\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -4.9999999999999997e32

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e32 < ew < 1.9000000000000002e22

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000002e22 < ew

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 93.2% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.19999999999999996e32 or 5e20 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999996e32 < ew < 5e20

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 93.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;ew \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;\left|eh \cdot \mathsf{fma}\left(\sin t \cdot \frac{1}{eh \cdot t\_1}, ew, \cos t \cdot t\_2\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -9.9999999999999995e32 or 2.79999999999999996e-5 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e32 < ew < 2.79999999999999996e-5

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.9% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0145000000000000007 or 9.9999999999999998e-20 < t

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if -0.0145000000000000007 < t < 9.9999999999999998e-20

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;ew \leq 8.2 \cdot 10^{+17}:\\
\;\;\;\;\left|t\_1\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -6.20000000000000009e56 or 8.2e17 < ew

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      if -6.20000000000000009e56 < ew < 8.2e17

      1. Initial program 99.7%

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

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

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

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

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

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

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

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

          \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
        2. cos-lowering-cos.f6485.5

          \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
      9. Simplified85.5%

        \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
    9. Recombined 2 regimes into one program.
    10. Final simplification79.3%

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

    Alternative 11: 74.9% accurate, 3.5× speedup?

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

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\frac{eh \cdot eh}{t \cdot ew}, \frac{1}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{\color{blue}{\left(ew \cdot ew\right)} \cdot {t}^{2}}, 1\right)}}, \frac{ew \cdot \sin t}{\sqrt{1 + \frac{eh \cdot eh}{\left(t \cdot ew\right) \cdot \left(t \cdot ew\right)}}}\right)\right| \]
        3. unpow2N/A

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\frac{eh \cdot eh}{t \cdot ew}, \frac{1}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{\color{blue}{\left(ew \cdot t\right)} \cdot \left(ew \cdot t\right)}, 1\right)}}, \frac{ew \cdot \sin t}{\sqrt{1 + \frac{eh \cdot eh}{\left(t \cdot ew\right) \cdot \left(t \cdot ew\right)}}}\right)\right| \]
        7. *-lowering-*.f6473.3

          \[\leadsto \left|\mathsf{fma}\left(\frac{eh \cdot eh}{t \cdot ew}, \frac{1}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{\left(ew \cdot t\right) \cdot \color{blue}{\left(ew \cdot t\right)}}, 1\right)}}, \frac{ew \cdot \sin t}{\sqrt{1 + \frac{eh \cdot eh}{\left(t \cdot ew\right) \cdot \left(t \cdot ew\right)}}}\right)\right| \]
      12. Simplified73.3%

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

      if -2.6e96 < ew < 4.3e15

      1. Initial program 99.7%

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

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

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

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

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

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

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

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

          \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
        2. cos-lowering-cos.f6482.5

          \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
      9. Simplified82.5%

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

      if 4.3e15 < ew

      1. Initial program 99.7%

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

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

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

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

          \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
      6. Simplified71.9%

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

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

    Alternative 12: 75.6% accurate, 7.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|eh \cdot \cos t\right|\\ \mathbf{if}\;eh \leq -1.18 \cdot 10^{-88}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 5.4 \cdot 10^{-89}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (fabs (* eh (cos t)))))
       (if (<= eh -1.18e-88) t_1 (if (<= eh 5.4e-89) (fabs (* ew (sin t))) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = fabs((eh * cos(t)));
    	double tmp;
    	if (eh <= -1.18e-88) {
    		tmp = t_1;
    	} else if (eh <= 5.4e-89) {
    		tmp = fabs((ew * 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((eh * cos(t)))
        if (eh <= (-1.18d-88)) then
            tmp = t_1
        else if (eh <= 5.4d-89) then
            tmp = abs((ew * 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((eh * Math.cos(t)));
    	double tmp;
    	if (eh <= -1.18e-88) {
    		tmp = t_1;
    	} else if (eh <= 5.4e-89) {
    		tmp = Math.abs((ew * Math.sin(t)));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	t_1 = math.fabs((eh * math.cos(t)))
    	tmp = 0
    	if eh <= -1.18e-88:
    		tmp = t_1
    	elif eh <= 5.4e-89:
    		tmp = math.fabs((ew * math.sin(t)))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(eh, ew, t)
    	t_1 = abs(Float64(eh * cos(t)))
    	tmp = 0.0
    	if (eh <= -1.18e-88)
    		tmp = t_1;
    	elseif (eh <= 5.4e-89)
    		tmp = abs(Float64(ew * sin(t)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	t_1 = abs((eh * cos(t)));
    	tmp = 0.0;
    	if (eh <= -1.18e-88)
    		tmp = t_1;
    	elseif (eh <= 5.4e-89)
    		tmp = abs((ew * sin(t)));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.18e-88], t$95$1, If[LessEqual[eh, 5.4e-89], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left|eh \cdot \cos t\right|\\
    \mathbf{if}\;eh \leq -1.18 \cdot 10^{-88}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 5.4 \cdot 10^{-89}:\\
    \;\;\;\;\left|ew \cdot \sin t\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -1.18000000000000004e-88 or 5.39999999999999975e-89 < eh

      1. Initial program 99.7%

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

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

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

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

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

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

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

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

          \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
        2. cos-lowering-cos.f6481.8

          \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
      9. Simplified81.8%

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

      if -1.18000000000000004e-88 < eh < 5.39999999999999975e-89

      1. Initial program 99.7%

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

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

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

          \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
        2. sin-lowering-sin.f6471.1

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

        \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 13: 61.3% accurate, 8.1× speedup?

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
      2. cos-lowering-cos.f6463.3

        \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
    9. Simplified63.3%

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

    Alternative 14: 43.9% accurate, 43.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -2.5 \cdot 10^{-89}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{elif}\;eh \leq 1.2 \cdot 10^{-185}:\\ \;\;\;\;\left|t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (if (<= eh -2.5e-89)
       (fabs eh)
       (if (<= eh 1.2e-185) (fabs (* t ew)) (fabs eh))))
    double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -2.5e-89) {
    		tmp = fabs(eh);
    	} else if (eh <= 1.2e-185) {
    		tmp = fabs((t * ew));
    	} else {
    		tmp = fabs(eh);
    	}
    	return tmp;
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        real(8) :: tmp
        if (eh <= (-2.5d-89)) then
            tmp = abs(eh)
        else if (eh <= 1.2d-185) then
            tmp = abs((t * ew))
        else
            tmp = abs(eh)
        end if
        code = tmp
    end function
    
    public static double code(double eh, double ew, double t) {
    	double tmp;
    	if (eh <= -2.5e-89) {
    		tmp = Math.abs(eh);
    	} else if (eh <= 1.2e-185) {
    		tmp = Math.abs((t * ew));
    	} else {
    		tmp = Math.abs(eh);
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	tmp = 0
    	if eh <= -2.5e-89:
    		tmp = math.fabs(eh)
    	elif eh <= 1.2e-185:
    		tmp = math.fabs((t * ew))
    	else:
    		tmp = math.fabs(eh)
    	return tmp
    
    function code(eh, ew, t)
    	tmp = 0.0
    	if (eh <= -2.5e-89)
    		tmp = abs(eh);
    	elseif (eh <= 1.2e-185)
    		tmp = abs(Float64(t * ew));
    	else
    		tmp = abs(eh);
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	tmp = 0.0;
    	if (eh <= -2.5e-89)
    		tmp = abs(eh);
    	elseif (eh <= 1.2e-185)
    		tmp = abs((t * ew));
    	else
    		tmp = abs(eh);
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := If[LessEqual[eh, -2.5e-89], N[Abs[eh], $MachinePrecision], If[LessEqual[eh, 1.2e-185], N[Abs[N[(t * ew), $MachinePrecision]], $MachinePrecision], N[Abs[eh], $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;eh \leq -2.5 \cdot 10^{-89}:\\
    \;\;\;\;\left|eh\right|\\
    
    \mathbf{elif}\;eh \leq 1.2 \cdot 10^{-185}:\\
    \;\;\;\;\left|t \cdot ew\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|eh\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -2.49999999999999983e-89 or 1.2000000000000001e-185 < eh

      1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
        2. div-invN/A

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

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

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot \frac{1}{ew \cdot \tan t}\right) \cdot \color{blue}{\left(eh \cdot \frac{1}{ew \cdot \tan t}\right)}}}\right)\right| \]
        6. swap-sqrN/A

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

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot eh\right) \cdot \left({\left(ew \cdot \tan t\right)}^{-1} \cdot \color{blue}{{\left(ew \cdot \tan t\right)}^{-1}}\right)}}\right)\right| \]
        9. pow-prod-upN/A

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot eh\right) \cdot {\left(ew \cdot \tan t\right)}^{\color{blue}{-2}}}}\right)\right| \]
      7. Applied egg-rr13.1%

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

        \[\leadsto \left|\color{blue}{eh}\right| \]
      9. Step-by-step derivation
        1. Simplified53.4%

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

        if -2.49999999999999983e-89 < eh < 1.2000000000000001e-185

        1. Initial program 99.7%

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. sin-lowering-sin.f6476.0

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Simplified76.0%

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

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

            \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
          2. *-lowering-*.f6429.7

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

          \[\leadsto \left|\color{blue}{t \cdot ew}\right| \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 15: 41.2% accurate, 290.0× speedup?

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
        2. div-invN/A

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

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

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot \frac{1}{ew \cdot \tan t}\right) \cdot \color{blue}{\left(eh \cdot \frac{1}{ew \cdot \tan t}\right)}}}\right)\right| \]
        6. swap-sqrN/A

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

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot eh\right) \cdot \left({\left(ew \cdot \tan t\right)}^{-1} \cdot \color{blue}{{\left(ew \cdot \tan t\right)}^{-1}}\right)}}\right)\right| \]
        9. pow-prod-upN/A

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

          \[\leadsto \left|eh \cdot \left(eh \cdot \frac{\frac{1}{ew \cdot \tan t}}{\sqrt{1 + \left(eh \cdot eh\right) \cdot {\left(ew \cdot \tan t\right)}^{\color{blue}{-2}}}}\right)\right| \]
      7. Applied egg-rr10.6%

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

        \[\leadsto \left|\color{blue}{eh}\right| \]
      9. Step-by-step derivation
        1. Simplified43.2%

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

        Reproduce

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